@@ -3,14 +3,12 @@ import { Player } from './types';
33import { INITIAL_PLAYERS , WHEEL_COLORS , PRESET_PLAYERS } from './constants' ;
44import Wheel from './components/Wheel' ;
55import Controls from './components/Controls' ;
6- import { Suspense , lazy } from 'react' ;
76import WinRipple from './components/WinRipple' ;
7+ import WinnerModal from './components/WinnerModal' ;
8+ import Confetti from './components/Confetti' ;
89import { Play , Zap , History , Trophy } from 'lucide-react' ;
910import { 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
1614function 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 || '' ) }
0 commit comments