This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setTimeout(() => { | |
| const targetScrollY = document.body.scrollHeight - window.innerHeight; | |
| const currentScrollY = window.pageYOffset; | |
| const distance = targetScrollY - currentScrollY; | |
| if (distance <= 0) return; // already at or past the bottom | |
| const speed = 50; // pixels per second — decrease this to make it slower | |
| const duration = (distance / speed) * 1000; // total time in milliseconds |
OlderNewer