-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathStyles.hs
234 lines (191 loc) · 6.77 KB
/
Styles.hs
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
{-# LANGUAGE OverloadedStrings #-}
module Styles (Styles.root, general) where
import Clay
import qualified Clay.Media as M
import Data.Text.Lazy
import qualified Data.Map as Map
editWidth = 648
minOutWidth = 590
sep = 20
bigScreen = editWidth + sep + minOutWidth
-- http://www.colourlovers.com/palette/49963/let_them_eat_cake
palette :: String -> Color
palette c = case Map.lookup c colors of
Nothing -> transparent
Just x -> x
where colors = Map.fromList [ ("near black", "#212121")
, ("near white", "#f2f2f2")
, ("light gray", "#dedede")
, ("plain gray", "#808080")
, ("decorative", "#c5e0dc")
, ("background", "#fbf9f5")
, ("bg borders", "#ece5ce")
, ("boldest bg", "#fcf6ef")
, ("bold walls", "#f1d4af")
, ("darkest bg", "#575757")
, ("dull walls", "#dbdbdb")
, ("dullest bg", "#f5f5f5")
, ("dull bg #2", "#ededed")
, ("test wrong", "#e86868")
, ("test right", "#6be868")
, ("big action", "#78a9a8")
, ("linky blue", "#1482C7")
, ("warning yo", "#e07575")]
root :: Text
root = render $ do
body ? do
margin (px 0) (px 0) (px 0) (px 0)
fontFamily ["Open Sans"] [serif]
fontSize (px 16)
color $ palette "near black"
"a" ? do
textDecoration none
color $ palette "linky blue"
".topbar" ? do
height (px 6)
backgroundColor $ palette "decorative"
header ? do
height (px 100)
lineHeight (px 100)
fontSize (px 20)
textAlign (alignSide sideCenter)
".io-wrap" ? do
position relative
margin (px 0) auto (px 0) auto
query Clay.all [M.minWidth (px bigScreen)] $ do
width (px bigScreen)
section # ".in" ? width (px editWidth)
section # ".out" ? do
position absolute
top (px 0)
right (px 0)
width (px minOutWidth)
maxHeight (pct 100)
query Clay.all [M.maxWidth (px $ bigScreen - 1)] $ do
width (px editWidth)
section # ".out" ? margin (px sep) (px 0) (px 0) (px 0)
section # ".out" ? do
boxSizing borderBox
fontSize (px 13)
border solid (px 1) $ palette "dull walls"
overflow auto
backgroundColor $ palette "dullest bg"
".test" ? do
position relative
":nth-child(even)" & do
backgroundColor $ palette "dull bg #2"
".success" ? do
position absolute
top (px 0)
left (px 0)
width (px 10)
height (pct 100)
".true" & backgroundColor (palette "test right")
".false" & backgroundColor (palette "test wrong")
".overview" ? do
padding (px 10) (px 10) (px 10) (px 20)
".dashboard" ? do
display flex
marginBottom (px sep)
".problem" ? do
width (pct 80)
boxSizing borderBox
padding (px 10) (px 10) (px 10) (px 10)
border solid (px 1) $ palette "bg borders"
backgroundColor $ palette "background"
".control" ? do
"flex" -: "1"
marginLeft (px 20)
padding (px 10) (px 10) (px 10) (px 10)
border solid (px 1) $ palette "bold walls"
backgroundColor $ palette "boldest bg"
textAlign (alignSide sideCenter)
"nav" ? do
display none
position relative
height (px 60)
margin (px 20) (px 0) (px 0) (px 0)
textAlign (alignSide sideCenter)
overflow hidden
"a" ? do
position absolute
display block
height (pct 100)
".all" & do
width (px 60)
fontSize (px 40)
color $ palette "plain gray"
boxSizing borderBox
border solid (px 1) $ palette "dull walls"
borderRadius (px 4) (px 0) (px 0) (px 4)
borderRightWidth (px 0)
"span" ? lineHeight (px 60)
".next" & do
right (px 0)
width (other "calc(100% - 60px)")
lineHeight (px 60)
borderRadius (px 0) (px 4) (px 4) (px 0)
backgroundColor $ palette "big action"
color $ palette "near white"
fontWeight bold
".termbar" ? do
height (px 30)
padding (px 0) (px 10) (px 0) (px 10)
borderRadius (px 5) (px 5) (px 0) (px 0)
fontSize (px 20)
color $ palette "light gray"
backgroundColor $ palette "darkest bg"
".left" ? do
float floatLeft
".filename" ? do
position absolute
fontSize (px 14)
".right" ? float floatRight
"span" ? do
lineHeight (px 30)
cursor pointer
"data-disabled=\"true\"" & do
opacity 0.4
"#terminal" ? do
height (px 300)
fontFamily ["Source Code Pro"] [monospace]
fontSize (px 14)
boxShadow (px 0) (px 3) (px 6) (rgba 0 0 0 51)
transition "box-shadow" 0.3 ease 0
"#terminal.ace_focus" ? boxShadow (px 0) (px 3) (px 6) (rgba 0 0 0 102)
".warning" ? do
display none
height (px 30)
lineHeight (px 30)
textAlign (alignSide sideCenter)
borderRadius (px 0) (px 0) (px 3) (px 3)
color $ palette "near white"
boxShadow (px 0) (px 3) (px 6) (rgba 0 0 0 51)
backgroundColor $ palette "warning yo"
footer ? do
margin (px 50) (px 0) (px 8) (px 0)
textAlign (alignSide sideCenter)
".quote" ? fontStyle italic
general :: Text
general = render $ do
body ? do
margin (px 0) (px 0) (px 0) (px 0)
fontFamily ["Open Sans"] [serif]
fontSize (px 16)
color $ palette "near black"
"a" ? do
textDecoration none
color $ palette "linky blue"
".topbar" ? do
height (px 6)
backgroundColor $ palette "decorative"
header ? do
height (px 100)
lineHeight (px 100)
fontSize (px 20)
textAlign (alignSide sideCenter)
".wrap" ? do
position relative
margin (px 0) auto (px 0) auto
width (px editWidth)
".num" ? fontWeight bold