mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-04-27 03:53:10 -04:00
18 lines
439 B
JavaScript
18 lines
439 B
JavaScript
// Modal management
|
|
|
|
export function openModal(id) {
|
|
document.getElementById(id).classList.add('active');
|
|
}
|
|
|
|
export function closeModal(id) {
|
|
document.getElementById(id).classList.remove('active');
|
|
}
|
|
|
|
export function setupModalBackdropClose() {
|
|
document.querySelectorAll('.modal').forEach(modal => {
|
|
modal.addEventListener('click', e => {
|
|
if (e.target === modal) closeModal(modal.id);
|
|
});
|
|
});
|
|
}
|