This file contains 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
function scrollToBottom(duration) { | |
const currentPosition = window.pageYOffset; | |
const targetPosition = document.documentElement.scrollHeight - window.innerHeight; | |
const distance = targetPosition - currentPosition; | |
const startTime = performance.now(); | |
function scrollStep(timestamp) { | |
const elapsed = timestamp - startTime; | |
const progress = Math.min(elapsed / duration, 1); | |
const easing = quadraticEaseInOut(progress); |