-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_theme-switcher.scss
105 lines (89 loc) · 2.75 KB
/
_theme-switcher.scss
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
101
102
103
104
105
// sass/components/_theme-switcher.scss
@import '../utils/_mixins.scss';
@import '../base/_variables.scss';
@import '../utils/_animations.scss';
.theme__wrapper {
padding: 10px 20px;
backdrop-filter: blur(30px);
border: .2rem solid var(--tertiary-color);
display: flex;
align-items: center;
justify-content: center;
background-color: transparent;
height: 80px;
@include border-radius(25px);
@include box-shadow(0px 0px 30px 0 rgba(227, 228, 237, 0.37));
}
.theme__container {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 50px;
padding: 2px 2px;
background-color: var(--color-toggle-light);
animation: showtime 1s ease-out;
border: 1px solid rgba(255, 255, 255, 0.18);
cursor: pointer;
@include border-radius(35px);
&.IsDark {
background-color: var(--color-toggle-dark);
}
input {
display: none;
}
div {
width: 20px;
height: 20px;
position: relative;
transform: scale(1) rotate(-2deg);
transition: box-shadow 0.5s ease, transform 0.4s ease 0.1s;
@include border-radius(50%);
@include box-shadow(inset 8px -8px 0 0 var(--color-toggle-dark));
&::before {
content: "";
width: inherit;
height: inherit;
border-radius: inherit;
position: absolute;
left: 0;
top: 0;
transition: background 0.3s ease;
}
&::after {
width: 4px;
height: 4px;
margin: -2px 0 0 -2px;
position: absolute;
top: 50%;
left: 50%;
transform: scale(0);
transition: all 0.3s ease;
content: "";
@include border-radius(50%);
@include box-shadow(
0 -13px 0 var(--color-toggle-light),
0 13px 0 var(--color-toggle-light),
13px 0 0 var(--color-toggle-light),
-13px 0 0 var(--color-toggle-light),
9px 9px 0 var(--color-toggle-light),
-9px 9px 0 var(--color-toggle-light),
9px -9px 0 var(--color-toggle-light),
-9px -9px 0 var(--color-toggle-light)
);
}
}
input:checked + div {
transform: scale(0.5) rotate(0deg);
transition: transform 0.3s ease 0.1s, box-shadow 0.2s ease;
@include box-shadow(inset 32px -32px 0 0 var(--color-toggle-light));
&::before {
background: var(--color-toggle-light);
transition: background 0.3s ease 0.1s;
}
&::after {
transform: scale(1.5);
transition: transform 0.5s ease 0.15s;
}
}
}