Skip to content

Instantly share code, notes, and snippets.

@adamghill
Created August 21, 2020 15:38
Show Gist options
  • Save adamghill/158029d30b9cf03ed116a2124e6dac5e to your computer and use it in GitHub Desktop.
Save adamghill/158029d30b9cf03ed116a2124e6dac5e to your computer and use it in GitHub Desktop.
Beating heart animation
<!--
From https://ackee.electerious.com/
-->
<style>
.heart {
width: 16px;
height: 16px;
fill: #73fac8;
margin: 0 4px -1px;
-webkit-animation: heart 1s linear infinite;
animation: heart 1s linear infinite;
}
@-webkit-keyframes heart {
0% {
transform:scale(1)
}
14% {
transform:scale(1.2)
}
28% {
transform:scale(1)
}
42% {
transform:scale(1.2)
}
70% {
transform:scale(1)
}
}
@keyframes heart {
0% {
transform:scale(1)
}
14% {
transform:scale(1.2)
}
28% {
transform:scale(1)
}
42% {
transform:scale(1.2)
}
70% {
transform:scale(1)
}
}
</style>
<svg class="heart">
<use xlink:href="#heart">
<symbol id="heart" viewBox="0 0 20 18">
<g transform="translate(-2 -3)">
<path d="m13.35 20.13c-.76.69-1.93.69-2.69-.01l-.11-.1c-5.25-4.75-8.68-7.86-8.55-11.74.06-1.7.93-3.33 2.34-4.29 2.64-1.8 5.9-.96 7.66 1.1 1.76-2.06 5.02-2.91 7.66-1.1 1.41.96 2.28 2.59 2.34 4.29.14 3.88-3.3 6.99-8.55 11.76z"></path>
</g>
</symbol>
</use>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment