December 21st, 2024

Hexagon Page Animations

The blog post outlines the transition from d3.js to CSS transitions for hexagon animations, highlighting improved efficiency, reduced updates, and a workaround for Safari bugs to enhance performance across devices.

Read original articleLink Icon
Hexagon Page Animations

The blog post discusses the evolution of hexagon animations on the Red Blob Games website, detailing the transition from using d3.js for animations to implementing CSS transitions. Initially, the author faced challenges with CSS transitions in SVG, opting for JavaScript transitions that required extensive updates for each animation frame. In 2018, a rewrite using Vue allowed for a more efficient approach, but limitations in browser support for the SVG feature "vector-effect: non-rotation" hindered progress. With advancements in browser capabilities, the author revisited CSS transitions, finding them easier to implement and more efficient than JavaScript. The new method significantly reduced the number of HTML updates required for animations. The author also addressed a bug in Safari that delayed animations for off-screen elements by using IntersectionObserver to trigger animations only for visible elements. The post concludes with the author's hope that the new implementation will enhance animation performance across devices.

- The author transitioned from d3.js to CSS transitions for hexagon animations.

- Initial challenges included browser support issues and the inefficiency of JavaScript transitions.

- CSS transitions were found to be easier and more efficient, reducing the number of updates needed.

- A workaround for a Safari bug was implemented using IntersectionObserver.

- The author aims for smoother animations across various devices with the new implementation.

Link Icon 0 comments