-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathindex.html
More file actions
379 lines (334 loc) · 11.3 KB
/
Copy pathindex.html
File metadata and controls
379 lines (334 loc) · 11.3 KB
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Zync</title>
<script>
(function () {
const themePalette = {
dark: { bg: '#09090b', panel: '#18181b', text: '#e4e4e7', accent: '#797bce' },
light: { bg: '#f8fafc', panel: '#ffffff', text: '#111827', accent: '#6366f1' },
dracula: { bg: '#282a36', panel: '#2f3140', text: '#f8f8f2', accent: '#bd93f9' },
monokai: { bg: '#272822', panel: '#34352d', text: '#f8f8f2', accent: '#a6e22e' },
midnight: { bg: '#0b1020', panel: '#111827', text: '#e5e7eb', accent: '#60a5fa' },
warm: { bg: '#1f1a17', panel: '#2a221d', text: '#f5e7d9', accent: '#f59e0b' },
'light-warm': { bg: '#f8f1e8', panel: '#fff8ef', text: '#3c2f2a', accent: '#d97706' }
};
function normalizeTheme(themeName) {
const t = (themeName || '').toLowerCase();
if (t in themePalette) return t;
if (t.includes('light') && t.includes('warm')) return 'light-warm';
if (t.includes('dracula')) return 'dracula';
if (t.includes('monokai')) return 'monokai';
if (t.includes('midnight')) return 'midnight';
if (t.includes('warm')) return 'warm';
if (t.includes('light')) return 'light';
return 'dark';
}
function hexToRgba(hex, alpha) {
if (!hex || !/^#([0-9a-f]{6}|[0-9a-f]{3})$/i.test(hex)) return null;
let h = hex.slice(1);
if (h.length === 3) h = h.split('').map(function (c) { return c + c; }).join('');
const n = parseInt(h, 16);
const r = (n >> 16) & 255;
const g = (n >> 8) & 255;
const b = n & 255;
return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + alpha + ')';
}
function safeGet(key) {
try {
return localStorage.getItem(key);
} catch (_err) {
return null;
}
}
function parseSavedThemeColors(raw) {
if (!raw) return null;
try {
const parsed = JSON.parse(raw);
if (!parsed || typeof parsed !== 'object') return null;
const isValidColor = (c) => typeof c === 'string' && c.trim() !== '' && !c.includes(';') && !c.includes('}');
const bg = isValidColor(parsed.bg) ? parsed.bg.trim() : '';
const panel = isValidColor(parsed.panel) ? parsed.panel.trim() : '';
const text = isValidColor(parsed.text) ? parsed.text.trim() : '';
const accent = isValidColor(parsed.accent) ? parsed.accent.trim() : '';
const accentSoft = isValidColor(parsed.accentSoft) ? parsed.accentSoft.trim() : '';
if (!bg || !panel || !text || !accent) return null;
return { bg, panel, text, accent, accentSoft };
} catch (_err) {
return null;
}
}
const themePreference = safeGet('zync-theme') || 'dark';
const savedAccent = safeGet('zync-accent-color');
const savedThemeColors = parseSavedThemeColors(safeGet('zync-theme-colors'));
const themePrefLower = (themePreference || '').toLowerCase();
const resolvedTheme =
themePrefLower === 'system'
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
: normalizeTheme(themePreference);
const palette = themePalette[resolvedTheme] || themePalette.dark;
const fallbackAccent = savedAccent && /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(savedAccent) ? savedAccent : palette.accent;
const bootColors = savedThemeColors || {
bg: palette.bg,
panel: palette.panel,
text: palette.text,
accent: fallbackAccent,
accentSoft: hexToRgba(fallbackAccent, 0.14) || ('color-mix(in srgb, ' + fallbackAccent + ' 14%, transparent)')
};
const rootStyle = document.documentElement.style;
rootStyle.setProperty('--boot-bg', bootColors.bg);
rootStyle.setProperty('--boot-panel', bootColors.panel);
rootStyle.setProperty('--boot-text', bootColors.text);
rootStyle.setProperty('--boot-accent', bootColors.accent);
rootStyle.setProperty(
'--boot-accent-soft',
bootColors.accentSoft || ('color-mix(in srgb, ' + bootColors.accent + ' 14%, transparent)')
);
rootStyle.backgroundColor = bootColors.bg;
window.__zyncHideBootSplash = function () {
const splash = document.getElementById('boot-splash');
if (!splash || splash.classList.contains('boot-splash-hide')) return;
splash.classList.add('boot-splash-hide');
// Match exit transition (+ buffer)
window.setTimeout(function () {
splash.remove();
}, 220);
};
})();
</script>
<style>
:root {
--boot-bg: #09090b;
--boot-panel: #18181b;
--boot-text: #e4e4e7;
--boot-accent: #797bce;
--boot-accent-soft: rgba(121, 123, 206, 0.14);
}
html,
body,
#root {
width: 100%;
height: 100%;
margin: 0;
}
body {
overflow: hidden;
background: var(--boot-bg);
}
/*
Splash (finished): themed plated mark + hairline ring (NOT bare monochrome).
Bare/flat logo is for in-app chrome (title bar) only — keep boot markup self-contained.
*/
#boot-splash {
position: fixed;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
background: var(--boot-bg);
opacity: 1;
transition: opacity 180ms ease-out;
z-index: 2147483647;
pointer-events: none;
overflow: hidden;
}
/* Soft vignette — depth without texture noise */
#boot-splash::before {
content: '';
position: absolute;
inset: 0;
background:
radial-gradient(
ellipse 70% 55% at 50% 46%,
color-mix(in srgb, var(--boot-panel) 55%, transparent) 0%,
transparent 68%
),
radial-gradient(
ellipse 100% 100% at 50% 50%,
transparent 42%,
color-mix(in srgb, var(--boot-bg) 88%, #000) 100%
);
pointer-events: none;
}
#boot-splash.boot-splash-hide {
opacity: 0;
}
#boot-splash.boot-splash-hide .boot-splash {
transform: scale(0.97);
opacity: 0;
}
.boot-splash {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 18px;
transform: scale(1);
opacity: 1;
transition: transform 180ms ease-out, opacity 180ms ease-out;
will-change: transform, opacity;
}
.boot-splash-mark-wrap {
position: relative;
width: 120px;
height: 120px;
display: grid;
place-items: center;
}
/*
No separate glow blob behind the mark — that made a transparent plate
look like "flat glyph + ring + glow". Solid plate is the surface.
*/
.boot-splash-glow {
display: none;
}
.boot-splash-tile {
position: relative;
z-index: 1;
width: 120px;
height: 120px;
border-radius: 26.5%;
box-shadow: 0 12px 32px color-mix(in srgb, #000 32%, transparent);
}
.boot-splash-icon {
position: relative;
z-index: 1;
width: 120px;
height: 120px;
display: block;
/* Enter once — loading is the ring dash, not a whole-mark pulse */
animation: bootMarkIn 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Quiet full ring track */
.boot-splash-ring-track {
stroke: var(--boot-accent);
stroke-width: 18;
opacity: 0.22;
}
/*
Loading animation: accent arc travels the FIXED logo ring path.
Shape never rotates (no floating square).
*/
.boot-splash-ring-spin {
stroke: var(--boot-accent);
stroke-width: 18;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
stroke-dasharray: 520 1380;
stroke-dashoffset: 0;
animation: bootRingDash 1.05s linear infinite;
}
.boot-splash-meta {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
animation: bootMetaIn 320ms cubic-bezier(0.22, 1, 0.36, 1) 90ms both;
}
.boot-splash-title {
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Ubuntu, Cantarell, Arial, sans-serif;
font-size: 20px;
font-weight: 700;
letter-spacing: -0.025em;
text-transform: none;
color: color-mix(in srgb, var(--boot-text) 92%, transparent);
line-height: 1.1;
font-feature-settings: 'kern' 1, 'liga' 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@keyframes bootMarkIn {
from {
opacity: 0;
transform: scale(0.94);
}
to {
opacity: 1;
transform: scale(1);
}
}
@keyframes bootRingDash {
to {
stroke-dashoffset: -1900;
}
}
@keyframes bootMetaIn {
from {
opacity: 0;
transform: translateY(5px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (prefers-reduced-motion: reduce) {
#boot-splash {
transition: opacity 100ms ease;
}
#boot-splash.boot-splash-hide .boot-splash {
transform: none;
}
.boot-splash {
transition: opacity 100ms ease;
will-change: auto;
}
.boot-splash-icon,
.boot-splash-meta,
.boot-splash-ring-spin {
animation: none !important;
}
.boot-splash-icon,
.boot-splash-meta {
opacity: 1;
transform: none;
}
.boot-splash-ring-track {
opacity: 0;
}
.boot-splash-ring-spin {
stroke-dasharray: none;
stroke-dashoffset: 0;
opacity: 1;
}
}
</style>
</head>
<body>
<div id="boot-splash" aria-hidden="true">
<div class="boot-splash">
<div class="boot-splash-mark-wrap">
<div class="boot-splash-glow" aria-hidden="true"></div>
<div class="boot-splash-tile">
<!--
Solid themed plate (panel + accent tint) — NOT transparent soft fill.
Ring is hairline on the plate + loading dash; glyph on top. Theme tokens only.
-->
<svg class="boot-splash-icon" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg"
aria-hidden="true">
<rect width="512" height="512" rx="112"
fill="color-mix(in srgb, var(--boot-panel) 86%, var(--boot-accent) 14%)" />
<rect class="boot-splash-ring-track" x="9" y="9" width="494" height="494" rx="103" fill="none" />
<rect class="boot-splash-ring-spin" x="9" y="9" width="494" height="494" rx="103" fill="none" />
<g transform="translate(256 248) scale(0.92) translate(-256 -256)">
<path d="M128 170.667L213.333 256L128 341.333" stroke="var(--boot-accent)" stroke-width="64"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M256 341.333H384" stroke="var(--boot-text)" stroke-width="64" stroke-linecap="round" />
</g>
</svg>
</div>
</div>
<div class="boot-splash-meta">
<div class="boot-splash-title">Zync</div>
</div>
</div>
</div>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>