-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle2.css
60 lines (53 loc) · 1.04 KB
/
style2.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
.darkmode {
margin: 0;
display: flex;
justify-content: left;
height: 100vh;
padding: 10px;
transition: .4s;
position: fixed;
}
.input {
visibility: hidden;
}
.label {
position: absolute;
width: 80px;
height: 40px;
background-color: lightgray;
border-radius: 20px;
cursor: pointer;
}
.circle {
width: 34px;
background-color: white;
height: 34px;
border-radius: 50%;
top: 3px;
position: absolute;
left: 3px;
animation: toggleOff 0.4s linear forwards;
}
.input:checked + .label {
background-color: white;
}
.input:checked + .label .circle {
animation: toggleOn 0.4s linear forwards;
background-color: black;
}
@keyframes toggleOn {
0% {
transform: translateX(0);
}
100% {
transform: translateX(40px);
}
}
@keyframes toggleOff {
0% {
transform: translateX(40px);
}
100% {
transform: translateX(0);
}
}