@@ -143,8 +143,8 @@ export function renderGrid(
143143 const cell = target . closest ( '.grid-cell' ) as HTMLElement ;
144144 if ( ! cell ) return ;
145145
146- const row = parseInt ( cell . dataset . row || '0' ) ;
147- const col = parseInt ( cell . dataset . col || '0' ) ;
146+ const row = Number . parseInt ( cell . dataset . row || '0' ) ;
147+ const col = Number . parseInt ( cell . dataset . col || '0' ) ;
148148 const valStr = cell . dataset . val || '' ;
149149 const desc = cell . dataset . desc || '' ;
150150 const isBasis = cell . dataset . isBasis === 'true' ;
@@ -177,8 +177,8 @@ export function renderGrid(
177177 const isBasis = cell . dataset . isBasis === 'true' ;
178178 if ( ! isBasis ) return ;
179179
180- const row = parseInt ( cell . dataset . row || '0' ) ;
181- const col = parseInt ( cell . dataset . col || '0' ) ;
180+ const row = Number . parseInt ( cell . dataset . row || '0' ) ;
181+ const col = Number . parseInt ( cell . dataset . col || '0' ) ;
182182 const targetGridId = el . dataset . target || '' ;
183183
184184 window . dispatchEvent ( new CustomEvent ( 'animate-basis' , {
@@ -295,7 +295,7 @@ export function renderGrid(
295295 badge . style . cursor = 'help' ;
296296 badge . addEventListener ( 'mouseenter' , ( e ) => {
297297 const target = e . currentTarget as HTMLElement ;
298- const count = parseInt ( target . textContent || '0' ) ;
298+ const count = Number . parseInt ( target . textContent || '0' ) ;
299299 showTooltip ( e , `${ count } /64` , '-' , '-' , 'Non-zero coefficients (|value| ≥ 0.5)' ) ;
300300 } ) ;
301301 badge . addEventListener ( 'mouseleave' , ( ) => hideTooltip ( ) ) ;
@@ -527,10 +527,10 @@ function applyPartialReconToGrid(row: number, col: number): void {
527527 const t = Math . min ( 1 , Math . abs ( contrib ) / maxContrib ) * 0.75 ;
528528 if ( contrib > 0 ) {
529529 r = Math . round ( r + ( 239 - r ) * t ) ;
530- g = Math . round ( g + ( 68 - g ) * t ) ;
531- b = Math . round ( b + ( 68 - b ) * t ) ;
530+ g = Math . round ( g + ( 68 - g ) * t ) ;
531+ b = Math . round ( b + ( 68 - b ) * t ) ;
532532 } else if ( contrib < 0 ) {
533- r = Math . round ( r + ( 59 - r ) * t ) ;
533+ r = Math . round ( r + ( 59 - r ) * t ) ;
534534 g = Math . round ( g + ( 130 - g ) * t ) ;
535535 b = Math . round ( b + ( 246 - b ) * t ) ;
536536 }
@@ -580,7 +580,7 @@ export function startReconstructionAnimation(): void {
580580
581581 // Resume if paused mid-animation
582582 if ( reconState !== null ) {
583- reconState . startTime = performance . now ( ) - reconState . currentIndex * RECON_STEP_MS ;
583+ reconState . startTime = Date . now ( ) - reconState . currentIndex * RECON_STEP_MS ;
584584 setReconstructionButtonIcon ( true ) ;
585585 reconstructionAnimationId = requestAnimationFrame ( runReconFrame ) ;
586586 return ;
@@ -603,7 +603,7 @@ export function startReconstructionAnimation(): void {
603603 currentIndex : 0 ,
604604 lastBasisPattern : null ,
605605 lastBasisCoeff : 0 ,
606- startTime : performance . now ( ) ,
606+ startTime : Date . now ( ) ,
607607 lastZigzagIdx : 0 ,
608608 lastRawCoeff : 0 ,
609609 } ;
@@ -705,7 +705,7 @@ function updateReconstructionProgress(index: number): void {
705705 if ( ! el ) return ;
706706
707707 if ( index < 0 ) { el . style . display = 'none' ; return ; }
708- if ( index === 0 ) { el . textContent = '' ; el . style . display = 'none ' ; return ; }
708+ if ( index === 0 ) { el . textContent = '0/64 ' ; el . style . display = '' ; return ; }
709709
710710 if ( index >= 64 ) {
711711 el . textContent = '64/64' ;
@@ -744,16 +744,16 @@ function showBannerForCell(row: number, col: number): void {
744744}
745745
746746const FREQ_DESCRIPTIONS : Record < string , string > = {
747- 'DC' : 'Sets the average brightness across the whole block' ,
748- 'Low' : 'Broad shapes and gentle gradients' ,
749- 'Mid' : 'Edges and moderate detail' ,
747+ 'DC' : 'Sets the average brightness across the whole block' ,
748+ 'Low' : 'Broad shapes and gentle gradients' ,
749+ 'Mid' : 'Edges and moderate detail' ,
750750 'High' : 'Sharp edges and fine texture' ,
751751} ;
752752
753753const FREQ_COLORS : Record < string , string > = {
754- 'DC' : '#8b5cf6' ,
755- 'Low' : '#10b981' ,
756- 'Mid' : '#f59e0b' ,
754+ 'DC' : '#8b5cf6' ,
755+ 'Low' : '#10b981' ,
756+ 'Mid' : '#f59e0b' ,
757757 'High' : '#ef4444' ,
758758} ;
759759
@@ -768,16 +768,16 @@ function updateReconAnimBanner(
768768
769769 if ( processedCount >= 64 ) {
770770 // Done state
771- const stepEl = document . getElementById ( 'reconBannerStep' ) ;
772- const fillEl = document . getElementById ( 'reconBannerFill' ) as HTMLElement | null ;
773- const freqEl = document . getElementById ( 'reconBannerFreq' ) ;
771+ const stepEl = document . getElementById ( 'reconBannerStep' ) ;
772+ const fillEl = document . getElementById ( 'reconBannerFill' ) as HTMLElement | null ;
773+ const freqEl = document . getElementById ( 'reconBannerFreq' ) ;
774774 const coeffEl = document . getElementById ( 'reconBannerCoeff' ) ;
775- const descEl = document . getElementById ( 'reconBannerDesc' ) ;
776- if ( stepEl ) stepEl . textContent = '64' ;
777- if ( fillEl ) fillEl . style . width = '100%' ;
778- if ( freqEl ) { freqEl . textContent = 'Complete' ; freqEl . style . background = '#10b981' ; freqEl . style . color = 'white' ; }
775+ const descEl = document . getElementById ( 'reconBannerDesc' ) ;
776+ if ( stepEl ) stepEl . textContent = '64' ;
777+ if ( fillEl ) fillEl . style . width = '100%' ;
778+ if ( freqEl ) { freqEl . textContent = 'Complete' ; freqEl . style . background = '#10b981' ; freqEl . style . color = 'white' ; }
779779 if ( coeffEl ) { coeffEl . textContent = '' ; coeffEl . style . color = '' ; }
780- if ( descEl ) descEl . textContent = 'All 64 coefficients applied — reconstruction complete' ;
780+ if ( descEl ) descEl . textContent = 'All 64 coefficients applied — reconstruction complete' ;
781781 // Clear the canvas
782782 const canvas = document . getElementById ( 'reconBasisCanvas' ) as HTMLCanvasElement | null ;
783783 if ( canvas ) { const ctx = canvas . getContext ( '2d' ) ; if ( ctx ) ctx . clearRect ( 0 , 0 , canvas . width , canvas . height ) ; }
@@ -787,19 +787,19 @@ function updateReconAnimBanner(
787787
788788 banner . style . display = '' ;
789789
790- const row = Math . floor ( zigzagIdx / 8 ) ;
791- const col = zigzagIdx % 8 ;
790+ const row = Math . floor ( zigzagIdx / 8 ) ;
791+ const col = zigzagIdx % 8 ;
792792 const label = getTransformFreqLabel ( row , col ) ;
793793 const isZero = Math . abs ( coeff ) < 0.0001 ;
794794
795- const stepEl = document . getElementById ( 'reconBannerStep' ) ;
796- const fillEl = document . getElementById ( 'reconBannerFill' ) as HTMLElement | null ;
797- const freqEl = document . getElementById ( 'reconBannerFreq' ) ;
795+ const stepEl = document . getElementById ( 'reconBannerStep' ) ;
796+ const fillEl = document . getElementById ( 'reconBannerFill' ) as HTMLElement | null ;
797+ const freqEl = document . getElementById ( 'reconBannerFreq' ) ;
798798 const coeffEl = document . getElementById ( 'reconBannerCoeff' ) ;
799- const descEl = document . getElementById ( 'reconBannerDesc' ) ;
799+ const descEl = document . getElementById ( 'reconBannerDesc' ) ;
800800
801- if ( stepEl ) stepEl . textContent = String ( processedCount ) ;
802- if ( fillEl ) fillEl . style . width = `${ ( processedCount / 64 ) * 100 } %` ;
801+ if ( stepEl ) stepEl . textContent = String ( processedCount ) ;
802+ if ( fillEl ) fillEl . style . width = `${ ( processedCount / 64 ) * 100 } %` ;
803803
804804 if ( freqEl ) {
805805 freqEl . textContent = label ;
0 commit comments