-
Notifications
You must be signed in to change notification settings - Fork 16
/
lolliclock.styl
275 lines (251 loc) · 5.93 KB
/
lolliclock.styl
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
@import 'nib'
primary100 = #B3E5FC
primary500 = #03A9F4
primary700 = #0288D1
darkTextColor = #212121
EASE_OUT = cubic-bezier(.4, 0, .2, 1)
//relative animation function
t(x)
(3 * x)ms
.lolliclock-popover
position absolute
top 0
left 0
z-index 100
display none
width 196px
height 324px
border-radius 2px
box-shadow 0 2px 5px 0 rgba(0, 0, 0, 0.26), 0 2px 10px 0 rgba(0, 0, 0, 0.16)
font-family "Roboto", 'Helvetica Neue, Helvetica, Arial', sans-serif
background #FFFFFF
font-size 20px
user-select none
.lolliclock-popover.animate
max-height 0
animation: open-popover t(100) forwards EASE_OUT
@keyframes open-popover
0% {max-height: 0;}
100% {max-height: 380px;}
.lolliclock-popover.animate-out
animation: open-popover t(50) forwards reverse EASE_OUT
//Header
.lolliclock-header
background primary500
height 85px
width 196px
display flex
color white
font-size 2.3em
font-weight 400
align-items center
justify-content center
overflow hidden
position absolute
.lolliclock-header.animate
height 0
animation: slide-header t(50) t(50) forwards EASE_OUT
.lolliclock-header.animate-out
animation: slide-header t(50) forwards reverse EASE_OUT
@keyframes slide-header
0% {height: 0;}
100% {height: 85px;}
.lolliclock-time
display flex
align-self center
.lolliclock-primary-text
color #ffffff
.lolliclock-hours
width 51px
text-align right
opacity .6
cursor pointer
overflow hidden
height 54px
.lolliclock-colon
opacity .6
cursor default
.lolliclock-minutes
width 51px
opacity .6
cursor pointer
overflow hidden
height 54px
.lolliclock-am-pm
cursor pointer
font-size 10px
position absolute
top 47px
left 157px
opacity .6
padding 3px
.lolliclock-primary-text
opacity 1
.lolliclock-time-old
opacity 1
height 54px
.lolliclock-time-new
opacity 0
.lolliclock-time .old-up
animation: transition-top-up t(100) forwards EASE_OUT
.lolliclock-time .new-up
animation: transition-bottom-up t(100) forwards EASE_OUT
.lolliclock-time .old-down
animation: transition-top-up t(100) forwards reverse EASE_OUT
.lolliclock-time .new-down
animation: transition-bottom-up t(100) forwards reverse EASE_OUT
@keyframes transition-top-up
0% { margin-top: 0; opacity: 1; }
100% { margin-top: -54px; opacity: 0; }
@keyframes transition-bottom-up
0% { opacity: 0; }
100% { opacity: 1; }
.lolliclock-minutes .lolliclock-time-old.animate
animation: transition-top-up t(25) t(70) forwards EASE_OUT
.lolliclock-minutes .lolliclock-time-new.animate
animation: transition-bottom-up t(25) t(70) forwards EASE_OUT
.lolliclock-hours .lolliclock-time-old.animate
animation: transition-top-up t(25) t(75) forwards EASE_OUT
.lolliclock-hours .lolliclock-time-new.animate
animation: transition-bottom-up t(25) t(75) forwards EASE_OUT
.popover-content
padding 18px 14px
width 168px
height 203px
top 85px
position absolute
.lolliclock-plate
.lolliclock-canvas
.lolliclock-dial
width 168px
height 168px
.lolliclock-dial
transition all t(100)
.lolliclock-dial-out
transform scale(1.25, 1.25)
opacity 0
// .lolliclock-canvas-out
// opacity 0.25 //temporary hand fade while the minutes hand animates in
// transition opacity 175ms
.lolliclock-plate
background rgb(240,240,240)
border-radius 100%
position relative
.lolliclock-plate.animate
transform scale(0)
animation: open-clock t(50) t(50) forwards
.lolliclock-plate.animate-out
animation: open-clock t(50) forwards reverse EASE_OUT
@keyframes open-clock
0% {transform: scale(0);}
100% {transform: scale(1);}
.lolliclock-canvas
.lolliclock-dial
position absolute
.lolliclock-dial-minutes
visibility hidden
.lolliclock-bearing
fill black
stroke-width 1
.lolliclock-canvas line
stroke primary100
stroke-width 1
stroke-linecap round
.lolliclock-canvas-fg
stroke none
fill primary700
.lolliclock-canvas-bg
fill rgba(primary500, .25)
.lolliclock-tick
border-radius 100%
color #666
line-height 24px
text-align center
width 24px
height 24px
font-size .55em
font-weight 600
position absolute
cursor pointer
.lolliclock-tick.active
.lolliclock-tick:hover
background primary100
//footer
.lolliclock-ampm-block
display flex
justify-content space-around
.lolliclock-ampm-btn
position relative
height 35px
width 35px
border-radius 100%
font-size 10px
font-weight 600
cursor pointer
.lolliclock-ampm-btn.animate
opacity 0
animation: open-btn t(38) t(62) forwards EASE_OUT
.lolliclock-ampm-btn.animate-out
animation: open-btn t(50) reverse forwards EASE_OUT
@keyframes open-btn
0% {transform: translate3d(0,-40px,0); opacity: 0;}
100% {transform: translate3d(0,0,0); opacity: 1;}
.lolliclock-button.animate
opacity 0
animation: open-btn t(25) t(75) forwards EASE_OUT
.lolliclock-button.animate-out
animation: open-btn t(50) reverse forwards EASE_OUT
.lolliclock-btn-background
position absolute
height 35px
width 35px
opacity 0
transform scale(0)
.lolliclock-btn-text
position absolute
width 100%
text-align center
line-height 35px
vertical-align middle
color darkTextColor
.lolliclock-active-button-background
background primary500
border-radius 100%
transition transform 175ms
transform scale(1)
opacity 1
.lolliclock-active-button-text
color #FFFFFF
.lolliclock-ampm-btn:focus
outline 0
.lolliclock-clickable
cursor pointer
// must be above -moving
.lolliclock-moving
cursor move
cursor -webkit-grabbing
cursor -moz-grabbing
.lolliclock-export
display hidden
//Optional close buttons
.lolliclock-buttons
font-size 11px
display flex
justify-content flex-end
margin-top 20px
margin-bottom 8px
margin-right 8px
position absolute
width 196px
top 324px
.lolliclock-button
font-weight 500
color primary500
cursor pointer
padding 8px
min-width 32px
margin 0 4px
background transparent
text-align center
text-transform uppercase
border-radius 2px