Skip to content

Instantly share code, notes, and snippets.

@wallacemaxters
Last active November 18, 2024 22:48
Show Gist options
  • Save wallacemaxters/b7758876b7f6c4e7c3298db991d1f13d to your computer and use it in GitHub Desktop.
Save wallacemaxters/b7758876b7f6c4e7c3298db991d1f13d to your computer and use it in GitHub Desktop.
Loading SVG + CSS with Spin
Display the source blob
Display the rendered blob
Raw
<svg
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" height="100" width="100">
<style>
#circle{
animation: spin 1s infinite linear;
transform-origin: 50% 50%;
}
@keyframes spin
{
0%{
transform: rotateZ(0deg);
}
100%{
transform: rotateZ(359deg);
}
}
</style>
<circle cx="50" cy="50" r="40" stroke="url(#gradient)" stroke-width="7" fill="transparent" id='circle' />
<defs>
<linearGradient id="gradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stop-color="#00bc9b" />
<stop offset="50%" stop-color="steelblue" />
<stop offset="100%" stop-color="#049" />
</linearGradient>
</defs>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment