sfirrin / Clean-Google-Calendar

A chrome app for Google Calendar that makes it more straightforward and enjoyable to use
GNU General Public License v3.0
124 stars 14 forks source link

suggestion: Use requestAnimationFrame instead of window.onresize. #12

Open ghost opened 7 years ago

ghost commented 7 years ago

In some of my personal apps, I've noticed that making an animation loop with requestAnimationFrame and detecting window size inside there then updating stuff seems to be smoother than relying on window.onresize (https://github.com/sfirrin/Clean-Google-Calendar/blob/master/main.js#L37).

ghost commented 7 years ago

An example: https://infamous.io/

On desktop, try resizing with the mouse back and forth. The layout (the content at the bottom) is generated with JavaScript that is hooked in by requestAnimationFrame.

ghost commented 7 years ago

By the way, awesome Chrome app! 😃