Skip to content
Source
Sign inSign up
samwillis/one-million-boxes
Open History to see the last commit

AboutDialog.css

343 lines6.4 KB

1.about-dialog-backdrop {
2 position: fixed;
3 inset: 0;
4 background: rgba(19, 20, 21, 0.35);
5 z-index: 100;
6 animation: about-backdrop-fade-in 150ms ease-out;
7}
8​
9.about-dialog-popup {
10 position: fixed;
11 top: 50%;
12 left: 50%;
13 transform: translate(-50%, -50%);
14 background: var(--color-surface);
15 border: var(--hud-border-width) solid var(--hud-outline);
16 border-radius: 16px;
17 box-shadow:
18 var(--hud-shadow),
19 0 16px 40px rgb(19 20 21 / 16%);
20 padding: 0;
21 width: 90%;
22 max-width: 480px;
23 max-height: 90vh;
24 z-index: 101;
25 animation: about-popup-slide-in 200ms ease-out;
26 display: flex;
27 flex-direction: column;
28 overflow: hidden;
30​
31.about-dialog-title {
32 padding: 24px 24px 16px;
33 margin-bottom: 0;
34 text-align: center;
35 flex-shrink: 0; /* Don't shrink the title */
36 background: white;
37 border-bottom: 1px solid transparent;
38 box-shadow: 0 4px 12px rgba(0, 0, 0, 0);
39 transition:
40 border-color 200ms ease,
41 box-shadow 200ms ease;
43​
44.about-dialog-title.has-overflow {
45 border-bottom-color: rgba(0, 0, 0, 0.08);
46 box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
48​
49.about-dialog-logo {
50 height: 32px;
51 width: auto;
52 border-bottom: 3px solid var(--hud-edge);
54​
55.about-dialog-content {
56 padding: 0 24px;
57 overflow-y: auto;
58 flex: 1;
59 min-height: 0; /* Allow shrinking below content size */
61​
62.about-dialog-content p {
63 font-size: 0.9375rem;
64 line-height: 1.6;
65 color: var(--color-text);
66 margin-bottom: 12px;
68​
69.about-dialog-content p:last-of-type {
70 margin-bottom: 0;
72​
73.about-dialog-content a {
74 color: var(--color-link);
75 font-weight: 600;
76 text-underline-offset: 3px;
78​
79.about-dialog-section-title {
80 font-size: 0.875rem;
81 font-weight: 750;
82 color: var(--color-text);
83 margin: 16px 0 8px;
84 letter-spacing: -0.02em;
86​
87.about-dialog-rules {
88 margin: 0;
89 padding-left: 20px;
90 font-size: 0.875rem;
91 line-height: 1.6;
92 color: var(--color-text);
94​
95.about-dialog-rules li {
96 margin-bottom: 4px;
98​
99.about-dialog-rules li:last-child {
100 margin-bottom: 0;
102​
103.about-dialog-leaderboard {
104 display: grid;
105 grid-template-columns: repeat(2, 1fr);
106 gap: 8px;
107 margin: 8px 0 16px;
109​
110.about-leaderboard-item {
111 display: flex;
112 align-items: center;
113 gap: 4px;
114 padding: 8px;
115 min-width: 0;
116 background: color-mix(in srgb, var(--score-color, var(--color-border)) 9%, white);
117 border: var(--hud-border-width) solid
118 color-mix(in srgb, var(--score-color, var(--color-border)) 35%, var(--color-border));
119 border-radius: 7px;
120 box-shadow: 0 2px 0 var(--color-border);
121 font-size: 0.875rem;
123​
124.about-leaderboard-rank {
125 font-weight: 600;
126 color: var(--color-muted);
127 font-size: 0.75rem;
129​
130.about-leaderboard-dot {
131 width: 10px;
132 height: 10px;
133 border-radius: 3px;
134 border: 1px solid rgb(19 20 21 / 22%);
135 box-shadow: inset 0 1px 0 rgb(255 255 255 / 40%);
136 flex-shrink: 0;
138​
139.about-leaderboard-team {
140 flex: 1;
141 min-width: 0;
142 font-size: 0.8125rem;
143 font-weight: 650;
145​
146.about-leaderboard-score {
147 font-weight: 750;
148 font-variant-numeric: tabular-nums;
150​
151.about-leaderboard-item--loading .about-leaderboard-rank {
152 color: var(--color-muted);
154​
155.about-skeleton {
156 display: inline-block;
157 background: linear-gradient(
158 90deg,
159 rgba(0, 0, 0, 0.06) 0%,
160 rgba(0, 0, 0, 0.12) 50%,
161 rgba(0, 0, 0, 0.06) 100%
162 );
163 background-size: 200% 100%;
164 animation: about-skeleton-pulse 1.2s ease-in-out infinite;
165 border-radius: 999px;
167​
168.about-skeleton-text {
169 height: 13.5px;
170 margin: 4px 0;
171 width: 90px;
173​
174.about-skeleton-number {
175 height: 13.5px;
176 margin: 4px 0;
177 width: 48px;
179​
180.about-dialog-stats {
181 display: flex;
182 gap: 8px;
183 margin: 12px 0;
185​
186.about-stat {
187 flex: 1;
188 display: flex;
189 flex-direction: column;
190 align-items: center;
191 padding: 8px;
192 background: var(--color-bg);
193 border: var(--hud-border-width) solid var(--color-border-strong);
194 border-radius: 7px;
195 box-shadow: 0 2px 0 var(--color-border);
197​
198.about-stat-value {
199 font-size: 0.9375rem;
200 font-weight: 600;
201 font-variant-numeric: tabular-nums;
202 color: var(--color-text);
204​
205.about-stat .about-skeleton {
206 border-radius: 6px;
208​
209.about-stat-label {
210 font-size: 0.625rem;
211 color: var(--color-muted);
212 text-transform: uppercase;
213 letter-spacing: 0.3px;
214 margin-top: 1px;
216​
217.about-dialog-tech {
218 font-size: 0.8125rem !important;
219 color: var(--color-muted) !important;
220 text-align: center;
221 margin-top: 16px !important;
223​
224.about-dialog-tech a {
225 color: var(--color-link);
226 text-decoration: none;
227 font-weight: 500;
228 outline: none; /* Prevent focus ring on auto-focus */
230​
231.about-dialog-tech a:hover {
232 text-decoration: underline;
234​
235.about-dialog-tech a:focus-visible {
236 text-decoration: underline; /* Show underline instead of ring for keyboard users */
238​
239.about-dialog-button-container {
240 padding: 24px;
241 flex-shrink: 0;
242 background: white;
243 border-top: 1px solid transparent;
244 box-shadow: 0 -4px 12px rgba(0, 0, 0, 0);
245 transition:
246 border-color 200ms ease,
247 box-shadow 200ms ease;
249​
250.about-dialog-button-container.has-overflow {
251 border-top-color: rgba(0, 0, 0, 0.08);
252 box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
254​
255.about-dialog-close-button {
256 width: 100%;
257 padding: 12px;
258 font-size: 0.9375rem;
259 font-weight: 750;
260 border: var(--hud-border-width) solid var(--hud-outline);
261 border-radius: var(--hud-radius);
262 box-shadow: var(--hud-shadow);
263 transition:
264 filter var(--transition-fast),
265 transform var(--transition-fast),
266 box-shadow var(--transition-fast);
268​
269.about-dialog-close-button:hover {
270 filter: brightness(0.95);
272​
273.about-dialog-close-button:active {
274 transform: translateY(2px);
275 box-shadow: 0 1px 0 var(--hud-edge);
277​
278/* Animations */
279@keyframes about-backdrop-fade-in {
280 from {
281 opacity: 0;
282 }
283 to {
284 opacity: 1;
285 }
287​
288@keyframes about-popup-slide-in {
289 from {
290 opacity: 0;
291 transform: translate(-50%, -48%);
292 }
293 to {
294 opacity: 1;
295 transform: translate(-50%, -50%);
296 }
298​
299@keyframes about-skeleton-pulse {
300 0% {
301 background-position: 100% 0;
302 }
303 100% {
304 background-position: -100% 0;
305 }
307​
308/* Responsive text */
309.mobile-only {
310 display: none;
312​
313.desktop-only {
314 display: inline;
316​
317/* Mobile adjustments */
318@media (max-width: 640px) {
319 .about-dialog-popup {
320 width: 94%;
321 max-height: 85vh;
322 }
323​
324 .about-dialog-title {
325 padding: 20px 20px 14px;
326 }
327​
328 .about-dialog-content {
329 padding: 0 20px;
330 }
331​
332 .about-dialog-button-container {
333 padding: 20px;
334 }
335​
336 .mobile-only {
337 display: inline;
338 }
339​
340 .desktop-only {
341 display: none;
342 }