JSFiddle - React, Tailwind, and code Playground

by Asim Shariff

HTML

<div id=bottom_status></div>
<div id="text">

</div>

CSS

#bottom_status{
  width:10px;
  height:10px;
  background-color: #000;
}

JavaScript

var progress = 0;
function slideSwitch() {


  var myInterval = setTimeout(slideSwitch,100);
  progress++;
  var calc =  progress * 10;

  if (progress > 100 ) { 
  	clearInterval(myInterval);
  	progress = 0;
  	return;
  }

  $("#bottom_status").width(calc);
  $("#text").text((calc/10)+" %");

}

slideSwitch();