initial commit

This commit is contained in:
Herculino Trotta
2024-09-26 11:00:40 -03:00
parent 830e821a17
commit 50b0c6ce01
138 changed files with 13566 additions and 46 deletions

View File

@@ -0,0 +1,37 @@
import htmx from "htmx.org";
import _hyperscript from 'hyperscript.org/dist/_hyperscript.min';
_hyperscript.browserInit();
let modalEle = document.getElementById("modal");
if (modalEle) {
const modal = new bootstrap.Modal(modalEle); // eslint-disable-line no-undef
htmx.on("htmx:beforeSwap", (e) => {
// Empty response targeting #dialog => hide the modal
if (e.detail.target.id === "dialog" && !e.detail.xhr.response) {
modal.hide();
e.detail.shouldSwap = false;
}
});
htmx.on("hidden.bs.modal", () => {
document.getElementById("dialog").innerHTML = "";
});
}
let successAudio = new Audio("/static/sounds/success.mp3");
let popAudio = new Audio("/static/sounds/pop.mp3");
htmx.on("paid", () => {
successAudio.pause();
successAudio.currentTime = 0;
successAudio.play();
});
htmx.on("unpaid", () => {
popAudio.pause();
popAudio.currentTime = 0;
popAudio.play();
});