top | item 35486044

(no title)

mkishi | 2 years ago

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.

discuss

order

jefftk|2 years ago

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