JSFiddle - React, Tailwind, and code Playground

by lollero

HTML

<div class="site-border-top"></div>
<div class="site-border-right"></div>
<div class="site-border-bottom"></div>
<div class="site-border-left"></div>

<div id="progress-wrap">
  <div class="progress-bar">
    <div class="highlight"></div>
  </div>
  <div class="sections">
    <div class="section"><span></span></div>
    <div class="section"><span></span></div>
    <div class="section"><span></span></div>
    <div class="section"><span></span></div>
    <div class="section"><span></span></div>
    <div class="section"><span></span></div>
    <div class="section"><span></span></div>
    <div class="section"><span></span></div>
    <div class="section"><span></span></div>
    <div class="section"><span></span></div>
  </div>
</div>

<div id="progress-info">
  <span class="current">10</span> /
  <span class="max">600</span>
</div>

SCSS

html, body { height: 100%; min-height: 100%; margin: 0px; overflow: hidden; }

#progress-wrap {
  cursor: pointer;
  border: 1px solid #000;
  border-top-width: 0px;
  border-right-width: 60px;
  border-bottom-width: 50px;
  border-left-width: 10px;
  position: fixed;
  z-index: 99999991;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  background: #e1e1e1;
  border-top: 1px solid #000;
  border-bottom: 3px solid #000;
}

.progress-bar {
  position: relative;
  z-index: 1;
  background: #d29810;
  height: 100%;
  width: 0px;
  -webkit-transition: width .2s ease-out;
  transition: width .2s ease-out;
}

.sections {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.section {
  width: 10%;
  outline-top: none;
  outline-bottom: none;
  float: left;
  margin-left: 0;
  height: 100%;
}

.section span {
  display: block;
  width: 100%;
  height: 100%;
  border-right: 1px solid rgba(0,0,0, .3);
  border-top: none;
  border-bottom: none;
}

.highlight {
  width: 4px;
  height: 100%;
  float: right;
  background: -moz-linear-gradient(left, rgba(255,253,224,0) 0%, rgba(255,253,224,1) 100%);
  background: -webkit-linear-gradient(left, rgba(255,253,224,0) 0%,rgba(255,253,224,1) 100%);
  background: linear-gradient(to right, rgba(255,253,224,0) 0%,rgba(255,253,224,1) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00fffde0', endColorstr='#fffde0',GradientType=1 );
  -webkit-transition: all .08s ease-out;
  transition: all .08s ease-out;
  box-shadow: 1px 0 6px #ffc90a;
}

#progress-wrap.item-added .highlight {
  width: 9px;
  box-shadow: 3px 0 14px 2px #ffe963, 3px 0 27px 3px #d28c12;
}

.progress-bar.full {
  animation: changeColor ease;
  animation-iteration-count: 3;
  animation-duration: 0.3s;
}

@keyframes changeColor {
  0% {
    background-color: #d29810;
  }

  50% {
    background-color: #f8c54a;
  }

  100% {
    background-color: #d29810;
  }
}

#progress-info {
  position: fixed;
  z-index:...

JavaScript

var inventory_slots = 600;
var current_progress = 200;

var progressBar = $('.progress-bar');

function changeInProgress() {

  var percentage = (current_progress / inventory_slots) * 100;

  progressBar.css({
    width: percentage + "%"
  });

}


changeInProgress();

var progressWrap = $('#progress-wrap');
$(document).on("click", function(){
	progressWrap.addClass('item-added');
  
  current_progress += 1;
  changeInProgress();

  if ( current_progress === inventory_slots ) {
    progressBar.addClass('full');
  }
  else {
    progressBar.removeClass('full');
  }
  
  setTimeout(function() {
  	progressWrap.removeClass('item-added');
  }, 100);
  
});