-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
60 lines (54 loc) · 1.38 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
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
background: #2b2b2b;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
min-height: 100vh;
transition: 0.5s;
}
body.active{
background: #f8f8ff;
}
#toggle{
position: relative;
display: block;
width: 320px;
height: 160px;
border-radius: 160px;
background: #222;
transition: 0.5s;
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 > .indicator{
position: absolute;
top: 0;
left: 0;
width: 160px;
height: 160px;
border-radius: 50%;
background: linear-gradient(to bottom, #444, #222);
cursor: pointer;
transform: scale(0.9);
transition: 0.5s;
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);
}
#toggle.active{
background: #f8f8ff;
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 8px rgba(0, 0, 0, 0.05);
}
#toggle.active > .indicator{
left: 160px;
transition: 0.5s;
background: linear-gradient(to bottom, #e5e4e2, #fff);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), inset 0 4px 4px rgba(255, 255, 255, 1),
inset 0 -4px 4px rgba(255, 255, 255, 1);
}