// Bundled to f/js/app.js by esbuild (see the Justfile). Importing htmx here
// registers it globally and processes hx-* attributes on load, which is what
// powers hx-boost navigation and the partial updates (ranks, plans, lookups).
// The SSE extension drives live outing updates (see templates/outings/).
import "./htmx-global.js";
import "htmx-ext-sse";
import { installMaps } from "./map.js";
installMaps();
// Small toast helper available as window.toast(msg, {kind}) for ad-hoc use.
window.toast = (msg, opts = {}) => {
let host = document.getElementById("toast-host");
if (!host) {
host = document.createElement("div");
host.id = "toast-host";
host.className = "toast toast-end z-50";
document.body.appendChild(host);
}
const alert = document.createElement("div");
alert.className = `alert alert-${opts.kind || "info"} shadow-lg`;
const span = document.createElement("span");
span.textContent = msg;
alert.appendChild(span);
host.appendChild(alert);
const ttl = opts.ttl ?? 4000;
if (ttl > 0) setTimeout(() => alert.remove(), ttl);
return alert;
};
neiam
/fieri-forever
the flavortown lunch engine
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
1.1 KiB · text
History
7a00c02