Skip to content

Instantly share code, notes, and snippets.

@ciases
Created October 13, 2016 14:26
Show Gist options
  • Save ciases/bedb8e71872055836fa1ade9887bbc8a to your computer and use it in GitHub Desktop.
Save ciases/bedb8e71872055836fa1ade9887bbc8a to your computer and use it in GitHub Desktop.
SVG path animation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
.path {
stroke-dasharray: 4400;
stroke-dashoffset: 4400;
animation: dash 3s linear forwards;
}
@keyframes dash {
to {
stroke-dashoffset: 0;
}
}
</style>
</head>
<body>
<svg id="logo" xmlns="http://www.w3.org/2000/svg" width="515.91" height="728.5" viewBox="0 0 515.91 728.5">
<path class="path" fill="none" stroke="red" stroke-width="18" stroke-miterlimit="10" d="M328.38 423.986H145.721v148.022h223.25V392.055H71.305v212.832h367.482V357.688h53.31L258.023 130.379 24.354 355.929h346.782v-31.12h41.538L258.023 170.97 103.777 325.215H328.38"/>
</svg>
<p><a href="https://css-tricks.com/svg-line-animation-works/">How SVG Line Animation Works</a></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment