Skip to content

Instantly share code, notes, and snippets.

@csssecrets
Last active March 15, 2023 07:41
Show Gist options
  • Save csssecrets/1b37089310d0a5a2d8e6 to your computer and use it in GitHub Desktop.
Save csssecrets/1b37089310d0a5a2d8e6 to your computer and use it in GitHub Desktop.
Bouncing animation
/**
* Bouncing animation
*/
@keyframes bounce {
60%, 80%, to {
transform: translateY(400px);
animation-timing-function: ease;
}
70% { transform: translateY(300px); }
90% { transform: translateY(360px); }
}
.ball {
width: 0; height: 0; padding: 1.5em;
border-radius: 50%;
margin: auto;
background: red radial-gradient(at 30% 30%, #fdd, red);
animation: bounce 2s cubic-bezier(.1,.25,1,.25) forwards;
}
body {
background: linear-gradient(skyblue, white 450px, yellowgreen 0);
min-height: 100vh;
}
<div class="ball"></div>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment