Stops css animation resize jank.

10/14/2019
Back to Blogs
.animation-stopped * {
  animation: none !important;
  transition: none !important;
}
/* JS */
let resizeTimer;
window.addEventListener("resize", () => {
  document.body.classList.add("animation-stopped");
  clearTimeout(resizeTimer);
  resizeTimer = setTimeout(() => {
    document.body.classList.remove("animation-stopped");
  }, 400);
});