-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggle.css
More file actions
62 lines (56 loc) · 1.49 KB
/
toggle.css
File metadata and controls
62 lines (56 loc) · 1.49 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
*{
margin:0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #252525;
transition: 0.5s
}
body.active{
background: #f8f8f8;
}
#toggle{
position: relative;
display: block;
width: 320px;
height: 160px;
border-radius: 160px;
background: #222;
transition: 0.5s;
cursor: pointer;
box-shadow: inset 0 8px 60px rgba(0, 0, 0, 0.1),
inset 0 8px 8px rgba(0, 0, 0, 0.1),
inset 0 -4px 4px rgba(0, 0, 0, 0.1);
}
#toggle.active{
background: #fff;
box-shadow: inset 0 2px 60px rgba(0, 0, 0, 0.1),
inset 0 2px 8px rgba(0, 0, 0, 0.1),
inset 0 -4px 4px rgba(0, 0, 0, 0.5);
}
#toggle .indicator{
position: absolute;
top: 0;
left: 0;
width: 160px;
height: 160px;
background: linear-gradient(to bottom, #444, #222);
border-radius: 50%;
transform: scale(0.9);
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5),
inset 0 4px 4px rgba(255, 255, 255, 0.2),
inset 0 -4px 4px rgba(255, 255, 255, 0.2);
transition: 0.5s;
}
#toggle.active .indicator{
left: 160px;
background: linear-gradient(to bottom, #aeaeae, #f9f9f9);
box-shadow: inset 0 20px 60px rgba(0, 0, 0, 0.1),
inset 0 2px 8px rgba(0, 0, 0, 0.1),
inset 0 -4px 4px rgba(0, 0, 0, 0.1);
}