scroll-up.ts

document.addEventListener("DOMContentLoaded", () => {
  const btn = document.querySelector(".scroll-up-button");

  if (!btn) {
    console.warn("Could not find scroll up button");
    return;
  }

  btn.addEventListener("click", () => {
    window.scrollTo({
      top: 0,
      left: 0,
      behavior: "smooth",
    });
  });
});
Revisions
DateHash
2024-04-13
2024-04-12
2024-04-12
2024-03-31
2024-03-31
Navigation
PreviousScrollUp.ts
UpScrollUp