JSFiddle - React, Tailwind, and code Playground

by Fokhrul Islam

HTML

<head>
   <meta charset="utf-8">
   <title>JavaScript</title>
    <link rel="stylesheet" href="styles/styles.css">
	<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
	<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
	<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
	<script src="scripts/fma_t5.js"></script>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
	<div id="wrapper">
		<div class="square" id="squareOne"></div>
		<div class="square" id="squareTwo"></div>
	</div>
</body>

CSS

#wrapper {
  width:...;
  margin: 100px auto;
  border:1px solid black;
	 
 }
.square{
	width: 100px;
	height: 100px;
	border: 1px solid black;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	margin: 10% 30px;
}

#squareTwo {
	position:relative;
	float: right;
	
}
#squareOne {
	position:relative;
    background: #fff;
}

JavaScript

$(document).ready(() => {
	$( ".square" ).animate({
          backgroundColor: "red",
	}, 3000 );
	
	
	$("#squareOne").animate({ 
        marginLeft: "+=45%",
      }, 800 );
	  
	$("#squareTwo").animate({ 
        marginRight: "+=45%",
      }, 800 );
});