JSFiddle - React, Tailwind, and code Playground

by runjep

HTML

<script src="https://github.com/daniel-lundin/snabbt.js/releases/download/v0.3.0/snabbt.min.js"></script>
<div class="div" id="div1">element</div>
<div class="div" id="div2">element</div>

CSS

.div{
    border:1px solid;    
    width:60px;
    padding:20px;
    margin-top:20px;
    height:20;
    background-color:red;
}

JavaScript

var element = document.getElementById('div1');
var element2 = document.getElementById('div2');
snabbt(element, {
    position: [130, 50, 0]
});
snabbt(element2, {
    position: [100, 50, 0],
    rotation: [Math.PI*2, 0, 0],
    duration:2000
}).then({
  rotation: [0, 0, 2*Math.PI],
  easing: 'ease'
});