<div class="load_wrapper">
<div class="topload"></div>
<div class="rightload"></div>
<div class="bottomload"></div>
<div class="leftload"></div>
</div>
*{margin:0;}
.load_wrapper{
width:100%;
height:100%;
position:absolute;
top:0;
}
.topload{
background:#1bc54b;
height:7px;
width:100%;
position:absolute;
top:0;
transition:background .5s ease .1s;
}
.rightload{
background:#1bc54b;
height:100%;
width:7px;
position:absolute;
right:0;
transition:background .5s ease .1s;
}
.bottomload{
background:#1bc54b;
height:7px;
width:100%;
position:absolute;
bottom:0;
right:0;
}
.leftload{
background:#1bc54b;
height:100%;
width:7px;
position:absolute;
left:0;
bottom:0;
}
function edgeBar(amm) {
var width = $( document ).width();
var height = $( document ).height();
var full = (width*2) + (height*2);
var barPercentLeft = (amm/100)*full;
if(amm >= 100){
$('.topload').css('background','#1bc54b');
$('.topload').css('width','100%');
$('.rightload').css('height','100%');
$('.bottomload').css('width','100%');
$('.leftload').css('height','100%');
}else if(barPercentLeft < width){
$('.topload').css('background','#f74848');
$('.rightload').css('height','0%');
$('.bottomload').css('width','0%');
$('.leftload').css('height','0%');
$('.topload').css('width',(barPercentLeft/width)*100+'%');
}else if(barPercentLeft >= width && barPercentLeft < width+height){
$('.topload').css('background','#1bc54b');
$('.topload').css('width','100%');
$('.bottomload').css('width','0%');
$('.leftload').css('height','0%');
$('.rightload').css('height',((barPercentLeft-width)/height)*100+'%');
}else if(barPercentLeft >= width+height && barPercentLeft < width+width+height){
$('.topload').css('background','#1bc54b');
$('.topload').css('width','100%');
$('.leftload').css('height','0%');
$('.rightload').css('height','100%');
$('.bottomload').css('width',((barPercentLeft-(width+height))/width)*100+'%');
}else if(barPercentLeft >= width+width+height && barPercentLeft < width+width+height+height){
$('.topload').css('background','#1bc54b');
$('.topload').css('width','100%');
$('.rightload').css('height','100%');
$('.bottomload').css('width','100%');
$('.leftload').css('height',((barPercentLeft-(width+width+height))/height)*100+'%');
}
}
edgeBar(63);
var percent = 100;
var timer = setInterval(function(){
if(percent <= 0){
clearInterval(timer);
}else{
edgeBar(percent);
percent = percent - 0.06
}
}, 1);
See the Pen Beme style progress bar by karna (@kknmalone) on CodePen.