Download Files Button with Progress Bar in HTML CSS and JavaScript

  

https://youtu.be/2HwYyK07ELs

Hi, I will provide a free code for all of you on my YouTube channel, in learning Download Files Button with Progress Bar in HTML CSS and JavaScript. The learning is very easy, simple and easy to understand for beginners, good luck, good luck, my advice is don't forget to keep learning and repeat until you can, happy coding. have a nice day friend.

this is my post for the previous one, you just have to learn it properly, and I will provide the latest updates about teaching web design quickly and easily

the best way is to always learn and practice directly, don't get hung up on confusing code, if you enter the wrong code, don't panic

This is the code HTML and CSS you need learn :

1. Code HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,
    initial-scale=1.0">
    <title>Download Progress</title>
    <link href='https://unpkg.com/boxicons@2.0.7/
    css/boxicons.min.css'
    rel='stylesheet'>
    <link rel="stylesheet" href="style.css">
<body>
  <h2 class="heading">Download Files</h2>
  <div class="btn">
      <div class="content">
        <span class="btn-text">Click Here</span>
        <i class="bx bxs-download"></i>
      </div>
  </div>

  <script src="script.js"></script>
</body>
</html>

2. Code CSS

*{
  margin: 0; padding: 0;
  box-sizing: border-box;
  font-family: 'montserrat';
 
}
body {
    background: #D2DAFF;
}
.heading {
    text-align: center;
    margin-top: 270px;
    color: #FF7777;
}
.btn{
  height: 55px;
  width: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #400D51;
  box-shadow: 0 5px 10px rgba(0,0,0,0.2);
  transition: all 0.4s cubic-bezier(0.68,
                -0.55, 0.265, 1.55);
  overflow: hidden;
  cursor: pointer;
  position: absolute;
}
.btn.active{
  height: 10px;
  width: 300px;
}
.btn::before{
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  height: 100%;
  width: 100%;
  background: #FF7777;
  transition: all 4s ease-in-out;
}

.btn .content{
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  display: flex;
  transition: all 0.2s ease;
  transition-delay: 0.2s;
}
.btn.active .content{
  transform: translateY(60px);
}
.btn .content i,
.btn .content .btn-text{
  color: #fff;
  font-size: 25px;
}
.btn .content .btn-text{
  font-size: 20px;
  margin-right: 15px;
}

.btn.active::before{
    animation: layer 4s ease-in-out forwards;
  }
  @keyframes layer {
    100%{
      left: 0%;
    }
  }

3. Code Javascript

let btn = document.querySelector(".btn");

btn.addEventListener("click", () =>{
    btn.classList.add("active");
  setTimeout(()=>{
    btn.classList.remove("active");
    btn.querySelector("i").classList.replace("bxs-download",
    "Done")
    btn.querySelector("span").innerText = "Success";
  },4000);
});

For more details, you can see the link YouTube below :


https://youtu.be/2HwYyK07ELs

Support my channel. Comment, like and subscribe, success for all of us, happy world hereafter. Amin, Good Luck. 😀


Postingan terkait:

Belum ada tanggapan untuk "Download Files Button with Progress Bar in HTML CSS and JavaScript"

Post a Comment