Skip to content

Instantly share code, notes, and snippets.

@joelpittet
Last active August 29, 2015 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save joelpittet/c75ff7c2f86282ff9499 to your computer and use it in GitHub Desktop.
Save joelpittet/c75ff7c2f86282ff9499 to your computer and use it in GitHub Desktop.
Throbber replacement
// Animated throbber
html.js .form-autocomplete {
background-image: image-url('svg/throbber-inactive.svg');
background-position: 95% center;
background-position: -webkit-calc(100% - 5px) center;
background-position: calc(100% - 5px) center;
background-repeat: no-repeat;
}
html.js .throbbing {
background-image: image-url('svg/throbber.svg');
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joelpittet
Copy link
Author

If you want to change the colors just change the fill attributes in the SVGs, cheers.

@jameswilson
Copy link

I've forked to allow both inactive and active throbber scale to larger sizes more easily, either in CSS using background-size, or by simply changing the hardcoded width and height attributes currently set to 16x16 inside the <svg> tag without having to actually adjust the SVG paths in an SVG editor. I did this by setting the viewBox in the inactive throbber to match that of the active throbber at a resolution of 300 by 300. I've also updated the inactive throbber to use a circle with transparent fill and a gray stroke to create the donut shape, instead of using paths, which shaved quite a few bytes off the filesize.

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