SVG Drawing Animation

A little experiment that explores the usage of SVG line drawing animations to precede the appearance of graphics or website elements, simulating the loading of them.

From our sponsor: Don't spend all day sending messages. Automatically reach out to fans based on how they behave.

SVG is finally becoming a more utilized and fun website component. It’s really powerful and there are many creative possibilities for fun effects on a website using SVG. Today we’d like to share two experimental concepts with you that make use of stroke animations, made popular by the animations on the PlayStation 4 and Xbox One review sites. This technique was introduced and explained by Jake Archibald in his article Animated line drawing in SVG and also explored by Brian Suda in his article Animating Vectors with SVG for 24Ways. For our experiments we are using his code to animate the strokes of the paths.

So, what concepts did we explore? The first one is a line drawing animation that fades into a “real” image or illustration once the respective figure is in the viewport. This can be a fun effect for any kind of illustration on a website. The second concept explores using SVG line drawing animations for simulating the loading of a website: website parts are represented by flat drawings with a stroke that gets animated and once finished, the “real” elements are shown. The technique itself is implemented in a static way where we use an SVG for every bunch of elements that fade in. The idea for the schematic representation of the website come from this awesome Dribbble shot by Chris Bannister.

The beautiful illustrations of the devices are by Pixeden and you can find the PSD files here:

The traced SVG line drawings of these illustrations were carefully crafted by talented Emanuel Serbanoiu. Check out his Dribbble profile or visit his website.

The first demo is the line drawing animation with the illustration fade-in:

The second demo is the line drawing animation with the website fade in:

And the third demo is similar to demo 2, just that the animation and the fading in of the elements happens sequentially but with a random timing:

We hope you like the effects and find them inspiring!

Tagged with:

Mary Lou

ML is a freelance web designer and developer with a passion for interaction design. She studied Cognitive Science and Computational Logic and has a weakness for the smell of freshly ground peppercorns.

Stay up to date with the latest web design and development news and relevant updates from Codrops.

CSS Reference

Learn about all important CSS properties from the basics with our extensive and easy-to-read CSS Reference.

It doesn't matter if you are a beginner or intermediate, start learning CSS now.

Feedback 80

Comments are closed.
  1. I’m dissecting the JS-code. How can you alter the draw-method so the paths will be drawn after each other, not in parallel? When one is done the next will start. Stuff like “svgs = ” = syntax error for me ;-P

  2. For some kind of reason my previous post is gone. I was asking how you can alter the draw-method (I believe it is) to have the dashoffset-animation done after each other? So animation not in parallel like it is now.

  3. Hi, Nice..just rocked. Wondering, what all you cant do for the web? Thank for sharing..

  4. Okay guys I fiddle with the code and made it that’s it’s drawing paths in parallel. It’s probably not the best JS you will see but it works. Maybe someone could improve it. Here is the fiddle at jsfiddle

  5. Looks Great! Much like Polygons “Xbox One Review” and “PS4 Review” 🙂

    If you dont want it to animate parallel, you can try this out!

  6. Awesome demo. have managed to get it working on my own project but it fails in IE (no shock there) is their a known fix for this

  7. Thanks a lot Mary Lou ! Lovely effect !!!
    I’d like to know it’s possible to add mouseenter and mouseleave functions when hovering thumbs (demo 2 and 3) in order to replay animation ?
    Like this wonderful portfolio site :

  8. In Firefox (v.27 – win) it draws the paths two times – it’s not hidden initially like it is in the other browsers. any solution for that?

    • Same issue here. Works fine on Firefox 27 on mac, but draws the path twice on win.