Repository navigation
Expand file tree
/
Copy pathClock.css
More file actions
79 lines (67 loc) · 1.34 KB
/
Copy pathClock.css
File metadata and controls
79 lines (67 loc) · 1.34 KB
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
.clock-container {
display: flex;
gap: 0.3rem;
align-items: center;
}
.colon {
font-size: 4rem;
padding: 0 0.2rem;
}
.flip-unit {
perspective: 1200px;
display: inline-block;
}
.card {
position: relative;
width: 70px;
height: 90px;
background: #222;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.4);
font-size: 3rem;
color: white;
overflow: hidden;
text-align: center;
}
.top, .bottom, .flip-top, .flip-bottom {
position: absolute;
width: 100%;
height: 50%;
line-height: 45px;
left: 0;
background: linear-gradient(to bottom, #2c2c2c, #1b1b1b);
backface-visibility: hidden;
}
.top {
top: 0;
border-bottom: 1px solid #000;
}
.bottom {
bottom: 0;
border-top: 1px solid #333;
transform: rotateX(0deg);
}
.flip-top {
top: 0;
transform-origin: bottom;
transform: rotateX(0deg);
}
.flip-bottom {
bottom: 0;
transform-origin: top;
transform: rotateX(180deg);
}
.card.flip .flip-top {
animation: flipTop 0.3s ease-in forwards;
}
.card.flip .flip-bottom {
animation: flipBottom 0.3s ease-out 0.3s forwards;
}
@keyframes flipTop {
0% { transform: rotateX(0deg); }
100% { transform: rotateX(-90deg); }
}
@keyframes flipBottom {
0% { transform: rotateX(90deg); }
100% { transform: rotateX(0deg); }
}