Skip to content

Instantly share code, notes, and snippets.

@jmakeig
Created December 29, 2021 20:56
Show Gist options
  • Save jmakeig/9148dd20316468a0522fdc5b1b5bdfab to your computer and use it in GitHub Desktop.
Save jmakeig/9148dd20316468a0522fdc5b1b5bdfab to your computer and use it in GitHub Desktop.
Timer CSS animation
svg {
display: inline-block;
height: 90px;
width: 90px;
}
svg.timer {
transform: rotate(-90deg);
overflow: visible;
}
circle.gague {
animation: delay-progress 5000ms both linear;
}
@keyframes delay-progress {
from {
stroke-dashoffset: 0;
}
to {
stroke-dashoffset: 1;
}
}
<div class="container">
<svg class="timer">
<circle
class="gague"
cx="45"
cy="45"
r="45"
stroke-dasharray="1"
pathLength="1"
stroke="green"
stroke-width="20"
fill="transparent"
/>
</svg>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment