JSFiddle - React, Tailwind, and code Playground

HTML

<div class="icons">abcd</div>
<div class="icons">abcd</div>
<div class="icons">abcd</div>

CSS

.icons {
    position:relative;
    height: 100px;
    width: 100px;
    float:left;
    text-align:center;
    margin-bottom:2px;
    margin-right:2px;
    border:2px solid black;
}

JavaScript

$(document).ready(function () {
        $(".icons").click(function () {
             var icon_position = $(this).offset();
            $(this).animate({
                left: (window.innerWidth / 2) - 50,
                top: (window.innerHeight / 2) - 50
            }, 1200, function () {
                $('.icons:not([style]):first-child').css('marginLeft',-100);
            });
        });
    });