You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The hero banner on the landing page currently contains multiple slides but requires manual interaction via arrow buttons to navigate between them. Adding an auto-play feature with a fixed time interval will make the banner more dynamic and engaging without requiring any user interaction.
Current Behavior
Slides only change when the user manually clicks the left/right arrow buttons
The carousel remains static if the user does not interact with it
Proposed Changes
Auto-play — Automatically advance to the next slide every 4–6 seconds using setInterval
Pause on hover — Pause the auto-play when the user hovers over the banner (onMouseEnter) to avoid interrupting intentional reading
Resume on mouse leave — Restart the interval when the user moves their cursor away (onMouseLeave)
Seamless loop — After the last slide, loop back to the first slide automatically
Implementation Approach
Use setInterval to trigger the existing next-slide logic at a fixed interval
Clear the interval on onMouseEnter and restart it on onMouseLeave
Reuse the existing arrow button navigation logic — just call it programmatically
Use useEffect with proper cleanup to avoid memory leaks
Description
The hero banner on the landing page currently contains multiple slides but requires manual interaction via arrow buttons to navigate between them. Adding an auto-play feature with a fixed time interval will make the banner more dynamic and engaging without requiring any user interaction.
Current Behavior
Proposed Changes
setIntervalonMouseEnter) to avoid interrupting intentional readingonMouseLeave)Implementation Approach
setIntervalto trigger the existing next-slide logic at a fixed intervalonMouseEnterand restart it ononMouseLeaveuseEffectwith proper cleanup to avoid memory leaksScreen Recording
Kmesh-Video.1.mp4