-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles3.css
100 lines (82 loc) · 1.45 KB
/
styles3.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
body {
margin: 0;
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
label {
width: 500px;
height: 200px;
position: relative;
display: block;
background: #ebebeb;
border-radius: 200px;
box-shadow: inset 0px 5px 15px rgba(0, 0, 0, 0.4),
inset 0px -5px 15px rgba(255, 255, 255, 0.4);
cursor: pointer;
transition: 0.3s;
}
label:after {
content: "";
width: 180px;
height: 180px;
position: absolute;
top: 40px;
right: 20px;
background: linear-gradient(180deg, #ffcc89, #d8860b);
border-radius: 180px;
box-shadow: 0px 5px 10px rgba(0,0,0,0.2);
transition: 0.3s;
}
input {
width: 0;
height: 0;
visibility: hidden;
}
input:checked + label {
background: #242424;
}
input:checked + label:after {
left: 490px;
transform: translateX(-100);
background: linear-gradient(180deg, #777777, #3a3a3a);
}
label:active:after {
width: 260px;
}
.background {
width: 100vw;
height: 100vh;
background: #fff;
z-index: -1;
position: absolute;
transition: 0.3s;
}
input:checked + label + .background {
background: #242424;
}
label svg {
position: absolute;
width: 120px;
top: 40px;
z-index: 100;
}
label svg.sun {
left: 40px;
fill: #fff;
transition: 0.3s;
}
label svg.moon {
left: 340px;
fill: #7e7e7e;
transition: 0.3s;
}
input:checked + label svg.sun {
fill: #7e7e7e
}
input:checked + label svg.mooon {
fill: #ffffff
}