Ports inventory management and SCA-style cupping scoring from hope_roaster: lot tracking with audit-logged consumption, cupping sessions with server-authoritative scoring and a live radar chart, and links from the planner (draw-from-lot, open-cupping-session). Also fixes the Blend/Single-origin toggle layout, replaces tooltips with an in-context "why" teaching layer, and stages the planner UI into pre-roast vs. post-roast phases.
19 lines
467 B
JavaScript
19 lines
467 B
JavaScript
function stack() {
|
|
let el = document.querySelector(".toast-stack");
|
|
if (!el) {
|
|
el = document.createElement("div");
|
|
el.className = "toast-stack";
|
|
el.setAttribute("aria-live", "polite");
|
|
document.body.append(el);
|
|
}
|
|
return el;
|
|
}
|
|
|
|
export function showToast(text, type = "") {
|
|
const toast = document.createElement("div");
|
|
toast.className = `toast ${type}`.trim();
|
|
toast.textContent = text;
|
|
stack().append(toast);
|
|
setTimeout(() => toast.remove(), 4500);
|
|
}
|