amezing/scripts/deanchor.js
2026-10-23 08:53:07 -04:00

10 lines
300 B
JavaScript

const main = document.querySelector("#main-content");
main.addEventListener("animationend", () => {
const hash = decodeURIComponent(location.hash);
if (
["#↑", "#↓", "#←", "#→", "#up", "#down", "#left", "#right"].includes(hash)
) {
history.replaceState(null, "", " ");
}
});