Create and animate SVG polygons

In this tutorial we will be creating a range of images out of SVG triangles, and setting up an animated transition from one image to another on click. It’ll look something like the Faces of Power website. These animations can really add interest to a site, particularly a landing page, as well as enhance user experience. If you've got a complex site to maintain, you will need a super web hosting service. building something less complicated? A website builder might do the job.

To kick off we are going to start with two arrays: one with the values we’re animating to, and one with the values we’re animating from. Every time a link is clicked, we are going to find the SVG that matches the href of that link and get the points attribute of each of the polygons in that specific SVG. 

Thank you for reading 5 articles this month* Join now for unlimited access

Enjoy your first month for just £1 / $1 / €1

*Read 5 free articles per month without a subscription

Join now for unlimited access

Try first month for just £1 / $1 / €1

Nataliya is a web developer specialising in HTML, CSS and JavaScript.
Latest in 2D Animation
Character design
How to simplify figures for animation
art tutorial
How to create dynamic action scenes in Clip Studio Paint
iOS 17
Apple's joyful iOS 17 animations mesmerise iPhone fans
Studio ghibli food
The tantalising secret behind Studio Ghibli's iconic food animation
Reallusion
How to make broadcast-quality children's animations with Cartoon Animator
Reallusion
Hi From the Future - remotely making an animated music video
Latest in How to
Rob Redman's snowy image illustrates the AE tutorial: TDW313.PT_AE_Snow.indd
How to create realistic snow with particle systems using After Effects
Ivan Mironenko ZBrush character tutorial
Craft a game-ready character asset using ZBrush and Substance 3D Painter
Mario Leone SpeedTree tutorial
How to make lifelike trees and vegetation with SpeedTree
Oliver Schümann ZBrush bizarre baby tutorial
Create a bizarre baby sculpture in ZBrush
Alireza Khoshpayam arch-viz tips
Speedy tips to create beautifully photoreal archviz using 3ds Max and Corona
Maya 3D abstract strands tutorial
How to easily create complex and abstract animation using Maya