Skip to content

Instantly share code, notes, and snippets.

@rleaf
Created December 6, 2018 18:21
Show Gist options
  • Save rleaf/da5cd05f42c475d180c47549a1380765 to your computer and use it in GitHub Desktop.
Save rleaf/da5cd05f42c475d180c47549a1380765 to your computer and use it in GitHub Desktop.
Animated SVG Check Mark
<div class="wrapper">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 98.5 98.5" enable-background="new 0 0 98.5 98.5" xml:space="preserve">
<path class="checkmark" fill="none" stroke-width="8" stroke-miterlimit="10" d="M81.7,17.8C73.5,9.3,62,4,49.2,4
C24.3,4,4,24.3,4,49.2s20.3,45.2,45.2,45.2s45.2-20.3,45.2-45.2c0-8.6-2.4-16.6-6.5-23.4l0,0L45.6,68.2L24.7,47.3"/>
</svg>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
.wrapper {
width: 100px;
margin: 4em auto 0;
}
.checkmark {
stroke: green;
stroke-dashoffset: 745.74853515625;
stroke-dasharray: 745.74853515625;
animation: dash 2s ease-out forwards infinite;
}
@keyframes dash {
0% {
stroke-dashoffset: 745.74853515625;
}
100% {
stroke-dashoffset: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment