aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/reading/component/widget/style/Modal.scala
blob: faf325d3f373f2ddd0fdfc1426d639890f9c21e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package reading.component.widget.style

import scalacss.Defaults._

import reading.Media
import reading.component.style.{ Color => C, Button }

object Modal extends StyleSheet.Inline {
  import dsl._

  val modal = style(
    display.flex,
    justifyContent.center,
    position.fixed,
    width(100.%%),
    height(100.%%),
    top(0.px),
    right(0.px),
    bottom(0.px),
    left(0.px),
    opacity(0),
    overflowY.scroll
  )

  val curtain = style(
    Media.desktop(
      width(100.%%),
      height(100.%%),
      position.fixed,
      top(0.px),
      left(0.px),
      backgroundColor(C.black.value),
      opacity(0.7),
      cursor.pointer
    ),
    Media.mobile(
      display.none
    )
  )

  val content = style(
    position.relative,
    backgroundColor(C.white.value),
    margin.auto,
    Media.desktop(
      width(50.%%),
      borderRadius(5.px)
    ),
    Media.mobile(
      width(100.%%),
      height(100.%%),
      overflowY.auto
    ),
    padding(30.px, 30.px, 0.px, 30.px)
  )

  val close = style(
    Media.desktop(display.none),
    Media.mobile(
      Button.simple,
      marginTop(20.px),
      marginBottom(30.px)
    )
  )
}