-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
61 lines (53 loc) · 970 Bytes
/
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
body {
display: flex;
justify-content: center;
margin: 0;
height: 100vh;
align-items: center;
background-color: pink;
transition: 0.4s;
}
.label {
width: 80px;
height: 40px;
background-color: palevioletred;
position: absolute;
border-radius: 20px;
cursor: pointer;
}
.input {
visibility: hidden;
}
.circle {
width: 34px;
height: 34px;
border-radius: 50%;
background-color: pink;
top: 3px;
position: absolute;
left: 3px;
animation: toggleOff 0.4s linear forwards;
}
.input:checked + .label {
background-color: purple;
}
@keyframes toggleOn {
0% {
transform: translateX(0px);
}
100% {
transform: translateX(40px);
}
}
@keyframes toggleOff {
0% {
transform: translateX(40px);
}
100% {
transform: translateX(0px);
}
}
.input:checked + .label .circle{
animation: toggleOn 0.4s linear forwards;
background-color: plum;
}