{
  "id": "top-loading-bar",
  "name": "Top Loading Bar",
  "category": "loaders",
  "tags": [
    "page load",
    "nprogress",
    "youtube",
    "fixed",
    "route change",
    "glow"
  ],
  "description": "A thin glowing bar pinned to the top of the page that eases toward the end while a page loads.",
  "url": "https://copy-css.com/snippets/top-loading-bar",
  "markdown": "https://copy-css.com/snippets/top-loading-bar.md",
  "html": "<div class=\"top-loading-bar\" role=\"progressbar\" aria-label=\"Loading page\"></div>",
  "css": ".top-loading-bar {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 1000;\n  width: 0;\n  height: 3px;\n  border-radius: 0 3px 3px 0;\n  background: #2563eb;\n  box-shadow: 0 0 8px #2563eb, 0 0 2px #2563eb;\n  /* Fast at first, then slows to a crawl near the end. Remove the element when the load finishes. */\n  animation: top-loading-bar-grow 8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;\n}\n\n@keyframes top-loading-bar-grow {\n  0% { width: 0; }\n  20% { width: 45%; }\n  100% { width: 92%; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .top-loading-bar { animation: none; width: 60%; }\n}",
  "features": [
    "keyframe animations",
    "box shadows",
    "reduced-motion support"
  ],
  "customProperties": []
}
