Skip to content

Instantly share code, notes, and snippets.

@kentbrew
Last active February 26, 2017 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kentbrew/873fabf69f678a7b1d6127ea6e02d481 to your computer and use it in GitHub Desktop.
Save kentbrew/873fabf69f678a7b1d6127ea6e02d481 to your computer and use it in GitHub Desktop.
An animated SVG, suitable for use as a progress indicator.
Display the source blob
Display the rendered blob
Raw
<svg
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
height="320"
width="320"
viewBox="0 0 16 16"
xml:space="preserve" >
<path fill="#000"
d="M 8, 0
A .5, .5, 0, 0, 0, 8, 1
A 6, 7, 0, 0, 1, 14, 8
A 6, 6, 0, 0, 1, 8, 14
A 5, 6, 0, 0, 1, 3, 8
A 1, 1, 0, 0, 0, 0, 8
A 8, 8, 0, 0, 0, 8, 16
A 8, 8, 0, 0, 0, 16, 8
A 8, 8, 0, 0, 0, 8, 0
Z"
>
<animateTransform
attributeType="XML"
attributeName="transform"
type="rotate"
from="0 8 8"
to="360 8 8"
dur="0.6s"
repeatCount="indefinite" />
</path>
</svg>
@kentbrew
Copy link
Author

kentbrew commented Feb 2, 2017

Two easy ways to change the size: alter height and width in the svg tag, or scale it as a background image in the CSS selector of your choice.

@davebalmer
Copy link

Kent Brewster you're my hero.

@kentbrew
Copy link
Author

Minor but important update for Firefox: it wants that leading zero in dur="0.6s"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment