<script
  defer
  src="https://unpkg.com/alpinejs-scroll-amount@latest/dist/scroll-amount.min.js"
></script>

<script defer src="https://unpkg.com/alpinejs@latest/dist/cdn.min.js"></script>

<div
  x-data="{ scrollPos: {} }"
  x-init="scrollPos = $scrollAmount"
  @scroll.window="scrollPos = $scrollAmount"
>
  <div
    x-cloak
    x-show="scrollPos.scrollPercent > 0"
    :style="{ width: `${scrollPos.scrollPercent}%` }"
    class="fixed inset-x-0 top-0 h-1 bg-indigo-600 transition-all"
  ></div>

  <div
    