Learn Svg Animation

Tags: Animation

Learn how these powerful animation are created using HTML,CSS & Javascript

Last updated 2022-01-10 | 4.4

- Optimise SVG files for use online
- Prototype animations in the online tool Codepen
- Use Javascript to calculate the length of an SVG Path

What you'll learn

Optimise SVG files for use online
Prototype animations in the online tool Codepen
Use Javascript to calculate the length of an SVG Path
Create SVG's that make use of Masks & Gradients

* Requirements

* Have a text editor downloaded to their computer e.d Atom.io
* Sublime Text
* If you have a vector graphics program like Adobe illustrator you can follow along but it is not required. All svg files are provided.
* Have experience writing CSS code and styling using classes

Description

Looking to enhance your next web development project? Or learn one of the most sort after animation skills?

Within two hours you will have created Six SVG projects looking at a number of different animation techniques. Using animation within the user interface of a website is now standard practise. This fast and effective course will introduce use to new ways to improve your client projects.

All SVG files are provided but we do also work through creating the SVG files in Adobe Illustrator(or Similar). Lessons are taught with video screencasts, explained in detail as we work through real projects created directly for this course.

Projects Include

- Animating Logos

- Animating Social Icons

- Hand Drawing Text 

- CSS animation properties explained 

- Using Gradients over Text and Icons (Cross Browser)

- Using Masks 

- Using CodePen

- Introduction to SVG Optimisation Online

For a complete beginner to SVG we recommend taking our other course in the series. 


Who this course is for:

  • Should already know what an svg file is
  • Should have used html/css before - not suitable for absolute beginner to coding
  • Students who want to improve their svg animations and try new techniques but don't know how

Course content

8 sections • 22 lectures

Course Introduction & Outline Preview 02:21

Introduction to the course and walkthrough of each of the lessons include. This lesson should give you an understanding of what projects you will work on through the course.

Create an SVG and access the code Preview 02:52

Introduction to SVG creation process. In this lesson we look at the steps used for each project to create the svg files we will be animating. 

Optimise Code with OMGSVG Preview 01:14

Optimise .svg files online. In this lesson we go through the process of using the online tool OMG SVG to improve our svg creations by making the code a smaller file size and easier to read.

Starting a New Project on Codepen.io Preview 03:17

In this lesson we look at the settings used when creating a new project on Codepen.io. Setting to Remember. 

  • CSS Preprocessor - SCSS (Allows us to nest css rules and increase productivity)
  • Autoprefixer - (Will ensure our animations work in whatever browser you are using)
  • Normalize - Used in most production projects and a good practise to use when learning too.

Introduction to Project Preview 01:08

Introduction to the Shapes Project. Across the next four lessons we work through an svg project from scratch. 

Drawing The SVG Preview 04:53

Creating the SVG.

  • Draw out shape/logo in Adobe Illustrator (also available as a downloadable file)
  • Access the code behind the svg
  • Optimse the code online
  • Import and setup our CodePen project

Create Line Animations Preview 04:47

In this Lesson we look at creating line animations in svg. Students will recap the stroke-dasharray/stroke-dashoffset technique of creating animations where lines of the svg shape are drawn out.

Javascript Line Calculation Preview 04:12

In this lesson we look at using Javascript to calculate the length of a shape's outline. Using the javascript calculated length allows for faster prototyping and more efficient project creation. 

Add Final Animations Preview 03:46

Finish the svg animation for the shapes logo. In this Lesson we what we learnt about javascript calculations to add another line animation along with two more rotational animations.

Monkey Animation Preview 08:27

The purpose of this lesson is to take a longer look at the animation properties we have been using in our projects.

  • stroke-dasharray
  • stroke-dashoffset
  • animation-name
  • animation-duration
  • animation-iteration-count
  • animation-direction
  • animation-timing-function
  • animation-fill-mode

CSS Animations - FROM/TO - Using Percentages Preview 02:11

This lesson aims to work through the difference between using a from/to animation and a percentage based animation e.g 10/50/100.

Line Animation Directions Preview 02:58

You may find depending on how you created your svg in adobe illustrator you animation might run backwards. We look at the four possibilities for drawing/un-drawing you svg shapes.

Create SVG Text Preview 01:57

In this lesson we use the pen tool in Adobe Illustrator to simulate using a graphics tablet for hand drawn text. Once we have our text we get setup in Codepen with a new project. 

Animate Text Writing Effect Preview 04:06

We use what we learned in the previous lesson about animation directions to make sure our hand drawn text is drawn out in the correct way. This is a popular and much requested technique.

Project Introduction Preview 01:22

This section is based around creating three unique social media animations. Animations such as these are seen around the web and often more unexperienced developers may feel they have to copy code examples or use plugins to achieve these effects. We work through three examples to show how easily these results can be achieved once you know how.

Twitter Animation Preview 04:23

Twitter Icon - In this lesson we work through creating a custom animation for our Twitter icon. 

  • Circle outline should disappear as twitter outline burst off icon

Youtube Animation Preview 04:05

Youtube Icon - In this lesson we work through creating a custom animation for our Youtube icon.

  • Circle outline should expand as inner circle and logo invert colours

Facebook Animation Preview 04:23

Facebook Icon - In this lesson we work through creating a custom animation for our Facebook icon.

  • Outer circle expands as new sunburst detail appears and spins

Gradient Project Preview 05:43

Gradients - In this lesson we look at creating gradients using svg code. We take an svg created in Illustrator then create the gradient in code in CodePen. After creating our gradient we look at how to easily apply it to any other element within our svg.

Using Texture's Preview 04:26

Texture - In this lesson we look at applying a texture to an svg icon or text by using a mask and any black/white image.

Advanced Masking Technique Preview 10:02

Opacity Masks - In this lesson we look at using masks to control what parts of the svg we can see. This technique allows for some very interesting and advanced animations. By completing this animation students will know how to use css animations to reveal parts of svg shapes with another svg shape.

Congratulations & Thank You Preview 00:30

Congratulations for completing this course on svg animation. We hop to see you in a future course. Please remember to rate the course if you found it useful. Thank You.