feat: Añadir botón flotante para seleccionar servidor en dispositivos táctiles

This commit is contained in:
Shni
2025-10-15 03:21:52 -05:00
parent 037746e5cb
commit c3f20f99c2
2 changed files with 11 additions and 0 deletions

View File

@@ -16,6 +16,8 @@
<div class="md:hidden text-center mt-8">
<button id="openMobileGuildList" class="px-4 py-2 rounded-md bg-slate-700 text-white">Seleccionar servidor</button>
</div>
<!-- Floating touch CTA for touch devices (visible when no selectedGuild) -->
<button id="floatingTouchGuildBtn" class="hidden" style="position:fixed;right:16px;bottom:18px;z-index:60;padding:10px 14px;border-radius:10px;background:#374151;color:#fff;border:none;">Servers</button>
<div class="w-full max-w-lg">
<div class="mx-auto backdrop-blur-md bg-white/6 rounded-xl p-6 shadow-xl glass-card">

View File

@@ -165,6 +165,15 @@
mobileGuildModal.classList.remove('hidden');
});
}
// floating touch CTA logic
const floatBtn = document.getElementById('floatingTouchGuildBtn');
try {
const isTouch = (navigator.maxTouchPoints && navigator.maxTouchPoints > 0) || ('ontouchstart' in window);
if (floatBtn && isTouch) {
floatBtn.classList.remove('hidden');
floatBtn.addEventListener('click', (e) => { e.preventDefault(); mobileGuildModal?.classList.remove('hidden'); });
}
} catch(e){}
});
</script>