Spaces:
Paused
Paused
File size: 3,865 Bytes
9f48b33 | 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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | /* Theme Toggle Styles */
.theme-toggle {
position: fixed;
top: 20px;
right: 20px;
z-index: 1000;
background: none;
border: none;
cursor: pointer;
padding: 0;
outline: none;
}
.toggle-track {
width: 70px;
height: 36px;
border-radius: 18px;
position: relative;
overflow: hidden;
transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
box-shadow:
0 4px 20px rgba(0, 0, 0, 0.2),
inset 0 -2px 10px rgba(0, 0, 0, 0.1),
inset 0 2px 10px rgba(255, 255, 255, 0.2);
}
/* Light mode track (sky blue gradient) */
.theme-toggle.light .toggle-track {
background: linear-gradient(180deg, #87CEEB 0%, #4FC3F7 50%, #81D4FA 100%);
border: 2px solid rgba(255, 255, 255, 0.4);
}
/* Dark mode track (night sky gradient) */
.theme-toggle.dark .toggle-track {
background: linear-gradient(180deg, #1a237e 0%, #0a0e35 50%, #121858 100%);
border: 2px solid rgba(255, 193, 7, 0.3);
}
.toggle-thumb {
position: absolute;
width: 28px;
height: 28px;
border-radius: 50%;
top: 4px;
z-index: 10;
/* Thumb always on top */
transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
display: flex;
align-items: center;
justify-content: center;
box-shadow:
0 2px 10px rgba(0, 0, 0, 0.3),
0 0 20px rgba(255, 193, 7, 0.2);
}
/* Light mode thumb (sun) */
.theme-toggle.light .toggle-thumb {
left: 4px;
background: linear-gradient(135deg, #FFF9C4 0%, #FFD54F 50%, #FFC107 100%);
box-shadow:
0 0 20px rgba(255, 193, 7, 0.6),
0 0 40px rgba(255, 193, 7, 0.3),
inset 0 -2px 5px rgba(255, 152, 0, 0.3);
}
/* Dark mode thumb (moon) */
.theme-toggle.dark .toggle-thumb {
left: 38px;
background: linear-gradient(135deg, #E8EAF6 0%, #C5CAE9 50%, #9FA8DA 100%);
box-shadow:
0 0 15px rgba(197, 202, 233, 0.5),
0 0 30px rgba(159, 168, 218, 0.3);
}
.toggle-icon {
font-size: 14px;
transition: all 0.4s ease;
}
.theme-toggle.light .toggle-icon {
color: #FF8F00;
}
.theme-toggle.dark .toggle-icon {
color: #5C6BC0;
}
/* Stars animation for dark mode */
.toggle-stars {
position: absolute;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 5;
/* Stars behind thumb */
}
.star {
position: absolute;
color: #FFF9C4;
font-size: 8px;
opacity: 0;
animation: twinkle 1.5s infinite;
}
.theme-toggle.dark .star {
opacity: 1;
}
.star-1 {
top: 8px;
left: 10px;
/* Moved to left side */
animation-delay: 0s;
}
.star-2 {
top: 20px;
left: 18px;
/* Moved to left side */
animation-delay: 0.5s;
font-size: 6px;
}
.star-3 {
top: 12px;
left: 28px;
/* Moved to left side */
animation-delay: 1s;
font-size: 10px;
}
@keyframes twinkle {
0%,
100% {
opacity: 0.3;
transform: scale(1);
}
50% {
opacity: 1;
transform: scale(1.2);
}
}
/* Clouds animation for light mode */
.toggle-clouds {
position: absolute;
width: 100%;
height: 100%;
pointer-events: none;
}
.cloud {
position: absolute;
color: rgba(255, 255, 255, 0.8);
font-size: 12px;
opacity: 0;
transition: opacity 0.3s ease;
}
.theme-toggle.light .cloud {
opacity: 1;
animation: float-cloud 3s infinite ease-in-out;
}
.cloud-1 {
top: 4px;
right: 8px;
animation-delay: 0s;
}
.cloud-2 {
top: 16px;
right: 16px;
font-size: 10px;
animation-delay: 1.5s;
}
@keyframes float-cloud {
0%,
100% {
transform: translateX(0);
}
50% {
transform: translateX(3px);
}
}
/* Hover effect */
.theme-toggle:hover .toggle-track {
transform: scale(1.05);
box-shadow:
0 6px 25px rgba(0, 0, 0, 0.3),
inset 0 -2px 10px rgba(0, 0, 0, 0.1),
inset 0 2px 10px rgba(255, 255, 255, 0.2);
}
.theme-toggle:hover .toggle-thumb {
transform: scale(1.1);
}
/* Focus state for accessibility */
.theme-toggle:focus-visible .toggle-track {
outline: 3px solid var(--turkcell-yellow);
outline-offset: 3px;
} |