--- /dev/null
+# Navigation & UI
+articles: "Articoli"
+about: "Chi Sono"
+here: "Contatti"
+legal: "Privacy"
+language: "Lingua"
+toggleTheme: "Tema"
+toggleMenu: "Menu"
+closeMenu: "Chiudi"
+email: "Email"
+contact: "Contatti"
+links: "Link"
+allRightsReserved: "Tutti i diritti riservati."
+
+# Articles
+readMore: "Leggi di più"
+published: "Pubblicato"
+updated: "Aggiornato"
+readingTime: "tempo di lettura"
+min: "min"
+author: "Autore"
+category: "Categoria"
+tags: "Tag"
+relatedPosts: "Articoli correlati"
+noRelated: "Nessun articolo correlato."
+
+# Article types
+life: "Vita"
+photo: "Foto"
+link: "Link"
+quote: "Citazione"
+tech: "Tech"
+
+# Sharing
+share: "Condividi"
+shareOn: "Condividi su"
+copyLink: "Copia link"
+twitter: "Twitter"
+facebook: "Facebook"
+
+# Forms
+name: "Nome"
+message: "Messaggio"
+submit: "Invia"
+sending: "Invio in corso..."
+success: "Messaggio inviato con successo!"
+error: "Si è verificato un errore. Riprova."
+
+# Social
+follow: "Seguimi"
+contactMe: "Contattami"
document.addEventListener('DOMContentLoaded', () => {
- // Get the menu toggle button and overlay
const menuToggle = document.getElementById('menu-toggle');
const menuOverlay = document.getElementById('menu-overlay');
+ const menuPanel = document.getElementById('menu-panel');
- /**
- * Toggle menu visibility and state
- */
function toggleMenu() {
- const overlay = document.getElementById('menu-overlay');
- const menuPanel = document.querySelector('[x-ref="menuPanel"]');
-
- if (!overlay || !menuPanel) return;
+ if (!menuOverlay || !menuPanel) return;
// Toggle overlay visibility classes
- overlay.classList.toggle('opacity-0');
- overlay.classList.toggle('invisible');
+ menuOverlay.classList.toggle('opacity-0');
+ menuOverlay.classList.toggle('invisible');
// Toggle menu panel translation
menuPanel.classList.toggle('translate-x-full');
// Control body overflow
- const isMenuOpen = !overlay.classList.contains('opacity-0');
+ const isMenuOpen = !menuOverlay.classList.contains('opacity-0');
document.body.style.overflow = isMenuOpen ? 'hidden' : '';
}
+ function closeMenu() {
+ if (!menuOverlay || menuOverlay.classList.contains('opacity-0')) return;
+ toggleMenu();
+ }
+
// Toggle menu when clicking the hamburger button
if (menuToggle) {
menuToggle.addEventListener('click', toggleMenu);
}
- // Close menu when clicking on the overlay (but not the panel itself)
+ // Close menu when clicking on the overlay
if (menuOverlay) {
menuOverlay.addEventListener('click', (e) => {
- // Only close if clicking the overlay itself, not the menu panel
if (e.target === menuOverlay) {
- toggleMenu();
+ closeMenu();
}
});
}
+ // Close menu when clicking menu items
+ const menuLinks = document.querySelectorAll('#menu-panel a, #menu-panel button');
+ menuLinks.forEach(link => {
+ link.addEventListener('click', closeMenu);
+ });
+
// Close menu on Escape key
document.addEventListener('keydown', (e) => {
- if (e.key === 'Escape') {
- const overlay = document.getElementById('menu-overlay');
- if (overlay && !overlay.classList.contains('opacity-0')) {
- toggleMenu();
- }
+ if (e.key === 'Escape' && menuOverlay && !menuOverlay.classList.contains('opacity-0')) {
+ closeMenu();
}
});
});