feat: Agregar botón de menú móvil y ajustar la posición de los modales en el panel de control

This commit is contained in:
Shni
2025-10-15 02:41:07 -05:00
parent 690a47e41f
commit dd05824d7a

View File

@@ -1,14 +1,16 @@
<header class="w-full p-2 fixed top-0 left-0 right-0 z-30">
<div class="max-w-7xl mx-auto flex items-center justify-between px-3">
<div class="flex items-center gap-4">
<!-- hamburger for mobile to toggle sidebar/drawer -->
<button id="drawerToggle" class="md:hidden inline-flex items-center p-2 rounded-md text-white hover:bg-white/5 focus:outline-none" aria-label="Abrir menú">
<svg class="w-6 h-6" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 6h16M4 12h16M4 18h16" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<!-- small logo + name -->
<a href="/" class="flex items-center gap-2 mr-2">
<div class="w-7 h-7">
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" class="w-full h-full">
<defs><linearGradient id="navg" x1="0" x2="1"><stop offset="0%" stop-color="#06b6d4"/><stop offset="100%" stop-color="#3b82f6"/></linearGradient></defs>
<circle cx="50" cy="50" r="42" fill="url(#navg)"/>
<g transform="translate(50,50)"><path d="M-12,-4 L0,-18 L12,-4 L0,12 Z" fill="#fff"/></g>
</svg>
<img src="/assets/images/logo-amayo.svg" alt="logo" class="mx-auto mb-4 rounded-full" />
</div>
<span class="text-white font-semibold hidden sm:inline"><%= appName %></span>
</a>
@@ -170,6 +172,17 @@
const mobileGuildClose = document.getElementById('mobileGuildClose');
const mobileUserSheet = document.getElementById('mobileUserSheet');
const mobileUserClose = document.getElementById('mobileUserClose');
// ensure modals live under document.body so fixed positioning is relative to viewport
try {
if (mobileGuildModal && mobileGuildModal.parentElement !== document.body) {
document.body.appendChild(mobileGuildModal);
}
if (mobileUserSheet && mobileUserSheet.parentElement !== document.body) {
document.body.appendChild(mobileUserSheet);
}
if (mobileGuildModal) mobileGuildModal.style.position = 'fixed';
if (mobileUserSheet) mobileUserSheet.style.position = 'fixed';
} catch(e){}
function isMobile(){ return window.innerWidth < 768; }
// override mini guild click on mobile
const miniBtn = document.getElementById('miniGuildBtn');