Last active
August 25, 2020 16:07
-
-
Save candelatech/4a663db3af4d43ebbe6fded00d290f08 to your computer and use it in GitHub Desktop.
This file contains 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
<!-- this should be on codepen... lets do that instead --> | |
<svg> | |
</svg> | |
<style> | |
#test svg #anim * { | |
transition: stroke-dashoffset 1s ease; | |
stroke-dashoffset: 0!important; | |
} | |
</style> | |
<script> | |
$("#test svg #anim path").each(function(index, line){ | |
pathPrepare(line) | |
}) | |
setTimeout(function(){ | |
$("#test").addClass("active") | |
},100) | |
//for prepping SVGs for animation | |
function pathPrepare (e) { | |
var lineLength = e.getTotalLength(); | |
$(e).css("stroke-dasharray", lineLength); | |
$(e).css("stroke-dashoffset", lineLength); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment