. Animated Download Button with Progress Bar | Free HTML CSS JS Project 2026 - Coodeverse

Animated Download

Windows Tip: After downloading the ZIP, right-click the folder → Properties → check "Unblock" (if visible) → Apply → OK. This removes the "file came from another computer" warning so everything works perfectly!
HTML
CSS
JavaScript
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width,initial-scale=1" />
  <title>Animated Download Button</title>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
</head>
<body>
  <div class="card" role="region" aria-label="Download demo">
    <h1>Animated Download Button</h1>
    <p>Click the button to simulate a download with progress, finish state, and a lively gradient animation.</p>

    <div class="download-wrap">
      <button id="downloadBtn" class="btn" aria-live="polite">
        <svg class="icon" viewBox="0 0 24 24" fill="none" aria-hidden="true">
          <path d="M12 3v12" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
          <path d="M8.5 10.5L12 14l3.5-3.5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
          <path d="M21 21H3" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" opacity="0.9"/>
        </svg>
        <span class="label">Download</span>
        <svg class="check" viewBox="0 0 24 24" fill="none" aria-hidden="true">
          <path d="M20 6L9 17l-5-5" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
        </svg>
        <span class="shine"></span>
        <span class="bar" aria-hidden="true"></span>
      </button>

      <div style="flex:1;display:flex;flex-direction:column">
        <div style="display:flex;align-items:center;justify-content:flex-end;gap:8px">
          <div id="percent" style="font-size:13px;color:var(--muted);min-width:40px;text-align:right">0%</div>
        </div>
        <div class="note">File: <strong>demo-file.txt</strong> — 14 KB</div>
      </div>
    </div>
  </div>
</body>
</html>