File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 // Shared tunables
88 const CELL = 20 ; // grid cell size px
99 const FONT_SZ = 11 ; // font size px
10- const MOUSE_R = 440 ; // mouse glow radius px
11- const MOUSE_PEAK = 0.46 ; // max extra alpha near mouse
1210 const FLASH_CHANCE = 0.0004 ; // probability per cell per frame of triggering a flash
1311 const FLASH_PEAK = 1 ; // peak alpha of a flash
1412 const FLASH_DECAY = 0.02 ; // alpha lost per frame during flash decay
3432
3533 let canvas , ctx ;
3634 let cols , rows , cells ;
37- let mouseX = - 9999 , mouseY = - 9999 ;
3835 let lastTs = 0 ;
3936 let mode ; // 'radiation' | 'gol'
4037
136133 const cx = col * CELL + CELL * 0.5 ;
137134 const c = cells [ row * cols + col ] ;
138135
139- // Mouse proximity glow
140- const md = Math . hypot ( cx - mouseX , cy - mouseY ) ;
141- let a = BASE_A + ( md < MOUSE_R
142- ? MOUSE_PEAK * Math . pow ( 1 - md / MOUSE_R , 1.8 )
143- : 0 ) ;
136+ let a = BASE_A ;
144137
145138 // Random flash + streak trail
146139 a += c . flash ;
316309
317310 resize ( ) ;
318311 window . addEventListener ( 'resize' , resize ) ;
319- window . addEventListener ( 'mousemove' , ( e ) => {
320- mouseX = e . clientX ;
321- mouseY = e . clientY ;
322- } ) ;
323-
324312 window . addEventListener ( 'click' , ( e ) => {
325313 if ( mode !== 'gol' ) return ;
326314 if ( e . target . closest ( '#bg-toggle' ) ) return ;
You can’t perform that action at this time.
0 commit comments