Spaces:
Runtime error
Runtime error
Khunndev Sisyphus commited on
Commit ·
eef382a
1
Parent(s): 593439e
Make the counting-to-results moment theatrical with a mono count-up and precision timer.
Browse filesUltraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
frontend/src/components/StepCounting.tsx
CHANGED
|
@@ -24,7 +24,7 @@ export function StepCounting({ lang, status, imageSrc }: Props) {
|
|
| 24 |
}, [])
|
| 25 |
|
| 26 |
return (
|
| 27 |
-
<div className="relative flex flex-1 flex-col items-center justify-center overflow-hidden bg-[var(--bg)]">
|
| 28 |
{imageSrc && (
|
| 29 |
<img
|
| 30 |
src={imageSrc}
|
|
@@ -41,7 +41,7 @@ export function StepCounting({ lang, status, imageSrc }: Props) {
|
|
| 41 |
}}
|
| 42 |
/>
|
| 43 |
|
| 44 |
-
<div className="relative z-10 flex flex-col items-center gap-
|
| 45 |
<img
|
| 46 |
src={ASSETS.loading}
|
| 47 |
alt=""
|
|
@@ -49,28 +49,54 @@ export function StepCounting({ lang, status, imageSrc }: Props) {
|
|
| 49 |
style={{ animation: 'breathe 2s ease-in-out infinite' }}
|
| 50 |
/>
|
| 51 |
|
| 52 |
-
<div>
|
| 53 |
-
<h2
|
|
|
|
|
|
|
|
|
|
| 54 |
{t(lang, 'countingTitle')}{''.padEnd(dots, '.')}
|
| 55 |
</h2>
|
| 56 |
-
<p
|
|
|
|
|
|
|
|
|
|
| 57 |
{status || t(lang, 'pleaseWait')}
|
| 58 |
</p>
|
| 59 |
</div>
|
| 60 |
|
| 61 |
-
<div
|
|
|
|
|
|
|
|
|
|
| 62 |
<div
|
| 63 |
-
className="h-full rounded-full
|
| 64 |
-
style={{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
/>
|
| 66 |
</div>
|
| 67 |
|
| 68 |
<div
|
| 69 |
-
className="
|
| 70 |
-
|
| 71 |
>
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
</div>
|
| 75 |
</div>
|
| 76 |
</div>
|
|
|
|
| 24 |
}, [])
|
| 25 |
|
| 26 |
return (
|
| 27 |
+
<div className="relative flex flex-1 flex-col items-center justify-center overflow-hidden bg-[var(--bg)] grain">
|
| 28 |
{imageSrc && (
|
| 29 |
<img
|
| 30 |
src={imageSrc}
|
|
|
|
| 41 |
}}
|
| 42 |
/>
|
| 43 |
|
| 44 |
+
<div className="relative z-10 flex flex-col items-center gap-8 px-8 text-center">
|
| 45 |
<img
|
| 46 |
src={ASSETS.loading}
|
| 47 |
alt=""
|
|
|
|
| 49 |
style={{ animation: 'breathe 2s ease-in-out infinite' }}
|
| 50 |
/>
|
| 51 |
|
| 52 |
+
<div className="flex flex-col items-center gap-2">
|
| 53 |
+
<h2
|
| 54 |
+
className="rise-enter text-[var(--text)]"
|
| 55 |
+
style={{ font: 'var(--type-h2)', letterSpacing: 'var(--tracking-snug)', animationDelay: '0.08s' }}
|
| 56 |
+
>
|
| 57 |
{t(lang, 'countingTitle')}{''.padEnd(dots, '.')}
|
| 58 |
</h2>
|
| 59 |
+
<p
|
| 60 |
+
className="rise-enter min-h-6 text-[var(--text-dim)]"
|
| 61 |
+
style={{ font: 'var(--type-body)', animationDelay: '0.16s' }}
|
| 62 |
+
>
|
| 63 |
{status || t(lang, 'pleaseWait')}
|
| 64 |
</p>
|
| 65 |
</div>
|
| 66 |
|
| 67 |
+
<div
|
| 68 |
+
className="rise-enter h-1.5 w-52 overflow-hidden rounded-full border border-[var(--hairline)] bg-[var(--surface-sunken)]"
|
| 69 |
+
style={{ boxShadow: 'var(--shadow-inset)', animationDelay: '0.24s' }}
|
| 70 |
+
>
|
| 71 |
<div
|
| 72 |
+
className="h-full rounded-full"
|
| 73 |
+
style={{
|
| 74 |
+
width: '35%',
|
| 75 |
+
background:
|
| 76 |
+
'linear-gradient(90deg, var(--brand-muted), var(--brand) 60%, var(--brand-hover))',
|
| 77 |
+
boxShadow: '0 0 12px rgba(0,49,77,0.35)',
|
| 78 |
+
animation: 'track-slide 1.8s var(--ease-ios) infinite',
|
| 79 |
+
}}
|
| 80 |
/>
|
| 81 |
</div>
|
| 82 |
|
| 83 |
<div
|
| 84 |
+
className="rise-enter flex items-baseline gap-1 rounded-[var(--r-md)] border border-[var(--hairline)] bg-[var(--surface-sunken)] px-4 py-2"
|
| 85 |
+
style={{ boxShadow: 'var(--shadow-inset)', animationDelay: '0.32s' }}
|
| 86 |
>
|
| 87 |
+
<span
|
| 88 |
+
aria-live="polite"
|
| 89 |
+
className="tabular-nums text-[var(--brand)]"
|
| 90 |
+
style={{ font: '700 var(--text-2xl)/1 var(--font-mono)', letterSpacing: 'var(--tracking-tight)' }}
|
| 91 |
+
>
|
| 92 |
+
{(deci / 10).toFixed(1)}
|
| 93 |
+
</span>
|
| 94 |
+
<span
|
| 95 |
+
className="text-[var(--text-faint)]"
|
| 96 |
+
style={{ font: '600 var(--text-xs)/1 var(--font-mono)' }}
|
| 97 |
+
>
|
| 98 |
+
s
|
| 99 |
+
</span>
|
| 100 |
</div>
|
| 101 |
</div>
|
| 102 |
</div>
|
frontend/src/components/StepResults.tsx
CHANGED
|
@@ -89,14 +89,17 @@ export function StepResults({
|
|
| 89 |
|
| 90 |
{!animDone && (
|
| 91 |
<div className="pointer-events-none absolute left-1/2 top-3 z-10 -translate-x-1/2">
|
| 92 |
-
<div
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
>
|
| 97 |
0
|
| 98 |
</span>
|
| 99 |
-
<span
|
|
|
|
|
|
|
|
|
|
| 100 |
{t(lang, 'total')}
|
| 101 |
</span>
|
| 102 |
</div>
|
|
|
|
| 89 |
|
| 90 |
{!animDone && (
|
| 91 |
<div className="pointer-events-none absolute left-1/2 top-3 z-10 -translate-x-1/2">
|
| 92 |
+
<div
|
| 93 |
+
className="grain overlay-enter flex flex-col items-center rounded-[var(--r-lg)] border border-[var(--hairline)] bg-[var(--surface)]/95 px-7 py-3 backdrop-blur-md"
|
| 94 |
+
style={{ boxShadow: 'var(--shadow-lg)' }}
|
| 95 |
+
>
|
| 96 |
+
<span ref={countDisplayRef} className="ct-count">
|
| 97 |
0
|
| 98 |
</span>
|
| 99 |
+
<span
|
| 100 |
+
className="ct-section-label"
|
| 101 |
+
style={{ marginTop: '0.125rem', letterSpacing: 'var(--tracking-wider)' }}
|
| 102 |
+
>
|
| 103 |
{t(lang, 'total')}
|
| 104 |
</span>
|
| 105 |
</div>
|