Skip to content

Instantly share code, notes, and snippets.

@zazaulola
Created August 29, 2021 21:30
Show Gist options
  • Save zazaulola/796732c87d20d1e64a5b76b672f79114 to your computer and use it in GitHub Desktop.
Save zazaulola/796732c87d20d1e64a5b76b672f79114 to your computer and use it in GitHub Desktop.
Parcel jump animation
<div id="parcel">📦</div>
<style>
#parcel {
position: absolute;
font-size: 4rem;
animation: jump 1.2s infinite;
}
@keyframes jump {
0% { transform: translate(-50%, -50%) scale(1.25, 0.75); }
50% { transform: translate(-50%, -150%) scale(1, 1); }
55% { transform: translate(-50%, -150%) rotate(15deg); }
60% { transform: translate(-50%, -150%) rotate(-15deg); }
65% { transform: translate(-50%, -150%) rotate(15deg); }
70% { transform: translate(-50%, -150%) rotate(-15deg); }
100% { transform: translate(-50%, -50%) scale(1.25, 0.75); }
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment