Spaces:
Runtime error
Runtime error
Khunndev Sisyphus commited on
Commit ·
593439e
1
Parent(s): 58e400a
Elevate the capture screen with a staggered entrance and premium depth.
Browse filesUltraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
frontend/src/components/StepCapture.tsx
CHANGED
|
@@ -19,7 +19,7 @@ export function StepCapture({ lang, engine, modelError, onRetryModel, onCamera,
|
|
| 19 |
const ready = engine === 'local' || engine === 'server'
|
| 20 |
|
| 21 |
return (
|
| 22 |
-
<div className="relative flex flex-1 flex-col overflow-hidden">
|
| 23 |
<img
|
| 24 |
src={ASSETS.bg}
|
| 25 |
alt=""
|
|
@@ -32,13 +32,22 @@ export function StepCapture({ lang, engine, modelError, onRetryModel, onCamera,
|
|
| 32 |
/>
|
| 33 |
|
| 34 |
<div className="relative z-10 flex flex-1 flex-col items-center justify-center px-8">
|
| 35 |
-
<div className="mb-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
<img
|
| 38 |
src={ASSETS.logo}
|
| 39 |
alt=""
|
| 40 |
-
className="h-[72px] w-auto max-w-[220px]
|
| 41 |
-
style={{
|
|
|
|
|
|
|
|
|
|
| 42 |
/>
|
| 43 |
<span
|
| 44 |
className={`absolute -right-2 -top-1 h-5 w-5 rounded-full border-[3px] border-[#00314d] transition-all duration-700 ${
|
|
@@ -48,28 +57,51 @@ export function StepCapture({ lang, engine, modelError, onRetryModel, onCamera,
|
|
| 48 |
? 'bg-[var(--success)]'
|
| 49 |
: 'animate-pulse bg-[var(--warning)]'
|
| 50 |
}`}
|
|
|
|
| 51 |
/>
|
| 52 |
</div>
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
{t(lang, 'title')}
|
| 57 |
</h1>
|
| 58 |
-
<p
|
|
|
|
|
|
|
|
|
|
| 59 |
{t(lang, 'captureSubtitle')}
|
| 60 |
</p>
|
| 61 |
</div>
|
| 62 |
|
|
|
|
| 63 |
{hasError ? (
|
| 64 |
-
<button
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
<RotateCcw size={12} />
|
| 66 |
{t(lang, 'retry')}
|
| 67 |
</button>
|
| 68 |
) : (
|
| 69 |
<div
|
| 70 |
-
className=
|
| 71 |
-
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
>
|
| 74 |
<span
|
| 75 |
className={`h-1.5 w-1.5 rounded-full ${
|
|
@@ -82,7 +114,14 @@ export function StepCapture({ lang, engine, modelError, onRetryModel, onCamera,
|
|
| 82 |
</div>
|
| 83 |
|
| 84 |
{hasError && (
|
| 85 |
-
<div
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
<div className="flex items-start gap-2.5">
|
| 87 |
<AlertTriangle size={18} className="mt-0.5 shrink-0 text-[var(--danger)]" />
|
| 88 |
<div className="min-w-0">
|
|
@@ -91,7 +130,8 @@ export function StepCapture({ lang, engine, modelError, onRetryModel, onCamera,
|
|
| 91 |
<button
|
| 92 |
type="button"
|
| 93 |
onClick={onRetryModel}
|
| 94 |
-
className="mt-3 flex items-center gap-1.5
|
|
|
|
| 95 |
>
|
| 96 |
<RotateCcw size={13} />
|
| 97 |
{t(lang, 'retry')}
|
|
@@ -101,7 +141,8 @@ export function StepCapture({ lang, engine, modelError, onRetryModel, onCamera,
|
|
| 101 |
</div>
|
| 102 |
)}
|
| 103 |
|
| 104 |
-
|
|
|
|
| 105 |
<button
|
| 106 |
type="button"
|
| 107 |
disabled={hasError}
|
|
@@ -115,8 +156,16 @@ export function StepCapture({ lang, engine, modelError, onRetryModel, onCamera,
|
|
| 115 |
<button
|
| 116 |
type="button"
|
| 117 |
disabled={hasError}
|
| 118 |
-
className="flex min-h-14 w-full items-center justify-center gap-3
|
| 119 |
onClick={onGallery}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
>
|
| 121 |
<ImagePlus size={22} strokeWidth={2} />
|
| 122 |
{t(lang, 'chooseFile')}
|
|
|
|
| 19 |
const ready = engine === 'local' || engine === 'server'
|
| 20 |
|
| 21 |
return (
|
| 22 |
+
<div className="grain relative flex flex-1 flex-col overflow-hidden">
|
| 23 |
<img
|
| 24 |
src={ASSETS.bg}
|
| 25 |
alt=""
|
|
|
|
| 32 |
/>
|
| 33 |
|
| 34 |
<div className="relative z-10 flex flex-1 flex-col items-center justify-center px-8">
|
| 35 |
+
<div className="mb-10 flex flex-col items-center gap-6">
|
| 36 |
+
{/* Logo + live status dot — staggered entrance */}
|
| 37 |
+
<div className="rise-enter relative" style={{ animationDelay: '0ms' }}>
|
| 38 |
+
<span
|
| 39 |
+
aria-hidden
|
| 40 |
+
className="pointer-events-none absolute left-1/2 top-1/2 h-32 w-32 -translate-x-1/2 -translate-y-1/2 rounded-full blur-2xl"
|
| 41 |
+
style={{ background: 'radial-gradient(circle, rgba(255,255,255,0.22), transparent 70%)' }}
|
| 42 |
+
/>
|
| 43 |
<img
|
| 44 |
src={ASSETS.logo}
|
| 45 |
alt=""
|
| 46 |
+
className="relative h-[72px] w-auto max-w-[220px]"
|
| 47 |
+
style={{
|
| 48 |
+
animation: 'breathe 3.5s ease-in-out infinite',
|
| 49 |
+
filter: 'drop-shadow(0 10px 26px rgba(0,0,0,0.32))',
|
| 50 |
+
}}
|
| 51 |
/>
|
| 52 |
<span
|
| 53 |
className={`absolute -right-2 -top-1 h-5 w-5 rounded-full border-[3px] border-[#00314d] transition-all duration-700 ${
|
|
|
|
| 57 |
? 'bg-[var(--success)]'
|
| 58 |
: 'animate-pulse bg-[var(--warning)]'
|
| 59 |
}`}
|
| 60 |
+
style={{ boxShadow: 'var(--shadow-sm)' }}
|
| 61 |
/>
|
| 62 |
</div>
|
| 63 |
|
| 64 |
+
{/* Title block */}
|
| 65 |
+
<div className="rise-enter text-center" style={{ animationDelay: '60ms' }}>
|
| 66 |
+
<h1
|
| 67 |
+
className="text-white"
|
| 68 |
+
style={{
|
| 69 |
+
font: 'var(--type-h1)',
|
| 70 |
+
letterSpacing: 'var(--tracking-tight)',
|
| 71 |
+
textShadow: '0 2px 14px rgba(0,0,0,0.20)',
|
| 72 |
+
}}
|
| 73 |
+
>
|
| 74 |
{t(lang, 'title')}
|
| 75 |
</h1>
|
| 76 |
+
<p
|
| 77 |
+
className="mt-2 text-white/70"
|
| 78 |
+
style={{ font: 'var(--type-body)' }}
|
| 79 |
+
>
|
| 80 |
{t(lang, 'captureSubtitle')}
|
| 81 |
</p>
|
| 82 |
</div>
|
| 83 |
|
| 84 |
+
{/* Status badge / retry — premium glass treatment */}
|
| 85 |
{hasError ? (
|
| 86 |
+
<button
|
| 87 |
+
type="button"
|
| 88 |
+
onClick={onRetryModel}
|
| 89 |
+
className="rise-enter ct-badge ct-badge--danger"
|
| 90 |
+
style={{ animationDelay: '120ms', boxShadow: 'var(--shadow-sm)' }}
|
| 91 |
+
>
|
| 92 |
<RotateCcw size={12} />
|
| 93 |
{t(lang, 'retry')}
|
| 94 |
</button>
|
| 95 |
) : (
|
| 96 |
<div
|
| 97 |
+
className="rise-enter ct-badge backdrop-blur-md"
|
| 98 |
+
style={{
|
| 99 |
+
animationDelay: '120ms',
|
| 100 |
+
border: '1px solid rgba(255,255,255,0.18)',
|
| 101 |
+
background: ready ? 'rgba(255,255,255,0.16)' : 'rgba(255,255,255,0.10)',
|
| 102 |
+
color: ready ? '#fff' : 'rgba(255,255,255,0.9)',
|
| 103 |
+
boxShadow: 'var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.22)',
|
| 104 |
+
}}
|
| 105 |
>
|
| 106 |
<span
|
| 107 |
className={`h-1.5 w-1.5 rounded-full ${
|
|
|
|
| 114 |
</div>
|
| 115 |
|
| 116 |
{hasError && (
|
| 117 |
+
<div
|
| 118 |
+
className="overlay-enter mb-4 w-full max-w-sm border border-red-300/40 bg-white/95 p-4"
|
| 119 |
+
style={{
|
| 120 |
+
borderRadius: 'var(--r-xl)',
|
| 121 |
+
boxShadow: 'var(--shadow-lg)',
|
| 122 |
+
animationDelay: '120ms',
|
| 123 |
+
}}
|
| 124 |
+
>
|
| 125 |
<div className="flex items-start gap-2.5">
|
| 126 |
<AlertTriangle size={18} className="mt-0.5 shrink-0 text-[var(--danger)]" />
|
| 127 |
<div className="min-w-0">
|
|
|
|
| 130 |
<button
|
| 131 |
type="button"
|
| 132 |
onClick={onRetryModel}
|
| 133 |
+
className="mt-3 flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold text-white"
|
| 134 |
+
style={{ background: 'var(--danger)', borderRadius: 'var(--r-md)', boxShadow: 'var(--shadow-sm)' }}
|
| 135 |
>
|
| 136 |
<RotateCcw size={13} />
|
| 137 |
{t(lang, 'retry')}
|
|
|
|
| 141 |
</div>
|
| 142 |
)}
|
| 143 |
|
| 144 |
+
{/* CTA column — staggered last */}
|
| 145 |
+
<div className="rise-enter w-full max-w-sm space-y-3" style={{ animationDelay: '180ms' }}>
|
| 146 |
<button
|
| 147 |
type="button"
|
| 148 |
disabled={hasError}
|
|
|
|
| 156 |
<button
|
| 157 |
type="button"
|
| 158 |
disabled={hasError}
|
| 159 |
+
className="flex min-h-14 w-full items-center justify-center gap-3 bg-white/10 text-white backdrop-blur-md transition-all active:scale-[0.98] active:bg-white/20 disabled:opacity-50 disabled:active:scale-100"
|
| 160 |
onClick={onGallery}
|
| 161 |
+
style={{
|
| 162 |
+
borderRadius: 'var(--r-lg)',
|
| 163 |
+
border: '1px solid rgba(255,255,255,0.20)',
|
| 164 |
+
fontSize: 'var(--text-md)',
|
| 165 |
+
fontWeight: 'var(--weight-semibold)',
|
| 166 |
+
letterSpacing: 'var(--tracking-snug)',
|
| 167 |
+
boxShadow: 'var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.18)',
|
| 168 |
+
}}
|
| 169 |
>
|
| 170 |
<ImagePlus size={22} strokeWidth={2} />
|
| 171 |
{t(lang, 'chooseFile')}
|