JSFiddle - React, Tailwind, and code Playground

HTML

<div class="bottom-left"></div><div class="bottom-right"></div>

CSS

div {
    position : absolute;
    left     : 10px;
    width    : 100px;
    height   : 100px;
}
.bottom-left {
    background-color : yellow;
    top              : 10px;
}
.bottom-right {
    background-color : red;
    top              : 120px;
}

JavaScript

$(function () {
    function run_animation($element, delay, duration) {
        $element.delay(delay).fadeToggle(duration, function () {
            run_animation($element, delay, duration);
        });
    }
    run_animation($('.bottom-left'), 1000, 900);
    run_animation($('.bottom-right'), 3000, 700);
});