|
|
|
|
@ -75,6 +75,18 @@
|
|
|
|
|
return page.url.pathname === href || page.url.pathname.startsWith(`${href}/`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Si el catálogo ya está abierto, la lupa lleva el foco al campo sin recargar. */
|
|
|
|
|
function buscarEnCatalogo(evento: MouseEvent): void {
|
|
|
|
|
menuAbierto = false;
|
|
|
|
|
if (page.url.pathname !== '/musica') return;
|
|
|
|
|
|
|
|
|
|
const campo = document.querySelector<HTMLInputElement>('#buscar-tema');
|
|
|
|
|
if (!campo) return;
|
|
|
|
|
evento.preventDefault();
|
|
|
|
|
campo.scrollIntoView({ block: 'start', behavior: 'smooth' });
|
|
|
|
|
campo.focus({ preventScroll: true });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const enCarrito = $derived(page.data.cantidadCarrito ?? page.data.carrito?.length ?? 0);
|
|
|
|
|
const usuario = $derived(page.data.usuario);
|
|
|
|
|
|
|
|
|
|
@ -115,6 +127,16 @@
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
<div class="cuenta" class:abierto={menuAbierto}>
|
|
|
|
|
<a
|
|
|
|
|
class="buscar-catalogo"
|
|
|
|
|
href="{resolve('/musica')}#buscar-tema"
|
|
|
|
|
aria-label="Buscar en Música"
|
|
|
|
|
title="Buscar en Música"
|
|
|
|
|
onclick={buscarEnCatalogo}
|
|
|
|
|
>
|
|
|
|
|
<Icono nombre="buscar" tamano={19} />
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<a
|
|
|
|
|
class="jukebox"
|
|
|
|
|
href={resolve('/juke-box')}
|
|
|
|
|
@ -340,6 +362,13 @@
|
|
|
|
|
gap: var(--sp-2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.buscar-catalogo {
|
|
|
|
|
display: inline-grid;
|
|
|
|
|
min-width: 2rem;
|
|
|
|
|
min-height: 2rem;
|
|
|
|
|
place-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.contador {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|