JSFiddle - React, Tailwind, and code Playground

by jashwant

HTML

<button>Click</button>
<div id="mydiv">Hello World</div>

CSS

#mydiv {  
    position:absolute;
    font-size: 30px;
    font-weight: bold;
    top : 100px;
    height: 40px;
    background-color:red;
    left: -400px; 
    transition: all 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
     -webkit-transition: all 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#mydiv.animated {
    left: 400px;
}

JavaScript

$('button').click(function () {
    $('#mydiv').toggleClass('animated');
});