Skip to content

Commit d406b39

Browse files
committed
0Initial commit
1 parent 04d86b2 commit d406b39

File tree

3 files changed

+16
-30
lines changed

3 files changed

+16
-30
lines changed

App.tsx

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import { Player } from './types';
33
import { INITIAL_PLAYERS, WHEEL_COLORS, PRESET_PLAYERS } from './constants';
44
import Wheel from './components/Wheel';
55
import Controls from './components/Controls';
6-
import { Suspense, lazy } from 'react';
76
import WinRipple from './components/WinRipple';
7+
import WinnerModal from './components/WinnerModal';
8+
import Confetti from './components/Confetti';
89
import { Play, Zap, History, Trophy } from 'lucide-react';
910
import { ensureAudio, playTick, playWin, playSpinStart } from './utils/audio';
1011

11-
const WinnerModal = lazy(() => import('./components/WinnerModal'));
12-
const Confetti = lazy(() => import('./components/Confetti'));
13-
1412
// Helper for cubic-bezier(0.1, 0, 0.18, 1) approximation
1513
// We need this to calculate where the wheel IS during the JS loop to play sounds correctly
1614
function cubicBezier(t: number): number {
@@ -150,11 +148,6 @@ const [eliminationMode, setEliminationMode] = useState(() => {
150148
return () => window.removeEventListener('resize', debouncedResize);
151149
}, []);
152150

153-
// Preload lazy chunks to avoid blank modal on first win
154-
useEffect(() => {
155-
import('./components/WinnerModal');
156-
import('./components/Confetti');
157-
}, []);
158151

159152
const handleSpin = useCallback(() => {
160153
if (isSpinning || players.length < 2) return;
@@ -330,14 +323,6 @@ const [eliminationMode, setEliminationMode] = useState(() => {
330323
};
331324
}, []);
332325

333-
useEffect(() => {
334-
if ('serviceWorker' in navigator) {
335-
navigator.serviceWorker.register('/asmodeus/sw.js', { scope: '/asmodeus/' }).catch((err) => {
336-
console.warn('SW register failed', err);
337-
});
338-
}
339-
}, []);
340-
341326
// Streamer mode countdown
342327
useEffect(() => {
343328
if (!streamerMode) return;
@@ -687,19 +672,8 @@ const [eliminationMode, setEliminationMode] = useState(() => {
687672

688673
</div>
689674

690-
<Suspense
691-
fallback={
692-
<div className="fixed inset-0 z-40 flex items-center justify-center bg-black/70 backdrop-blur">
693-
<div className="flex flex-col items-center gap-3 text-slate-200 font-mono text-sm">
694-
<div className="w-10 h-10 rounded-full border-4 border-fuchsia-400/50 border-t-transparent animate-spin"></div>
695-
<span>Loading...</span>
696-
</div>
697-
</div>
698-
}
699-
>
700-
<WinnerModal winner={winner} onClose={handleModalClose} />
701-
<Confetti trigger={confettiTrigger} duration={CONFETTI_DURATION} />
702-
</Suspense>
675+
<WinnerModal winner={winner} onClose={handleModalClose} />
676+
<Confetti trigger={confettiTrigger} duration={CONFETTI_DURATION} />
703677
<WinRipple trigger={rippleTrigger} color={winner?.color || '#ef4444'} />
704678
<div className="sr-only" aria-live="polite">
705679
{(winner ? `${winner.name} won` : isSpinning ? 'Wheel is spinning' : 'Ready') + '. ' + (liveMessage || '')}

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@vitejs/plugin-react": "^4.2.1",
2121
"autoprefixer": "^10.4.19",
2222
"postcss": "^8.4.47",
23+
"source-map": "^0.7.6",
2324
"tailwindcss": "^3.4.17",
2425
"typescript": "^5.4.2",
2526
"vite": "^5.1.5"

0 commit comments

Comments
 (0)