-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
105 lines (89 loc) · 3.71 KB
/
App.tsx
File metadata and controls
105 lines (89 loc) · 3.71 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
import React, { useState } from 'react';
import { CameraShoot } from './components/CameraShoot';
import { PhotoStrip } from './components/PhotoStrip';
import { AsciiButton, AsciiBorder, AnimatedBackground, TypewriterEffect } from './components/AsciiUI';
import { AppState } from './types';
const App: React.FC = () => {
const [state, setState] = useState<AppState>('intro');
const [photos, setPhotos] = useState<string[]>([]);
const handleStart = () => {
setState('shooting');
};
const handlePhotosTaken = (capturedPhotos: string[]) => {
setPhotos(capturedPhotos);
setState('result');
};
const handleRestart = () => {
setPhotos([]);
setState('intro');
};
return (
<main className="min-h-screen w-full relative p-4 py-8 flex flex-col items-center justify-start text-pink-600">
<AnimatedBackground />
{/* Increased max-width to 6xl to support side-by-side results layout */}
<div className="w-full max-w-6xl z-10">
{/* Header */}
<header className="mb-8 text-center">
<h1 className="text-3xl md:text-5xl font-bold text-pink-500 tracking-tighter drop-shadow-[2px_2px_0_rgba(255,255,255,1)]">
< LIFE 4 CUTS />
</h1>
<div className="text-pink-400 mt-2 text-sm md:text-base font-bold">
<TypewriterEffect text="Capture your 8-bit memories..." delay={80} />
</div>
</header>
{/* Content Area */}
<div className="min-h-[400px] flex flex-col items-center justify-center">
{state === 'intro' && (
<div className="animate-fade-in flex flex-col items-center w-full">
<AsciiBorder title="WELCOME" className="bg-white/80 max-w-lg w-full text-center shadow-lg shadow-pink-100">
<div className="py-8 px-4">
<div className="text-6xl mb-6 text-pink-400 animate-bounce">
( ˘ ³˘)♥
</div>
<p className="mb-6 text-lg leading-relaxed text-pink-700 font-medium">
Welcome to the Cyber-Cute Photo Booth.<br/>
We will take 4 consecutive photos.<br/>
Get your poses ready!
</p>
<div className="flex flex-col gap-2 items-center">
<AsciiButton onClick={handleStart}>
[ ENTER BOOTH ]
</AsciiButton>
<span className="text-xs text-pink-400 mt-2">
* Camera permission required
</span>
</div>
</div>
</AsciiBorder>
<div className="mt-8 grid grid-cols-4 gap-2 opacity-50">
{[1,2,3,4].map(i => (
<div key={i} className="w-12 h-16 border border-pink-300 bg-pink-50 flex items-center justify-center text-xs text-pink-300">
{i}
</div>
))}
</div>
</div>
)}
{state === 'shooting' && (
<CameraShoot
onComplete={handlePhotosTaken}
onCancel={() => setState('intro')}
/>
)}
{state === 'result' && (
<PhotoStrip
photos={photos}
onRestart={handleRestart}
/>
)}
</div>
{/* Footer */}
<footer className="mt-12 pb-4 text-center text-xs text-pink-400 font-mono">
<p>SYSTEM.STATUS: ONLINE | VER: 1.1.0</p>
<p>ASCII LOVE FOREVER</p>
</footer>
</div>
</main>
);
};
export default App;