53d2d2ffef
- Implemented admin dashboard with user management features including role assignment and deletion. - Added user profile page for updating email and password. - Created separate routes and templates for text, image, and video generation with appropriate forms. - Enhanced navigation with dropdown for generation options and loading overlay for better user experience. - Introduced comprehensive error handling and user feedback through alerts. - Updated styles for improved UI consistency and responsiveness. Co-authored-by: Copilot <copilot@github.com>
37 lines
1.5 KiB
JavaScript
37 lines
1.5 KiB
JavaScript
document.addEventListener('DOMContentLoaded', () => {
|
|
// ── Loading overlay ────────────────────────────────────
|
|
const overlay = document.getElementById('loading-overlay');
|
|
|
|
document.querySelectorAll('form').forEach((form) => {
|
|
form.addEventListener('submit', () => {
|
|
if (overlay) overlay.classList.add('active');
|
|
});
|
|
});
|
|
|
|
// ── Hamburger menu ─────────────────────────────────────
|
|
const hamburger = document.querySelector('.hamburger');
|
|
const navLinks = document.querySelector('.nav-links');
|
|
|
|
if (hamburger && navLinks) {
|
|
hamburger.addEventListener('click', () => {
|
|
navLinks.classList.toggle('open');
|
|
});
|
|
}
|
|
|
|
// ── Generate dropdown tabs ─────────────────────────────
|
|
document.querySelectorAll('.tab-btn').forEach((btn) => {
|
|
btn.addEventListener('click', () => {
|
|
const target = btn.dataset.tab;
|
|
const container = btn.closest('.tabs-container');
|
|
if (!container) return;
|
|
|
|
container.querySelectorAll('.tab-btn').forEach((b) => b.classList.remove('active'));
|
|
container.querySelectorAll('.tab-panel').forEach((p) => p.classList.remove('active'));
|
|
|
|
btn.classList.add('active');
|
|
const panel = container.querySelector(`#tab-${target}`);
|
|
if (panel) panel.classList.add('active');
|
|
});
|
|
});
|
|
});
|