Skip to content

Instantly share code, notes, and snippets.

@froger-me
froger-me / smoothscroll.js
Created November 19, 2025 02:59
A smooth scroll to use in devtools console
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