-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.css
154 lines (154 loc) · 3.75 KB
/
style.css
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
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap");
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
:root{
--hue-clr: 240;
--text-clr: hsl(var(--hue-clr), 12%, 75%);
--main-bg:hsl(var(--hue-clr), 10%, 16%);
--blue-clr: hsl(var(--hue-clr), 53%, 49%);
--num-clr: hsl(var(--hue-clr), 12%, 65%);
--bold-clr:hsl(var(--hue-clr), 12%, 95%);
--clock-box-shadow:6px 6px 16px hsl(var(--hue-clr), 8%, 12%),
-6px -6px 16px hsl(var(--hue-clr), 8%, 20%),
inset -6px -6px 16px hsl(var(--hue-clr), 8%, 20%),
inset 6px 6px 12px hsl(var(--hue-clr), 8%, 12%);
--toggle-box-shadow:inset -1px -1px 1px hsla(var(--hue-clr), 8%, 20%, 1),
inset 1px 1px 1px hsla(var(--hue-clr), 8%, 12%, 1);
}
:root .light-mode{
--text-clr: hsl(var(--hue-clr),12%,35%);
--main-bg: hsl(var(--hue-clr),24%,94%);
--blue-clr: hsl(var(--hue-clr), 53%, 49%);
--num-clr: hsl(var(--hue-clr),12%,45%);
--bold-clr: hsl(var(--hue-clr),53%,15%);
--clock-box-shadow:-6px -6px 16px white,
6px 6px 16px hsla(var(--hue-clr), 30%, 86%, 1),
inset 6px 6px 16px hsla(var(--hue-clr), 30%, 86%, 1),
inset -6px -6px 16px white;
--toggle-box-shadow:inset -1px -1px 1px hsla(var(--hue-clr), 0%, 100%, 1),
inset 1px 1px 1px hsla(var(--hue-clr), 30%, 86%, 1);
}
body{
min-height: 100vh;
color: var(--text-clr);
background: var(--main-bg);
font-size: 18px;
font-family: 'Poppins', sans-serif;
display: flex;
align-items: center;
justify-content: center;
transition: all .2s linear;
}
main{
display: flex;
flex-direction: column;
align-items: center;
}
main .analog{
width: 220px;
height: 220px;
box-shadow: var(--clock-box-shadow);
border-radius: 50%;
margin-bottom: 3rem;
cursor: pointer;
position: relative;
}
.analog::after{
position: absolute;
content: '';
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 8px;
height: 8px;
background: var(--blue-clr);
border: 2px solid var(--main-bg);
border-radius: 50%;
z-index: 2;
}
.analog .toggle{
position: absolute;
right: -1rem;
top: -1rem;
width: 1.3rem;
height: 1.3rem;
display: flex;
align-items: center;
justify-content: center;
color: var(--blue-clr);
font-size: .8rem;
box-shadow: var(--toggle-box-shadow);
border-radius: 50%;
overflow: hidden;
}
.fa-moon{
display: none;
}
.toggle.active .fa-moon{
display: block;
}
.toggle.active .fa-sun{
display: none;
}
.analog .number{
--rotation: 0;
color: var(--num-clr);
font-size: .8rem;
position: absolute;
width: 100%;
height: 100%;
text-align: center;
transform: rotate(var(--rotation));
padding: 8px;
}
.number.big{
font-size: 1.3rem;
}
.analog .number1{--rotation: 30deg;}
.analog .number2{--rotation: 60deg;}
.analog .number3{--rotation: 90deg;}
.analog .number4{--rotation: 120deg;}
.analog .number5{--rotation: 150deg;}
.analog .number6{--rotation: 180deg;}
.analog .number7{--rotation: 210deg;}
.analog .number8{--rotation: 240deg;}
.analog .number9{--rotation: 270deg;}
.analog .number10{--rotation: 300deg;}
.analog .number11{--rotation: 330deg;}
.analog .hand{
position: absolute;
bottom: 50%;
left: 50%;
border-radius: 1rem;
z-index: 1;
transform-origin: bottom;
}
.hour-hand{
width: 4px;
height: 20%;
background: var(--bold-clr);
}
.min-hand{
width: 3px;
height: 30%;
background: var(--bold-clr);
}
.sec-hand{
width: 2px;
height: 34%;
background: var(--blue-clr);
}
.digital{
color: var(--bold-clr);
font-size: 2.5rem;
position: relative;
}
.digital .ampm{
position: absolute;
top: 0;
right: -2rem;
font-size: .9rem;
}