<div class="background"></div>
    <div class="background background2"></div>
    <div class="background background3"></div>
.background {
    animation: slide 3s ease-in-out infinite alternate;
    background-image : linear-gradient(-50deg, #ff0004 50%, #0065d7 50%);
    bottom: 0;
    left: -50%;
    opacity: .5;
    position: fixed;
    right: -50%;
    top: 0;
    z-index: -1;
}

.background2 {
    animation-direction: alternate-reverse;
    animation-duration: 4s;
}

.background3 {
    animation-duration: 5s;
}

@keyframes slide {
    0% {
        transform: translateX(-25%);
    }
    100% {
        transform: translateX(25%);
    }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.