3 Creating a responsive animated loading screen

 

This chapter covers

  • Creating basic shapes using Scalable Vector Graphics (SVGs)
  • Finding out the difference between viewbox and viewport in SVG
  • What keyframes are and how we can animate SVG graphics from one size to another
  • Using the animation property to set the duration, style, how many times the loader should animate and how to delay when animations should start
  • How to style SVGs using CSS
  • How to style an HTML progress bar element with appearance properties

We see loaders in most applications today. These loaders are used as a way to communicate to the user something is loading, uploading, or waiting for something. It gives the user confidence that something is happening.

Without some sort of indicator to tell the user something is happening the user may try reloading, go back and click the link again, or just give up and leave. We should be using some sort of progress indicator when an action takes longer than one second, this is when users tend to lose focus and question if there is a problem. As well as having a visual graphic showing something is happening, the loader should be accompanied with text that tells the user what is happening to improve the accessibility of the web page for screen readers and other assistive technologies.

3.1 SVG basics

 
 
 

3.1.1 Positioning SVG elements

 
 
 

3.1.2 Viewport

 
 
 
 

3.1.3 ViewBox

 
 

3.1.4 Shapes in SVG

 
 
 
 

3.2 Applying styles to SVGs

 
 
 

3.2.1 Fill property

 
 
 
 

3.3 How to animate elements in CSS

 
 

3.3.1 Animation properties

 
 
 
 

3.3.2 Keyframes and animation name

 
 
 
 

3.3.3 Duration property

 
 

3.3.4 Iteration count

 
 

3.3.5 Animation shorthand property

 
 

3.3.6 Delay property

 
 
 
 

3.4 Transform origin property

 
 
 
 

3.5 Accessibility when animating and the reduced motion query

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage