@@ -25,7 +25,6 @@ interface Step {
2525 narrationDescription : string ;
2626 explode ?: boolean ;
2727 skipRemaining ?: boolean ;
28- untaken ?: boolean ;
2928}
3029
3130interface ExplosionParticle {
@@ -58,10 +57,8 @@ const ArrayEvaluationDemo: React.FC = ({
5857 const animationRef = useRef < number | null > ( null ) ;
5958
6059 const EXPLOSION_DURATION = 500 ;
61- // const ANIMATION_STEP = 0.2;
62- const ANIMATION_STEP = 0.15 ; // Reduced from 0.2 to slow down animation
63- const FRAME_DURATION = 16 ; // roughly 60fps
64-
60+ const ANIMATION_STEP = 0.15 ;
61+ const FRAME_DURATION = 16 ;
6562 const MAX_PROGRESS = 150 ;
6663 const isEven = ( n : number ) : boolean => n % 2 === 0 ;
6764
@@ -106,9 +103,9 @@ const ArrayEvaluationDemo: React.FC = ({
106103 from : 2 ,
107104 to : 2 ,
108105 progress : 144 ,
109- untaken : true ,
106+ skipRemaining : true ,
110107 narrationTitle : 'Done!' ,
111- narrationDescription : '3 items taken' ,
108+ narrationDescription : 'Remaining items not taken' ,
112109 } ,
113110 ] ,
114111 lazy : [
@@ -328,7 +325,12 @@ const ArrayEvaluationDemo: React.FC = ({
328325 let skipRemainingItems = false ;
329326
330327 const newPositions = dots . map ( ( dot , i ) => {
331- if ( type === 'lazy' ) {
328+ if ( type === 'eager' ) {
329+ const lastStep = currentSteps [ currentSteps . length - 1 ] ;
330+ if ( lastStep . skipRemaining && progress >= lastStep . progress ) {
331+ skipRemainingItems = isEven ( i ) && ! [ 0 , 2 , 4 ] . includes ( i ) ;
332+ }
333+ } else if ( type === 'lazy' ) {
332334 const skipStep = currentSteps . find (
333335 ( s ) => s . skipRemaining && progress >= s . progress ,
334336 ) ;
@@ -424,7 +426,6 @@ const ArrayEvaluationDemo: React.FC = ({
424426 const deltaTime = currentTime - lastTime ;
425427
426428 if ( deltaTime >= FRAME_DURATION ) {
427- // Only update if enough time has passed
428429 setProgress ( ( prev ) => {
429430 const next = Math . min ( prev + ANIMATION_STEP , MAX_PROGRESS ) ;
430431 if ( next >= MAX_PROGRESS ) {
0 commit comments