<div class="ball"></div>
.ball {
border-radius: 50%;
width: 200px;
height: 200px;
border: 2px solid #000;
animation:
colorswap 2s linear infinite alternate,
movement 6s ease-out infinite alternate;
}
@keyframes colorswap {
0% {
background-color: yellow;
}
50% {
background-color: purple;
}
100% {
background-color: pink;
}
}
@keyframes movement {
0% {
transform: translate(0, 0);
}
50% {
transform: translate(-200px, 0);
}
100% {
transform: translate(200px, 0);
}
}
body,
html {
height: 100%;
}
body {
display: flex;
justify-content: center;
margin-top: 50px;
background-color: #D2F8D2;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.