Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IDK, on my fast desktop computer it's still a slow and bad simulation of inertia.


It shouldn't matter if it's a fast desktop or slow mobile (unless it's not keeping up, which is unlikely in these examples); what matters is the display rate on these devices. The demos feel very fast in a 250Hz monitor when compared to a 60Hz one.


That's right. These demos are, as they should be, using requestAnimationFrame [1]. The docs have "Warning: Be sure to always use the first argument (or some other method for getting the current time) to calculate how much the animation will progress in a frame, otherwise the animation will run faster on high refresh rate screens."

Though there are cases like iOS cross-origin frames where it's throttled to 30fps [2] for power-saving reasons.

[1] https://developer.mozilla.org/en-US/docs/Web/API/window/requ...

[2] https://bugs.webkit.org/show_bug.cgi?id=168837




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: