I have 2 div
tags that I turned into blocks. I made some code that when run, makes the 2 blocks swoop out to the side. My problem is, they then swoop back into their original position. I want the 2 blocks you see in the animation below, to swoop out to the sides, but then not return to the center.
:)
.dark1 {
background-color: black;
height: 100vh;
position: absolute;
left: 0px;
top: 0px;
width: 50%;
animation: example1 5s;
}
.dark2 {
background-color: red;
height: 100vh;
position: absolute;
top: 0px;
right: 0px;
width: 50%;
animation: example 5s;
}
@keyframes example {
50% {
right: -500px;
top: 0px;
}
}
@keyframes example1 {
50% {
left: -500px;
top: 0px;
}
}
<!DOCTYPE html>
<html>
<body>
<div class="dark1"></div>
<div class="dark2"></div>
</body>
</html>