LuminaWebsite/assets/js/success-popup.js
Maaxxs 828befceb1 Show success flashes as a centered popup with an animated checkmark
Only the "success" flash type moves to the new popup (a self-dismissing
centered overlay with an SVG checkmark that draws itself in, closes
automatically after ~2.8s or on click). Error/other flash types keep
the existing top banner, since those usually carry details worth
reading rather than a quick confirmation. header.php now splits
get_flashes() once into success vs. other so both the logged-in and
guest layouts pick up the same split.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 02:32:23 +02:00

26 lines
650 B
JavaScript

(function () {
'use strict';
var popup = document.getElementById('success-popup');
if (!popup) return;
var AUTO_CLOSE_MS = 2800;
var closeTimer = null;
function close() {
if (closeTimer) clearTimeout(closeTimer);
popup.classList.remove('visible');
popup.classList.add('closing');
setTimeout(function () {
if (popup.parentNode) popup.parentNode.removeChild(popup);
}, 250);
}
popup.addEventListener('click', close);
requestAnimationFrame(function () {
popup.classList.add('visible');
});
closeTimer = setTimeout(close, AUTO_CLOSE_MS);
})();