<section class="wrapper">
<img class="kick" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/234228/kick.png" alt="kick" />
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/234228/ball.png" alt="ball" class="ball" />
</section>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
width: 100%;
height: 100vh;
overflow-x: hidden;
}
img {
max-width: 100%;
height: auto;
}
.wrapper {
height: 100%;
width: 100vh;
margin: 0 auto;
padding: 0;
overflow: hidden;
position: relative;
color: #444;
}
.kick {
position: absolute;
top: 150px;
left: 10%;
width: 100%;
animation: kick .5s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.ball {
height: 120px;
width: 120px;
position: absolute;
top: 100px;
left: 5%;
animation: ball 1s .7s forwards cubic-bezier(.1, .93, 1, -0.75);
}
@keyframes kick {
100% {
transform: scale(1.2);
}
}
@keyframes ball {
0% {
transform: scale(1) translateX(0px);
animation-timing-function: ease-in;
}
75%,
90%,
95%,
100% {
transform: scale(1.5) translateX(300px);
}
80% {
transform: scale(1.5) translateX(240px);
}
}
@media (min-width: 700px) {
.wrapper {
max-width: 600px;
border: 2px solid black;
border-radius: 20px;
}
.kick {
width: 80%;
}
.ball {
width: 200px;
height: 200px;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.