|
66 | 66 | font-size: 100%;
|
67 | 67 | position: absolute;
|
68 | 68 | top: 2%;
|
69 |
| - left: 2%; |
70 | 69 | width: 100px;
|
71 | 70 | height: 100px;
|
72 | 71 | background-color: white;
|
73 | 72 | border-radius: 50%;
|
74 |
| - z-index: 9999; |
75 |
| -} |
76 |
| - |
77 |
| -.sidebar-toggle-button { |
78 |
| - position: fixed; |
79 |
| - top: 2%; |
80 | 73 | left: 88%;
|
81 |
| - cursor: pointer; |
82 | 74 | z-index: 9999;
|
83 |
| - user-select: none; |
84 |
| - transition: 200ms ease all; |
85 | 75 | font-size: 72px;
|
86 | 76 | }
|
87 | 77 |
|
88 |
| -#sidebar-toggle:checked + .sidebar-toggle-button::before { |
89 |
| - content: "✕"; |
90 |
| - } |
| 78 | +#sidebar-toggle:checked ~ .sidebar-toggle-button::before { |
| 79 | + animation-name: to-x; |
| 80 | + animation-duration: 500ms; |
| 81 | + animation-fill-mode: forwards; |
| 82 | +} |
| 83 | + |
| 84 | +#sidebar-toggle:not(checked) ~ .sidebar-toggle-button::before { |
| 85 | + animation-name: to-ham; |
| 86 | + animation-duration: 500ms; |
| 87 | + animation-fill-mode: forwards; |
| 88 | +} |
| 89 | + |
| 90 | +@keyframes to-ham { |
| 91 | + from { |
| 92 | + content: "✕"; |
| 93 | + } |
| 94 | + to { |
| 95 | + transform:rotateZ(1turn); |
| 96 | + content: "☰"; |
| 97 | + } |
| 98 | +} |
| 99 | + |
| 100 | +@keyframes to-x { |
| 101 | + from { |
| 102 | + content: "☰"; |
| 103 | + } |
| 104 | + to { |
| 105 | + transform:rotateZ(-1turn); |
| 106 | + content: "✕"; |
| 107 | + } |
| 108 | +} |
91 | 109 |
|
92 | 110 | #sidebar-toggle:checked ~ .sidebar {
|
93 | 111 | right: 0px;
|
|
109 | 127 | height: 100px;
|
110 | 128 | background-color: white;
|
111 | 129 | border-radius: 50%;
|
112 |
| - transition: transform 200ms; |
113 | 130 | z-index: 9999;
|
114 | 131 | }
|
115 | 132 |
|
|
121 | 138 | background-color: #323232;
|
122 | 139 | }
|
123 | 140 |
|
124 |
| -#theme-toggle:checked + .theme-toggle-button::before { |
125 |
| - content: "🌑"; |
126 |
| - } |
| 141 | +@keyframes to-moon { |
| 142 | + from { |
| 143 | + content: "☀️"; |
| 144 | + } |
| 145 | + to { |
| 146 | + transform:rotateZ(1turn); |
| 147 | + content: "🌑"; |
| 148 | + } |
| 149 | +} |
| 150 | + |
| 151 | +@keyframes to-sun { |
| 152 | + from { |
| 153 | + content: "🌑"; |
| 154 | + } |
| 155 | + to { |
| 156 | + transform:rotateZ(-1turn); |
| 157 | + content: "☀️"; |
| 158 | + } |
| 159 | +} |
| 160 | + |
| 161 | +#theme-toggle:checked ~ .theme-toggle-button::before { |
| 162 | + animation-name: to-moon; |
| 163 | + animation-duration: 500ms; |
| 164 | + animation-fill-mode: forwards; |
| 165 | +} |
| 166 | + |
| 167 | +#theme-toggle:not(checked) ~ .theme-toggle-button::before { |
| 168 | + animation-name: to-sun; |
| 169 | + animation-duration: 500ms; |
| 170 | + animation-fill-mode: forwards; |
| 171 | +} |
127 | 172 |
|
128 | 173 | #theme-toggle:checked ~ .main {
|
129 | 174 | background: #051428;
|
|
153 | 198 | height: 50px;
|
154 | 199 | background-color: white;
|
155 | 200 | border-radius: 50%;
|
156 |
| - transition: transform 200ms; |
157 | 201 | z-index: 9999;
|
158 | 202 | }
|
159 | 203 |
|
|
0 commit comments