Hexagon Page Animations
The blog post details the author's evolution of hexagon animations from d3.js to Vue, highlighting improved performance, the adoption of CSS transitions, and solutions for browser compatibility and animation visibility issues.
Read original articleThe blog post from Red Blob Games discusses the evolution of hexagon page animations, detailing the author's experiences with different animation techniques over the years. Initially, in 2013, the author used d3.js for animations but faced challenges with CSS transitions in SVG. The solution involved using JavaScript to rotate both the grid and the text, ensuring the text remained upright. In 2018, the author transitioned to Vue and implemented a new animation system that optimized performance by limiting animations to visible diagrams. Despite the introduction of the SVG2 feature "vector-effect: non-rotation" in 2016, it was found to be unsupported in major browsers. The author then decided to explore CSS transitions, which are easier to implement and more efficient than JavaScript transitions. The post outlines the steps taken to refactor the code, including switching from inline styles to classes and adding CSS transition rules. A bug in Safari was encountered, where animations would only play when elements became visible, prompting the use of IntersectionObserver to trigger animations appropriately. The author expresses satisfaction with the simplification of the implementation and hopes for smoother animations across devices.
- The author has evolved hexagon animations from d3.js to Vue, improving performance and usability.
- CSS transitions were chosen for their efficiency and ease of programming compared to JavaScript transitions.
- The "vector-effect: non-rotation" feature in SVG2 remains unsupported in major browsers.
- A bug in Safari required the use of IntersectionObserver to manage animation visibility.
- The implementation has been simplified, aiming for smoother animations on various devices.
Related
SVG Triangle of Compromise
The article explores SVG (Scalable Vector Graphics) on the web, highlighting its stylability, cacheability, and dimensionality, while discussing advantages and challenges in web design and performance considerations.
Can you convert a video to pure CSS?
The article explores converting video content into CSS animations, highlighting browser compatibility issues, particularly with Safari, and suggesting JavaScript alternatives for cross-browser functionality while detailing performance differences.
SVG Coding Examples: Useful Recipes for Writing Vectors by Hand
Myriam Frisano's article on Smashing Magazine offers a detailed guide to hand-coding SVGs, covering practical examples, the coordinate system, viewBox, JavaScript methods, accessibility, and basic shape manipulation.
How I Built My Blog
Josh W. Comeau has rebuilt his blog with a new tech stack, including Next.js and MDX, involving over 100,000 lines of code, while enhancing user experience and styling with Linaria.
Making Of: Line Drawing Tutorial (2017)
The article is a tutorial on creating interactive line drawing diagrams using D3.js and SVG, emphasizing JavaScript, SVG, and HTML knowledge, and covering key concepts like linear interpolation and D3's enter-exit pattern.
Related
SVG Triangle of Compromise
The article explores SVG (Scalable Vector Graphics) on the web, highlighting its stylability, cacheability, and dimensionality, while discussing advantages and challenges in web design and performance considerations.
Can you convert a video to pure CSS?
The article explores converting video content into CSS animations, highlighting browser compatibility issues, particularly with Safari, and suggesting JavaScript alternatives for cross-browser functionality while detailing performance differences.
SVG Coding Examples: Useful Recipes for Writing Vectors by Hand
Myriam Frisano's article on Smashing Magazine offers a detailed guide to hand-coding SVGs, covering practical examples, the coordinate system, viewBox, JavaScript methods, accessibility, and basic shape manipulation.
How I Built My Blog
Josh W. Comeau has rebuilt his blog with a new tech stack, including Next.js and MDX, involving over 100,000 lines of code, while enhancing user experience and styling with Linaria.
Making Of: Line Drawing Tutorial (2017)
The article is a tutorial on creating interactive line drawing diagrams using D3.js and SVG, emphasizing JavaScript, SVG, and HTML knowledge, and covering key concepts like linear interpolation and D3's enter-exit pattern.