Last active
November 6, 2017 04:04
-
-
Save molcik/0f65d0fe3eb097fbb854de5cd72c9320 to your computer and use it in GitHub Desktop.
Angular 2 material design spinner in .svg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg class="spinner" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" > | |
<style> | |
.spinner { | |
animation: rotator 5s linear infinite; | |
transform-origin: center; | |
} | |
@keyframes rotator { | |
0% { transform: rotate(0deg); } | |
100% { transform: rotate(360deg); } | |
} | |
.path { | |
stroke-dasharray: 265; | |
stroke-dashoffset: 0; | |
transform-origin: center; | |
stroke: #3949ab; | |
animation: dash 1s ease-in-out infinite; | |
} | |
@keyframes dash { | |
0% { stroke-dashoffset: 265; } | |
50% { | |
stroke-dashoffset: 65; | |
transform:rotate(90deg); | |
} | |
100% { | |
stroke-dashoffset: 265; | |
transform:rotate(360deg); | |
} | |
</style> | |
<circle class="path" fill="none" stroke-width="10" stroke-linecap="butt" cx="50" cy="50" r="40"></circle> | |
</svg> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment