*{
box-sizing: border-box;
}
html{
background-color: lighten(black,20%);
h1,h3{
color: white;
}
text-align: center;
}
.btn{
width: 150px;
height: 50px;
background-color: $fRed;
color: white;
border-radius: 30px;
display: flex;
align-items: center;
justify-content: center;
font-family: "Raleway";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
cursor: pointer;
/*border: 2px solid $fWhite;*/
transition: background-color 0.5s;
&:hover{
background-color: $fWhite;
color: $fRed;
}
}
.bar{
width: 200px;
height: 8px;
border-radius: 8px;
background-color: $fBlack;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
display: none;
.p{
width: 0%;
border-radius: 8px;
height: 100%;
background-color: $fRed;
}
}
View Compiled
/*
Download button made by ZeroX
*/
$(".btn").click(function(){ /*When user click the button*/
$("span").fadeOut(); /*Fadeout the download span*/
$(".btn").animate({
width: "50px", /*Animate the width*/
},function(){
$(".btn").animate({
top: "40%",
},function(){
$(".bar").css("display","block");
$(".btn").html('<i class="fa fa-ellipsis-h" aria-hidden="true"></i>');
$(".p").animate({width:"100%"},2000,function(){
$(".btn").html('<i class="fa fa-check" aria-hidden="true"></i>');
$(".bar").fadeOut();
$(".btn").animate({top:"50%"},function(){
$(".btn").animate({width:"150px"},function(){
$(".btn").html("<span>Download</span>");
$(".p").css("width","0%");
})
});
});
})
});
});