refactor: redistribute main.ts logic into Astro components

This commit is contained in:
2026-05-03 21:02:25 +02:00
parent ad2a07a88e
commit e588042876
27 changed files with 1175 additions and 69 deletions

View File

@@ -8,3 +8,19 @@
</div>
</div>
</div>
<script>
const overlay = document.getElementById("snack-prompt-overlay");
const btnYes = document.getElementById("btn-yes-snacks");
const btnNo = document.getElementById("btn-no-cart");
btnYes?.addEventListener("click", () => {
overlay?.classList.add("hidden");
window.location.href = "/snacks";
});
btnNo?.addEventListener("click", () => {
overlay?.classList.add("hidden");
window.location.href = "/cart";
});
</script>