Goondex/internal/web/static/css/gx/GX_Toast.js
Stu Leak 16fb407a3c v0.1.0-dev4: Add web frontend with UI component library
- Implement full web interface with Go html/template server
- Add GX component library (buttons, dialogs, tables, forms, etc.)
- Create scene/performer/studio/movie detail and listing pages
- Add Adult Empire scraper for additional metadata sources
- Implement movie support with database schema
- Add import and sync services for data management
- Include comprehensive API and frontend documentation
- Add custom color scheme and responsive layout

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 10:47:30 -05:00

29 lines
903 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script>
function gxToast(message, type = "info", duration = 3500) {
const root = document.getElementById("gx-toast-root");
if (!root) return console.error("gx-toast-root not found!");
// Create toast element
const el = document.createElement("div");
el.className = `gx-toast ${type}`;
el.innerHTML = `
<div class="gx-toast-msg">${message}</div>
<span class="gx-toast-close" onclick="this.parentElement.remove()">×</span>
`;
root.appendChild(el);
// Auto-dismiss
setTimeout(() => {
el.classList.add("hide");
setTimeout(() => el.remove(), 280);
}, duration);
}
/* Optional convenience wrappers */
function toastSuccess(msg) { gxToast(msg, "success"); }
function toastInfo(msg) { gxToast(msg, "info"); }
function toastWarn(msg) { gxToast(msg, "warn"); }
function toastError(msg) { gxToast(msg, "error"); }
</script>