{
  "id": "scroll-progress-bar",
  "name": "Scroll Progress Bar",
  "category": "effects",
  "tags": [
    "scroll-driven",
    "reading progress",
    "animation-timeline",
    "scroll",
    "indicator",
    "blog"
  ],
  "description": "A reading progress bar pinned to the top of the page that fills as you scroll, driven by animation-timeline: scroll().",
  "url": "https://copy-css.com/snippets/scroll-progress-bar",
  "markdown": "https://copy-css.com/snippets/scroll-progress-bar.md",
  "html": "<div class=\"scroll-progress\" aria-hidden=\"true\"></div>",
  "css": ".scroll-progress {\n  position: fixed;\n  top: 0;\n  right: 0;\n  left: 0;\n  z-index: 100;\n  height: 4px;\n  background: linear-gradient(90deg, #6366f1, #ec4899);\n  transform-origin: 0 50%;\n  animation: scroll-progress-grow linear both;\n  animation-timeline: scroll();\n}\n\n@keyframes scroll-progress-grow {\n  from {\n    transform: scaleX(0);\n  }\n\n  to {\n    transform: scaleX(1);\n  }\n}\n\n@supports not (animation-timeline: scroll()) {\n  .scroll-progress {\n    display: none;\n  }\n}",
  "features": [
    "scroll-driven animations",
    "keyframe animations",
    "transforms",
    "linear gradients"
  ],
  "customProperties": []
}
