<div class="wrapper">
<div class="item item-1"></div>
<div class="item item-2"></div>
</div>
body {
background-color:#ccc;
}
.wrapper {
background-color: #fff;
padding: 40px;
max-width: 800px;
margin: 40px auto;
}
.item {
width: 50%;
height: 300px;
margin-bottom: 40px;
background-color: limegreen;
}
@keyframes enter-left {
from {
opacity: 0;
transform: translateX(-50%);
}
to {
opacity: 1;
transform: translateX(0%);
}
}
@keyframes enter-right {
from {
opacity: 0;
transform: translateX(50%);
}
to {
opacity: 1;
transform: translateX(0%);
}
}
.item-1 {
animation: enter-left 2s ease-out infinite;
}
.item-2 {
margin-left: 50%;
animation: enter-right 2s ease-out infinite;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.