feat: Añadir botón flotante para seleccionar servidor en dispositivos táctiles
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
<div class="md:hidden text-center mt-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>
|
<button id="openMobileGuildList" class="px-4 py-2 rounded-md bg-slate-700 text-white">Seleccionar servidor</button>
|
||||||
</div>
|
</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="w-full max-w-lg">
|
||||||
<div class="mx-auto backdrop-blur-md bg-white/6 rounded-xl p-6 shadow-xl glass-card">
|
<div class="mx-auto backdrop-blur-md bg-white/6 rounded-xl p-6 shadow-xl glass-card">
|
||||||
|
|||||||
@@ -165,6 +165,15 @@
|
|||||||
mobileGuildModal.classList.remove('hidden');
|
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>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user