Skip to content

Instantly share code, notes, and snippets.

@patsbin
Last active January 30, 2019 07:10
Show Gist options
  • Select an option

  • Save patsbin/cacb3199e5331c1e8a2e61468ef4e86b to your computer and use it in GitHub Desktop.

Select an option

Save patsbin/cacb3199e5331c1e8a2e61468ef4e86b to your computer and use it in GitHub Desktop.
HTML/CSS spinning loader
.loader {
left: 50%;
top: 50%;
position: fixed;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%); }
.loader #spinner {
box-sizing: border-box;
stroke: #673AB7;
stroke-width: 3px;
-webkit-transform-origin: 50%;
transform-origin: 50%;
-webkit-animation: line 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite, rotate 1.6s linear infinite;
animation: line 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite, rotate 1.6s linear infinite; }
<div class="loader">
<svg viewBox="0 0 32 32" width="32" height="32">
<circle id="spinner" cx="16" cy="16" r="14" fill="none"></circle>
</svg>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment