Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hopearmstrong/30edccde8303ddcbf5225285f75015b8 to your computer and use it in GitHub Desktop.
Save hopearmstrong/30edccde8303ddcbf5225285f75015b8 to your computer and use it in GitHub Desktop.
Beating Heart Animation on Hover
#smiley-love
#smiley
&-blush
display: none
a
display: inline-block
&:hover
#smiley
transform: scale(1.1)
transform-origin: center
-webkit-animation: heartbeat 1.5s ease-in-out infinite both
animation: heartbeat 1.5s ease-in-out infinite both
&-blush
display: inherit
&-eye-left
transform-origin: center
transform: scale(.7) translate(-8px)
&-eye-right
transform-origin: center
transform: scale(.7) translate(8px)
&-mouth
transform: translateY(-22px) scale(1.6)
transform-origin: center
/* ----------------------------------------------
* animation heartbeat
* Generated by Animista on 2019-3-24 18:51:13
* w: http://animista.net, t: @cssanimista
* ---------------------------------------------- */
@-webkit-keyframes heartbeat
from
-webkit-transform: scale(1)
transform: scale(1)
-webkit-transform-origin: center center
transform-origin: center center
-webkit-animation-timing-function: ease-out
animation-timing-function: ease-out
10%
-webkit-transform: scale(0.91)
transform: scale(0.91)
-webkit-animation-timing-function: ease-in
animation-timing-function: ease-in
17%
-webkit-transform: scale(0.98)
transform: scale(0.98)
-webkit-animation-timing-function: ease-out
animation-timing-function: ease-out
33%
-webkit-transform: scale(0.87)
transform: scale(0.87)
-webkit-animation-timing-function: ease-in
animation-timing-function: ease-in
45%
-webkit-transform: scale(1)
transform: scale(1)
-webkit-animation-timing-function: ease-out
animation-timing-function: ease-out
@keyframes heartbeat
from
-webkit-transform: scale(1)
transform: scale(1)
-webkit-transform-origin: center center
transform-origin: center center
-webkit-animation-timing-function: ease-out
animation-timing-function: ease-out
10%
-webkit-transform: scale(0.91)
transform: scale(0.91)
-webkit-animation-timing-function: ease-in
animation-timing-function: ease-in
17%
-webkit-transform: scale(0.98)
transform: scale(0.98)
-webkit-animation-timing-function: ease-out
animation-timing-function: ease-out
33%
-webkit-transform: scale(0.87)
transform: scale(0.87)
-webkit-animation-timing-function: ease-in
animation-timing-function: ease-in
45%
-webkit-transform: scale(1)
transform: scale(1)
-webkit-animation-timing-function: ease-out
animation-timing-function: ease-out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment