JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://eightmedia.github.io/hammer.js/dist/hammer.js"></script>
<script src="http://eightmedia.github.io/hammer.js/dist/jquery.hammer.min.js"></script>
<h3>swipe</h3>
<div id="red" class="colorContainer">
    <div class="color redColor"></div>
</div>

CSS

body {
    overflow:hidden;
    height: 100%;
}
.colorContainer {
    position: relative;
    padding:0 200px;
    width: 100%;
    border: 1px solid;
    margin-top: 25px;
}
.color{
    position: relative;
    left: 100px;
	width:50px;
    height:50px;
	cursor:pointer;
}
#red .color {
    background: red;
}

JavaScript

$(function(){  
    var red = document.getElementById("red");
    
   
    Hammer(red).on("swipeleft", function() {
        $(this).find(".color").animate({left: "-=100"}, 500);
        $("#event").text("swipe left");
    });
    
    Hammer(red).on("swiperight", function() {
        $(this).find(".color").animate({left: "+=100"}, 500);
        $("#event").text("swipe right");
    });
});