-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.css
54 lines (47 loc) · 835 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
* {
box-sizing: border-box;
}
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
background-color: #fff;
}
.container {
display: flex;
align-items: center;
margin: 10px 0;
width: 200px;
}
.toggle {
visibility: hidden;
}
.label {
position: relative;
display: inline-block;
width: 80px;
height: 40px;
cursor: pointer;
background-color: gray;
border-radius: 30px;
transition: background-color 0.3s linear;
}
.ball {
position: absolute;
top: 3px;
left: 3px;
background-color: #fff;
width: 35px;
height: 35px;
border-radius: 50%;
transition: transform 0.3s linear;
}
.toggle:checked + .label {
background-color: rgb(132, 45, 218);
}
.toggle:checked + .label .ball {
transform: translateX(38px);
}