JSFiddle - React, Tailwind, and code Playground

by viktorb

HTML

<script src="https://raw.github.com/visionmedia/move.js/master/move.js"></script>
MoveJS library
<button id="btn" type="button">Ýttu!</button>
<div id="board">
    <div class="card"></div>
</div>

CSS

#board {
    position: relative;   
    width: 450px;
    height: 200px;
    background: green;
}

.card {
    height: 55px;
    width: 45px;
    border: 1px solid black;
    background: url('http://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/Poker-sm-212-Ks.png/428px-Poker-sm-212-Ks.png');
    background-size: 50px 55px;
    background-repeat: no-repeat;
}

JavaScript

$("#btn").click(function () {
    move('.card').translate(300, 80).end();

    setTimeout(function(){
      move('.card').x(0).end();
    }, 1200);    
});