Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
503d714ea4 | ||
|
|
afd6991519 | ||
|
|
7d27b527e2 | ||
|
|
3ad6951f44 | ||
|
|
0e57bb04d1 | ||
|
|
e631672804 | ||
|
|
ca26c6ebea | ||
|
|
12d3c692d3 | ||
|
|
9c441032de | ||
|
|
603f4b963d | ||
|
|
ac37774245 | ||
|
|
7aa9f40abc | ||
|
|
617a69d58a | ||
|
|
09a8698f7e | ||
|
|
23700c5b1d | ||
|
|
5c173d5f40 | ||
|
|
d0a3554959 | ||
|
|
75dedc4e67 | ||
|
|
801db95aa8 | ||
|
|
6df24abcb9 | ||
|
|
a6291ffe14 | ||
|
|
030bf2712a | ||
|
|
f5ddb63c8a | ||
|
|
d536b0bb8b | ||
|
|
260c7076e2 | ||
|
|
59024cd6e5 | ||
|
|
ebd341c060 | ||
|
|
e7349f34c3 | ||
|
|
c94ad5f651 | ||
|
|
ce929188ac | ||
|
|
98e0d331e9 | ||
|
|
d299fc1201 | ||
|
|
72a2715502 | ||
|
|
1ed06edbdd | ||
|
|
ffcadc5dca | ||
|
|
61c57fbf28 | ||
|
|
a31a0d96b6 | ||
|
|
ba2b290523 | ||
|
|
cf9d642764 | ||
|
|
48ef980910 | ||
|
|
53b65965f3 | ||
|
|
77044130aa | ||
|
|
2b3768bfb4 | ||
|
|
c9e8641bfb | ||
|
|
99ddebcc8d | ||
|
|
d3745c8617 | ||
|
|
b123a5a9c9 | ||
|
|
b5c2c36749 | ||
|
|
f147f4c42c | ||
|
|
d44ef5c35e | ||
|
|
467a99365d | ||
|
|
3c4046926f | ||
|
|
93fbf3ed31 | ||
|
|
635a974a6c |
No files matched your search
@@ -0,0 +1,225 @@
|
||||
# Sesión persistente de Claude Code (tmux en Docker)
|
||||
|
||||
## Problema que resuelve
|
||||
|
||||
Correr Claude Code directo en una shell SSH sobre el NAS lo ata al
|
||||
ciclo de vida de esa conexión: un corte de red, cambiar de laptop a
|
||||
tablet, o cerrar la terminal por accidente mata el proceso y con él
|
||||
todo el contexto de trabajo en curso — no hay forma de "retomar
|
||||
donde quedó" porque el proceso ya no existe.
|
||||
|
||||
**Esto es un problema distinto al de los límites de uso/cuota de
|
||||
Claude Code.** Este setup no aumenta cuota de mensajes ni tokens —
|
||||
eso lo controla el backend de Anthropic sin importar dónde corra el
|
||||
CLI. Lo único que resuelve es que la *sesión de terminal* sobreviva
|
||||
a cortes de red o cambios de dispositivo; si la cuota se agota, sigue
|
||||
agotada exactamente igual dentro de este setup.
|
||||
|
||||
## Por qué Docker y no instalación nativa
|
||||
|
||||
ZimaOS no tiene gestor de paquetes tradicional utilizable para esto:
|
||||
`/` está montado como `squashfs` de solo lectura (imagen del SO
|
||||
inmutable), y `/usr` es un overlay de solo lectura sobre eso —
|
||||
`/usr/local/bin` ni siquiera existe y no se puede crear, tampoco como
|
||||
root (`mkdir` falla con "Read-only file system"). No hay dónde
|
||||
instalar Node.js, npm ni tmux directamente sobre el host.
|
||||
|
||||
Un contenedor Docker sortea esto por completo: tiene su propio
|
||||
filesystem de escritura (overlay2), independiente del `squashfs` del
|
||||
host — ahí es donde `npm install -g` deja el binario de `claude` sin
|
||||
tocar el host en absoluto. Lo único que el contenedor toma del host
|
||||
es lo que se monta explícitamente como volumen.
|
||||
|
||||
## Arquitectura
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
SSH["Cliente SSH<br/>(laptop / tablet / lo que sea)"] -->|docker exec| C["Contenedor tmux-host<br/>--network host, --restart unless-stopped"]
|
||||
C --> T["tmux server<br/>sesión 'lab'"]
|
||||
T --> CC["proceso claude<br/>(Claude Code)"]
|
||||
C -.->|bind mount| DATA["/DATA (host)<br/>repos y configs del lab"]
|
||||
C -.->|bind mount| SOCK["/var/run/docker.sock (host)<br/>control de Docker/k3d"]
|
||||
C -.->|bind mount| HOME["/DATA/AppData/k3d-lab-v3/claude-code-home (host)<br/>-> /root/.claude"]
|
||||
```
|
||||
|
||||
El contenedor sigue vivo aunque la conexión SSH se corte — es el
|
||||
servidor tmux, no la shell del cliente, el que sostiene el proceso de
|
||||
Claude Code. `--restart unless-stopped` además lo revive si el NAS
|
||||
reinicia.
|
||||
|
||||
## Contenedor: `tmux-host`
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name tmux-host \
|
||||
--restart unless-stopped \
|
||||
-v /DATA:/DATA \
|
||||
-v /media/HDD-Storage:/media/HDD-Storage \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /DATA/AppData/k3d-lab-v3/claude-code-home:/root/.claude \
|
||||
-v /DATA/AppData/k3d-lab-v3/claude-code-home.json:/root/.claude.json \
|
||||
--network host \
|
||||
alpine sh -c "apk add --no-cache tmux docker-cli bash curl git kubectl nodejs npm && npm install -g @anthropic-ai/claude-code && git config --global --add safe.directory '*' && tail -f /dev/null"
|
||||
```
|
||||
|
||||
| Volumen | Destino | Por qué |
|
||||
|---|---|---|
|
||||
| `/DATA` | `/DATA` | Acceso a los repos (`apps-registry`, `platform-infra`, `scripts`) y configs del lab, mismos paths que en el host |
|
||||
| `/media/HDD-Storage` | `/media/HDD-Storage` | Ver "Gotcha: el symlink `/DATA/AppData`" abajo — sin esto, los repos no se ven dentro del contenedor pese a montar `/DATA` |
|
||||
| `/var/run/docker.sock` | `/var/run/docker.sock` | Seguir controlando Docker y k3d (contenedores, `k3d node`, etc.) desde dentro del contenedor |
|
||||
| `/DATA/AppData/k3d-lab-v3/claude-code-home` | `/root/.claude` | Persistir login/config de Claude Code — sobrevive no solo a un `docker restart`, sino a recrear el contenedor entero |
|
||||
| `/DATA/AppData/k3d-lab-v3/claude-code-home.json` | `/root/.claude.json` | Ver "Gotcha: la confianza del folder no persistía" abajo — es un archivo suelto, no vive dentro de `~/.claude/` |
|
||||
|
||||
## Gotcha: el symlink `/DATA/AppData`
|
||||
|
||||
Montar `-v /DATA:/DATA` **no alcanza** para ver los repos dentro del
|
||||
contenedor. `/DATA/AppData` en el host es un symlink *absoluto*:
|
||||
|
||||
```
|
||||
/DATA/AppData -> /media/HDD-Storage/AppData
|
||||
```
|
||||
|
||||
Los repos del lab (`lab-cruzcloud`) viven físicamente en el disco
|
||||
btrfs `/media/HDD-Storage`, no en el ext4 de `/DATA` — ZimaOS lo
|
||||
expone dentro de `/DATA` como submount (`/DATA/.media/HDD-Storage/...`,
|
||||
que sí viaja al contenedor porque Docker hace bind recursivo por
|
||||
defecto) pero el path "bonito" `/DATA/AppData/...` que usan `CLAUDE.md`
|
||||
y todos los scripts del lab llega ahí vía ese symlink absoluto, no vía
|
||||
el submount. Un symlink absoluto que apunta fuera del árbol montado
|
||||
queda roto dentro del contenedor aunque el submount subyacente esté
|
||||
perfectamente accesible por otra ruta.
|
||||
|
||||
**Cómo se detectó:** todo el trabajo de configuración inicial de este
|
||||
mismo setup se hizo con `git`/`docker exec` corriendo *en el host*, no
|
||||
dentro del contenedor — nadie había probado `cd
|
||||
/DATA/AppData/k3d-lab-v3/lab-cruzcloud` desde una sesión `lab` real
|
||||
hasta que se preguntó explícitamente por esto. `ls` devolvía "No such
|
||||
file or directory" pese a que el volumen de `/DATA` estaba montado y
|
||||
"andando".
|
||||
|
||||
**Fix:** montar también `-v /media/HDD-Storage:/media/HDD-Storage`,
|
||||
para que el symlink resuelva exactamente igual que en el host.
|
||||
|
||||
## Gotcha: git "dubious ownership" dentro del contenedor
|
||||
|
||||
Con el mount anterior ya arreglado, `git status`/`git log` dentro del
|
||||
contenedor fallan con:
|
||||
|
||||
```
|
||||
fatal: detected dubious ownership in repository at '/media/HDD-Storage/...'
|
||||
```
|
||||
|
||||
Los archivos en `/DATA`/`/media/HDD-Storage` pertenecen al usuario
|
||||
`devops` del host (via samba), pero los procesos dentro del
|
||||
contenedor corren como `root` (UID 0) — git, desde la versión que
|
||||
introdujo la protección CVE-2022-24765, rechaza operar sobre un repo
|
||||
cuyo dueño no coincide con el UID del proceso, a menos que el path
|
||||
esté explícitamente marcado como seguro.
|
||||
|
||||
**Fix:** `git config --global --add safe.directory '*'` dentro del
|
||||
contenedor. El wildcard (en vez de listar cada repo) es intencional
|
||||
acá: este contenedor ya tiene acceso root-equivalente al host vía el
|
||||
volumen de `/var/run/docker.sock`, así que restringir `safe.directory`
|
||||
por repo no suma aislamiento real.
|
||||
|
||||
**Por qué está en el comando de arranque y no como paso manual
|
||||
aparte:** igual que los paquetes `apk`, esta configuración vive en el
|
||||
filesystem efímero del contenedor (`/root/.gitconfig`, que no está
|
||||
bajo el volumen de `/root/.claude`) — se perdería si el contenedor se
|
||||
recrea. Ponerla en el `sh -c` de arranque la deja recreándose sola
|
||||
cada vez, sin pasos manuales que recordar.
|
||||
|
||||
## Gotcha: la confianza del folder no persistía
|
||||
|
||||
Al abrir `claude` por primera vez en un directorio, pide confirmar un
|
||||
diálogo de "¿confiás en este folder?" (más aún acá, porque este repo
|
||||
trae un `.claude/settings.local.json` con permisos pre-aprobados). Esa
|
||||
confirmación se guarda en `~/.claude.json` — un **archivo suelto en
|
||||
`/root`**, no dentro de la carpeta `~/.claude/` que ya estaba montada
|
||||
como volumen. Resultado: aunque el login (`~/.claude/.credentials.json`)
|
||||
sí persistía, el diálogo de confianza volvía a aparecer cada vez que
|
||||
se recreaba el contenedor — justo el tipo de "reconfigurar de nuevo"
|
||||
que este setup existe para evitar.
|
||||
|
||||
**Cómo se detectó:** al confirmar el diálogo por primera vez, se
|
||||
comparó `/root/.claude.json` dentro del contenedor contra sí mismo
|
||||
antes y después — mismo tamaño y mismo `mtime`, es decir, la
|
||||
confirmación en pantalla nunca se había registrado. La causa real:
|
||||
la primera vez se movió el selector con las flechas pero nunca se
|
||||
presionó Enter, así que en rigor el diálogo seguía sin confirmar; una
|
||||
vez confirmado *de verdad* (`tmux send-keys` moviendo el cursor a
|
||||
"Yes, I trust this folder" + Enter), el archivo saltó de 2.2 KB a
|
||||
40 KB y apareció la clave `projects` con la ruta del repo adentro.
|
||||
|
||||
**Fix:** copiar ese `.claude.json` ya confirmado a
|
||||
`/DATA/AppData/k3d-lab-v3/claude-code-home.json` en el host, y
|
||||
montarlo **archivo a archivo** (no como carpeta) en
|
||||
`-v .../claude-code-home.json:/root/.claude.json`. A diferencia de
|
||||
los demás volúmenes de este setup, este necesitó sembrarse con
|
||||
contenido real primero — un bind mount de archivo con un origen que
|
||||
no existe todavía en el host termina creando un directorio vacío en
|
||||
su lugar, no un archivo, y rompe el arranque del contenedor.
|
||||
Verificado en vivo: tras recrear el contenedor con este mount, `claude`
|
||||
arrancó directo en la sesión normal, sin volver a pedir el diálogo de
|
||||
confianza.
|
||||
|
||||
Sobre paquetes: alpine (imagen `alpine` sin pin de versión, la misma
|
||||
que uso este setup) sí trae `kubectl` en sus repos — no hizo falta
|
||||
cambiar de imagen base ni instalarlo por binario aparte, contrario a
|
||||
lo que se sospechaba inicialmente. `nodejs`/`npm` (v24/v11 al momento
|
||||
de escribir esto) también están en los repos de alpine y cumplen de
|
||||
sobra el mínimo que pide Claude Code.
|
||||
|
||||
**Nota sobre `--network host` + `docker.sock`:** el contenedor tiene,
|
||||
en la práctica, control equivalente a root sobre el NAS (puede lanzar
|
||||
cualquier otro contenedor con cualquier mount). Es una concesión
|
||||
deliberada — es exactamente lo que hace falta para seguir operando
|
||||
Docker/k3d desde dentro — no un descuido.
|
||||
|
||||
## Reconexión: un solo comando
|
||||
|
||||
```bash
|
||||
/media/HDD-Storage/AppData/k3d-lab-v3/lab-cruzcloud/scripts/lab-session.sh
|
||||
```
|
||||
|
||||
El script (`scripts/lab-session.sh`) es intencionalmente el mismo
|
||||
comando sin importar el estado previo:
|
||||
|
||||
```bash
|
||||
docker exec -it "$CONTAINER" tmux attach -t "$SESSION" || \
|
||||
docker exec -it "$CONTAINER" tmux new -s "$SESSION"
|
||||
```
|
||||
|
||||
Si la sesión `lab` existe, se adjunta a ella (mismo shell, mismo
|
||||
`claude` corriendo, mismo directorio de trabajo). Si no existe —por
|
||||
ejemplo justo después de que el contenedor se recreó desde cero— la
|
||||
crea. No hay que recordar cuál de los dos casos aplica.
|
||||
|
||||
## Qué sobrevive a qué
|
||||
|
||||
| Evento | ¿Sobrevive la sesión tmux (`lab`)? | ¿Sobrevive el login de Claude Code? |
|
||||
|---|---|---|
|
||||
| Corte de SSH / cerrar la terminal / cambiar de dispositivo | Sí — es exactamente el caso que este setup resuelve | Sí |
|
||||
| `docker restart tmux-host` (reinicio del NAS) | **No** — el proceso `tmux server` muere con el contenedor; `lab-session.sh` crea una sesión nueva automáticamente | Sí, vía el volumen montado en `/root/.claude` |
|
||||
| `docker rm` + recrear el contenedor desde cero | No | Sí, vía el mismo volumen — no hace falta volver a autenticar ni reconfirmar el diálogo de confianza del folder (ver el mount de `claude-code-home.json`) |
|
||||
|
||||
## Validación en vivo
|
||||
|
||||
Confirmado en este mismo lab (2026-08-27): se dejó una variable de
|
||||
entorno (`export MARCA_PERSISTENCIA=ok_<timestamp>`) corriendo dentro
|
||||
de la sesión `lab` vía `tmux send-keys`, y una invocación
|
||||
*completamente separada* de `docker exec` (equivalente a una nueva
|
||||
conexión) leyó de vuelta el mismo valor — confirma que el estado vive
|
||||
en el servidor tmux del contenedor, no en el cliente que se conecta.
|
||||
`claude --version` respondió `2.1.250` dentro de esa misma sesión, y
|
||||
un archivo de prueba escrito en `/root/.claude` dentro del contenedor
|
||||
apareció de inmediato en
|
||||
`/DATA/AppData/k3d-lab-v3/claude-code-home` en el host, confirmando
|
||||
el bind mount de credenciales.
|
||||
|
||||
Después de agregar el mount de `/media/HDD-Storage` y el
|
||||
`safe.directory`, se validó además: `md5sum` de `CLAUDE.md` idéntico
|
||||
leído desde el host y desde dentro del contenedor (vía el path con
|
||||
symlink `/DATA/AppData/...`), y `git log`/`git status` corriendo sin
|
||||
error sobre `apps-registry` y `scripts` desde una shell dentro de
|
||||
`tmux-host`.
|
||||
@@ -85,6 +85,7 @@ nav:
|
||||
- Red y exposición: arquitectura/red-y-exposicion.md
|
||||
- Flujo GitOps: arquitectura/gitops-flujo.md
|
||||
- Agente de monitoreo: arquitectura/agente-monitoreo.md
|
||||
- Sesión tmux persistente: arquitectura/sesion-tmux-persistente.md
|
||||
- Glosario: arquitectura/glosario.md
|
||||
- Decisiones (ADRs):
|
||||
- "0001 · Por qué k3d": decisiones/0001-por-que-k3d.md
|
||||
|
||||
@@ -25,7 +25,7 @@ spec:
|
||||
runAsNonRoot: false
|
||||
containers:
|
||||
- name: app
|
||||
image: gitea.cruzcloud.net/devops/docs-portal:v1.0.179
|
||||
image: gitea.cruzcloud.net/devops/docs-portal:v1.0.188
|
||||
# El base saca TODAS las capabilities. Probado en vivo y
|
||||
# revertido: con drop: ALL (aunque se agregue NET_BIND_SERVICE
|
||||
# de vuelta) el propio entrypoint de nginx:1.27-alpine falla al
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
@theme {
|
||||
/* ADR 0008 ("Navy & Coral") -- reemplaza ADR 0007 (Opcion 2, "Atelier
|
||||
calido"). Ver docs-portal/docs/decisiones/0008-identidad-navy-coral.md */
|
||||
--color-ari-marino: #122844; /* ancla: header, footer, badge "Nuevo", fondo de hero */
|
||||
--color-ari-coral: #D85A30; /* acento unico de accion: CTA, precio destacado */
|
||||
--color-ari-coral-claro: #F0997B; /* acento secundario: subtitulos sobre marino, ala inferior del isotipo */
|
||||
/* ADR 0008 -- paleta final "Azul & Amarillo" (inspirada en Walmart),
|
||||
iteracion sobre "Navy & Coral". Ver
|
||||
docs-portal/docs/decisiones/0008-identidad-navy-coral.md */
|
||||
--color-ari-marino: #0055B8; /* ancla: header, footer, badge "Nuevo", fondo de hero */
|
||||
--color-ari-coral: #0055B8; /* boton de accion (CTA): azul solido, nunca amarillo */
|
||||
--color-ari-coral-claro: #FFC220; /* acento: badges de oferta/descuento/urgencia, detalles del isotipo -- nunca en botones */
|
||||
|
||||
/* Alias de compatibilidad -- ADR 0007 definio estos nombres y hoy los
|
||||
siguen consumiendo catalog-client.tsx, product-card.tsx y button.tsx
|
||||
@@ -33,8 +34,8 @@
|
||||
html { scroll-behavior: smooth; }
|
||||
body { margin: 0; background: #FFFFFF; color: var(--color-slate-900); font-family: var(--font-inter), ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-rendering: optimizeLegibility; }
|
||||
button, a { -webkit-tap-highlight-color: transparent; }
|
||||
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgb(216 90 48 / .5); outline-offset: 3px; }
|
||||
::selection { background: rgb(216 90 48 / .15); color: var(--color-slate-900); }
|
||||
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgb(0 85 184 / .5); outline-offset: 3px; }
|
||||
::selection { background: rgb(0 85 184 / .15); color: var(--color-slate-900); }
|
||||
|
||||
.content-auto {
|
||||
content-visibility: auto;
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<!-- ADR 0008 ("Navy & Coral"). Version reducida del isotipo para favicon/
|
||||
app icon: solo circulo marino + mariposa, sin wordmark (no cabe
|
||||
legible a este tamano). Convencion de Next.js App Router: este
|
||||
archivo se sirve automaticamente como favicon/app icon. -->
|
||||
<!-- ADR 0008, paleta final "Azul & Amarillo" (Walmart-inspirada). Version
|
||||
reducida del isotipo para favicon/app icon: solo circulo azul +
|
||||
mariposa, sin wordmark (no cabe legible a este tamano). Convencion de
|
||||
Next.js App Router: este archivo se sirve automaticamente como
|
||||
favicon/app icon. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34" role="img" aria-label="ARI shopping">
|
||||
<circle cx="17" cy="17" r="17" fill="#122844"/>
|
||||
<circle cx="17" cy="17" r="17" fill="#0055B8"/>
|
||||
<g transform="translate(0 5)">
|
||||
<ellipse cx="10" cy="8" rx="9" ry="7" transform="rotate(-18 10 8)" fill="#D85A30"/>
|
||||
<ellipse cx="24" cy="8" rx="9" ry="7" transform="rotate(18 24 8)" fill="#D85A30"/>
|
||||
<ellipse cx="12" cy="16" rx="6" ry="5" transform="rotate(-10 12 16)" fill="#F0997B"/>
|
||||
<ellipse cx="22" cy="16" rx="6" ry="5" transform="rotate(10 22 16)" fill="#F0997B"/>
|
||||
<rect x="16" y="3" width="2" height="18" rx="1" fill="#122844"/>
|
||||
<ellipse cx="10" cy="8" rx="9" ry="7" transform="rotate(-18 10 8)" fill="#FFC220"/>
|
||||
<ellipse cx="24" cy="8" rx="9" ry="7" transform="rotate(18 24 8)" fill="#FFC220"/>
|
||||
<ellipse cx="12" cy="16" rx="6" ry="5" transform="rotate(-10 12 16)" fill="#FFDD73"/>
|
||||
<ellipse cx="22" cy="16" rx="6" ry="5" transform="rotate(10 22 16)" fill="#FFDD73"/>
|
||||
<rect x="16" y="3" width="2" height="18" rx="1" fill="#0055B8"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 895 B After Width: | Height: | Size: 932 B |
@@ -21,7 +21,7 @@ export const metadata: Metadata = {
|
||||
openGraph: { title: "ARI Shopping", description: "Tesoros para cada aventura.", type: "website", locale: "es_CO" },
|
||||
};
|
||||
|
||||
export const viewport: Viewport = { width: "device-width", initialScale: 1, themeColor: "#122844" };
|
||||
export const viewport: Viewport = { width: "device-width", initialScale: 1, themeColor: "#0055B8" };
|
||||
|
||||
// ADR 0008 ("Navy & Coral"): Poppins peso 700 para los "momentos de marca"
|
||||
// (wordmark, h1/h2, precio, CTA) + Inter para body/UI -- solo se carga el
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Link from "next/link";
|
||||
import { ArrowRight } from "lucide-react";
|
||||
import { CategoryTiles } from "@/components/home/category-tiles";
|
||||
import { HeroBento } from "@/components/home/hero-bento";
|
||||
import { HeroCarousel } from "@/components/home/hero-carousel";
|
||||
import { TrustBar } from "@/components/home/trust-bar";
|
||||
import { ProductCarousel } from "@/components/product/product-carousel";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -17,5 +17,5 @@ export const dynamic = "force-dynamic";
|
||||
export default async function HomePage() {
|
||||
const [products, categories] = await Promise.all([getProducts(), getCategories()]);
|
||||
const treasures = products.filter((product) => product.isNew || product.featured).slice(0, 8);
|
||||
return <><HeroBento /><TrustBar /><div className="content-auto"><CategoryTiles categories={categories} /></div><section className="content-auto mx-auto max-w-7xl px-4 py-14"><div className="mb-8 flex items-end justify-between gap-5"><div><span className="text-xs font-black uppercase tracking-[.18em] text-fuchsia-600">Novedades</span><h2 className="mt-2 text-4xl font-black tracking-tight sm:text-5xl">Tesoros recién llegados</h2><p className="mt-3 text-slate-500">Desliza y encuentra nuevos favoritos.</p></div><Button asChild variant="outline" className="hidden sm:inline-flex"><Link href="/catalog">Ver catálogo <ArrowRight className="size-4" /></Link></Button></div><ProductCarousel products={treasures} /></section><section className="content-auto mx-auto max-w-7xl px-4 pb-20"><div className="grid overflow-hidden rounded-[2rem] bg-gradient-to-r from-cyan-500 via-blue-600 to-violet-600 text-white shadow-2xl lg:grid-cols-[1fr_.7fr]"><div className="p-8 sm:p-12"><span className="text-xs font-black uppercase tracking-[.18em] text-yellow-300">Club ARI</span><h2 className="mt-3 text-4xl font-black tracking-tight sm:text-6xl">Promociones, lanzamientos y mucha diversión.</h2><p className="mt-5 max-w-xl text-white/80">Únete a nuestra comunidad y recibe primero las novedades del catálogo.</p><Button variant="yellow" size="lg" className="mt-7">Quiero unirme</Button></div><div className="min-h-64 bg-[url('/images/promo/promo-backpacks.webp')] bg-cover bg-center" /></div></section></>;
|
||||
return <><HeroCarousel /><TrustBar /><div className="content-auto"><CategoryTiles categories={categories} /></div><section className="content-auto mx-auto max-w-7xl px-4 py-14"><div className="mb-8 flex items-end justify-between gap-5"><div><span className="text-xs font-black uppercase tracking-[.18em] text-fuchsia-600">Novedades</span><h2 className="mt-2 text-4xl font-black tracking-tight sm:text-5xl">Tesoros recién llegados</h2><p className="mt-3 text-slate-500">Desliza y encuentra nuevos favoritos.</p></div><Button asChild variant="outline" className="hidden sm:inline-flex"><Link href="/catalog">Ver catálogo <ArrowRight className="size-4" /></Link></Button></div><ProductCarousel products={treasures} /></section><section className="content-auto mx-auto max-w-7xl px-4 pb-20"><div className="grid overflow-hidden rounded-[2rem] bg-gradient-to-r from-cyan-500 via-blue-600 to-violet-600 text-white shadow-2xl lg:grid-cols-[1fr_.7fr]"><div className="p-8 sm:p-12"><span className="text-xs font-black uppercase tracking-[.18em] text-yellow-300">Club ARI</span><h2 className="mt-3 text-4xl font-black tracking-tight sm:text-6xl">Promociones, lanzamientos y mucha diversión.</h2><p className="mt-5 max-w-xl text-white/80">Únete a nuestra comunidad y recibe primero las novedades del catálogo.</p><Button variant="yellow" size="lg" className="mt-7">Quiero unirme</Button></div><div className="min-h-64 bg-[url('/images/promo/promo-backpacks.webp')] bg-cover bg-center" /></div></section></>;
|
||||
}
|
||||
@@ -33,5 +33,5 @@ export default async function ProductPage({ params }: ProductPageProps) {
|
||||
if (!product) notFound();
|
||||
const products = await getProducts();
|
||||
const recommended = products.filter((candidate) => candidate.id !== product.id && (candidate.category === product.category || candidate.collection === product.collection)).slice(0, 8);
|
||||
return <><section className="mx-auto grid max-w-7xl gap-10 px-4 py-10 lg:grid-cols-[1.08fr_.92fr] lg:py-16"><ProductGallery images={product.images} name={product.name} /><div><span className="text-xs font-black uppercase tracking-[.18em] text-fuchsia-600">{product.category} · {product.collection}</span><h1 className="mt-3 text-4xl font-black tracking-tight sm:text-6xl">{product.name}</h1><p className="mt-5 text-lg leading-8 text-slate-600">{product.description}</p><div className="mt-8"><ProductPurchase product={product} /></div><Accordion type="single" collapsible className="mt-8"><AccordionItem value="details"><AccordionTrigger>Detalles del producto</AccordionTrigger><AccordionContent>Marca: {product.brand}. Edad recomendada: {product.ageRange}. La disponibilidad y presentación final se confirman con Ari Shopping.</AccordionContent></AccordionItem><AccordionItem value="shipping"><AccordionTrigger>Envíos y entregas</AccordionTrigger><AccordionContent>Coordinamos envíos nacionales y entrega según ubicación. Los tiempos se confirman durante la cotización.</AccordionContent></AccordionItem></Accordion></div></section>{recommended.length > 0 && <section className="mx-auto max-w-7xl px-4 pb-24"><h2 className="mb-7 text-3xl font-black">También te puede gustar</h2><ProductCarousel products={recommended} /></section>}<MobileAddToCart product={product} /></>;
|
||||
return <><section className="mx-auto grid max-w-7xl gap-10 px-4 py-10 lg:grid-cols-[1.08fr_.92fr] lg:py-16"><ProductGallery images={product.images} name={product.name} /><div><span className="text-xs font-black uppercase tracking-[.18em] text-ari-coral">{product.category} · {product.collection}</span><h1 className="mt-3 text-4xl font-black tracking-tight sm:text-6xl">{product.name}</h1><p className="mt-5 text-lg leading-8 text-slate-600">{product.description}</p><div className="mt-8"><ProductPurchase product={product} /></div><Accordion type="single" collapsible className="mt-8"><AccordionItem value="details"><AccordionTrigger>Detalles del producto</AccordionTrigger><AccordionContent>Marca: {product.brand}. Edad recomendada: {product.ageRange}. La disponibilidad y presentación final se confirman con Ari Shopping.</AccordionContent></AccordionItem><AccordionItem value="shipping"><AccordionTrigger>Envíos y entregas</AccordionTrigger><AccordionContent>Coordinamos envíos nacionales y entrega según ubicación. Los tiempos se confirman durante la cotización.</AccordionContent></AccordionItem></Accordion></div></section>{recommended.length > 0 && <section className="mx-auto max-w-7xl px-4 pb-24"><h2 className="mb-7 text-3xl font-black">También te puede gustar</h2><ProductCarousel products={recommended} /></section>}<MobileAddToCart product={product} /></>;
|
||||
}
|
||||
@@ -323,18 +323,18 @@ export function CatalogClient({
|
||||
<div className="mb-8">
|
||||
{breadcrumb.length > 0 && (
|
||||
<nav aria-label="Breadcrumb" className="mb-4 flex flex-wrap items-center gap-1.5 text-xs font-bold text-slate-500">
|
||||
<Link href="/catalog" prefetch={false} className="hover:text-ari-ciruela">
|
||||
<Link href="/catalog" prefetch={false} className="hover:text-ari-coral">
|
||||
Inicio
|
||||
</Link>
|
||||
{breadcrumb.map((node, index) => (
|
||||
<span key={node.id} className="flex items-center gap-1.5">
|
||||
<ChevronRight className="size-3" />
|
||||
{index === breadcrumb.length - 1 ? (
|
||||
<span aria-current="page" className="text-ari-carbon">
|
||||
<span aria-current="page" className="text-ari-marino">
|
||||
{node.name}
|
||||
</span>
|
||||
) : (
|
||||
<Link href={`/catalog?category=${encodeURIComponent(node.name)}`} prefetch={false} className="hover:text-ari-ciruela">
|
||||
<Link href={`/catalog?category=${encodeURIComponent(node.name)}`} prefetch={false} className="hover:text-ari-coral">
|
||||
{node.name}
|
||||
</Link>
|
||||
)}
|
||||
@@ -342,23 +342,23 @@ export function CatalogClient({
|
||||
))}
|
||||
</nav>
|
||||
)}
|
||||
<span className="text-xs font-black uppercase tracking-[.18em] text-ari-ciruela">
|
||||
<span className="text-xs font-black uppercase tracking-[.18em] text-ari-coral">
|
||||
Catálogo completo
|
||||
</span>
|
||||
<h1 className="font-display mt-2 text-5xl font-bold tracking-tight text-ari-carbon">Todos los tesoros</h1>
|
||||
<h1 className="font-display mt-2 text-5xl font-bold tracking-tight text-ari-marino">Todos los tesoros</h1>
|
||||
<p className="mt-3 text-slate-500">
|
||||
Filtra por categoría, marca o edad sin recargar la página.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-8 lg:grid-cols-[260px_1fr]">
|
||||
<aside className="h-fit space-y-6 rounded-lg border border-slate-100 bg-white p-6 shadow-lg shadow-ari-carbon-oscuro/5 lg:sticky lg:top-44">
|
||||
<aside className="h-fit space-y-6 rounded-lg border border-slate-100 bg-white p-6 shadow-lg shadow-ari-marino/5 lg:sticky lg:top-44">
|
||||
<div className="flex items-center justify-between">
|
||||
<strong className="flex items-center gap-2 text-lg font-black">
|
||||
<SlidersHorizontal className="size-5 text-ari-cobre" />
|
||||
<SlidersHorizontal className="size-5 text-ari-coral-claro" />
|
||||
Filtros
|
||||
</strong>
|
||||
<button onClick={reset} className="text-xs font-black text-ari-ciruela">
|
||||
<button onClick={reset} className="text-xs font-black text-ari-coral">
|
||||
<X className="mr-1 inline size-3" />
|
||||
Limpiar
|
||||
</button>
|
||||
@@ -392,7 +392,7 @@ export function CatalogClient({
|
||||
step={5000}
|
||||
value={maxPrice}
|
||||
onChange={(event) => setMaxPrice(Number(event.target.value))}
|
||||
className="w-full accent-ari-ciruela"
|
||||
className="w-full accent-ari-coral"
|
||||
/>
|
||||
<p className="mt-2 text-xs font-bold text-slate-500">
|
||||
Hasta ${maxPrice.toLocaleString("es-CO")}
|
||||
@@ -470,8 +470,8 @@ function Filter({
|
||||
onClick={() => onChange(value)}
|
||||
className={`rounded-md px-3 py-2 text-xs font-bold transition ${
|
||||
selected === value
|
||||
? "bg-ari-carbon-oscuro text-white"
|
||||
: "bg-slate-100 text-slate-600 hover:bg-ari-cobre/10"
|
||||
? "bg-ari-marino text-white"
|
||||
: "bg-slate-100 text-slate-600 hover:bg-ari-coral-claro/10"
|
||||
}`}
|
||||
>
|
||||
{value}
|
||||
|
||||
@@ -4,22 +4,26 @@ import { ArrowUpRight } from "lucide-react";
|
||||
import type { Category } from "@/lib/headless/types";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type TileContent = { subtitle: string; image?: string; color: string };
|
||||
type TileContent = { subtitle: string; image?: string; color: string; scrim?: string };
|
||||
|
||||
// No hay fotografia real todavia para las 6 categorias raiz de la taxonomia
|
||||
// (ver ADR 0005) -- solo se mapean imagen/subtitulo para las que ya tienen
|
||||
// un asset en public/images/categories/. Las demas caen al tile de solo
|
||||
// gradiente en vez de mostrar una imagen que no les corresponde.
|
||||
// Fondos pastel solidos (patron Walmart-inspirado, ADR 0008 sub-fase 4)
|
||||
// en vez de los gradientes saturados originales del esquema arcoiris --
|
||||
// un tono pastel distinto por categoria, no una escala de marca (serian
|
||||
// todos casi iguales), pero coordinados en la misma temperatura suave.
|
||||
const tileContent: Record<string, TileContent> = {
|
||||
juguetes: { subtitle: "Personajes que inspiran", image: "/images/categories/figuras.webp", color: "from-yellow-300 to-orange-400" },
|
||||
"mochilas-y-morrales": { subtitle: "Estilo para cada aventura", image: "/images/categories/mochilas.webp", color: "from-cyan-400 to-blue-500" },
|
||||
"bebes-y-primera-infancia": { subtitle: "Primeros descubrimientos", color: "from-pink-300 to-fuchsia-400" },
|
||||
educativos: { subtitle: "Aprender jugando", color: "from-emerald-400 to-teal-600" },
|
||||
"accion-y-aventura": { subtitle: "Para explorar sin límites", color: "from-red-500 to-rose-700" },
|
||||
variedades: { subtitle: "Un poco de todo", color: "from-violet-400 to-purple-600" },
|
||||
juguetes: { subtitle: "Personajes que inspiran", image: "/images/categories/figuras.webp", color: "bg-amber-100", scrim: "from-amber-100" },
|
||||
"mochilas-y-morrales": { subtitle: "Estilo para cada aventura", image: "/images/categories/mochilas.webp", color: "bg-sky-100", scrim: "from-sky-100" },
|
||||
"bebes-y-primera-infancia": { subtitle: "Primeros descubrimientos", color: "bg-rose-100" },
|
||||
educativos: { subtitle: "Aprender jugando", color: "bg-emerald-100" },
|
||||
"accion-y-aventura": { subtitle: "Para explorar sin límites", color: "bg-orange-100" },
|
||||
variedades: { subtitle: "Un poco de todo", color: "bg-violet-100" },
|
||||
};
|
||||
|
||||
const defaultTile: TileContent = { subtitle: "Explora esta categoría", color: "from-slate-400 to-slate-600" };
|
||||
const defaultTile: TileContent = { subtitle: "Explora esta categoría", color: "bg-slate-100" };
|
||||
|
||||
// Tile individual reutilizado tanto por la seccion de mundos del home
|
||||
// como por el grid del catalogo (tiles promocionales intercalados,
|
||||
@@ -31,20 +35,24 @@ export function PromoTile({ category, className = "" }: { category: Category; cl
|
||||
return (
|
||||
<Link
|
||||
href={`/catalog?category=${encodeURIComponent(category.name)}`}
|
||||
className={cn(`group relative min-h-64 overflow-hidden rounded-[2rem] bg-gradient-to-br ${content.color} shadow-xl`, className)}
|
||||
className={cn(`group relative min-h-64 overflow-hidden rounded-[2rem] ${content.color} shadow-sm ring-1 ring-slate-900/5`, className)}
|
||||
>
|
||||
{content.image && (
|
||||
<>
|
||||
<Image src={content.image} alt={category.name} fill sizes="(max-width: 640px) 100vw, (max-width: 1024px) 33vw, 16vw" className="object-cover transition duration-500 group-hover:scale-105" />
|
||||
<div className="absolute inset-0 bg-gradient-to-t from-slate-950/80 via-transparent to-white/5" />
|
||||
{/* Franja tintada con el pastel propio de la categoria (no
|
||||
blanco generico) -- sin esto la tarjeta con foto se veia
|
||||
desconectada de las tarjetas solidas vecinas, reportado
|
||||
en produccion. */}
|
||||
<div className={`absolute inset-x-0 bottom-0 h-3/5 bg-gradient-to-t ${content.scrim ?? "from-white"} via-white/50 to-transparent`} />
|
||||
</>
|
||||
)}
|
||||
<div className="absolute inset-x-0 bottom-0 flex items-end justify-between p-6 text-white">
|
||||
<div className="absolute inset-x-0 bottom-0 flex items-end justify-between p-6 text-slate-900">
|
||||
<div>
|
||||
<h3 className="text-xl font-black">{category.name}</h3>
|
||||
<p className="mt-1 text-sm font-semibold text-white/80">{content.subtitle}</p>
|
||||
<p className="mt-1 text-sm font-semibold text-slate-600">{content.subtitle}</p>
|
||||
</div>
|
||||
<span className="grid size-11 shrink-0 place-items-center rounded-full bg-white text-slate-950 transition group-hover:rotate-45">
|
||||
<span className="grid size-11 shrink-0 place-items-center rounded-full bg-ari-marino text-white transition group-hover:rotate-45">
|
||||
<ArrowUpRight />
|
||||
</span>
|
||||
</div>
|
||||
@@ -61,10 +69,10 @@ export function CategoryTiles({ categories }: { categories: Category[] }) {
|
||||
<section className="mx-auto max-w-7xl px-4 py-14">
|
||||
<div className="mb-8 flex items-end justify-between gap-4">
|
||||
<div>
|
||||
<span className="text-xs font-black uppercase tracking-[.18em] text-fuchsia-600">Explora por mundos</span>
|
||||
<span className="text-xs font-black uppercase tracking-[.18em] text-ari-coral">Explora por mundos</span>
|
||||
<h2 className="mt-2 text-4xl font-black tracking-tight sm:text-5xl">Encuentra tu próximo tesoro</h2>
|
||||
</div>
|
||||
<Link href="/catalog" className="hidden font-black text-cyan-700 sm:block">Ver todo →</Link>
|
||||
<Link href="/catalog" className="hidden font-black text-ari-marino sm:block">Ver todo →</Link>
|
||||
</div>
|
||||
<div className="grid gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6">
|
||||
{roots.map((category) => (
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { ArrowRight, BadgePercent, Sparkles } from "lucide-react";
|
||||
import { motion, useReducedMotion } from "motion/react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
export function HeroBento() {
|
||||
const reduceMotion = useReducedMotion();
|
||||
const initial = reduceMotion ? false : { opacity: 0, y: 20 };
|
||||
|
||||
return (
|
||||
<section className="mx-auto max-w-7xl px-4 py-7 lg:py-10">
|
||||
<div className="grid gap-5 lg:grid-cols-[1.55fr_.8fr]">
|
||||
<motion.article initial={initial} animate={{ opacity: 1, y: 0 }} className="grid min-h-[470px] overflow-hidden rounded-[2rem] bg-fuchsia-500 text-white shadow-2xl lg:min-h-[560px] lg:grid-cols-[.82fr_1.18fr]">
|
||||
<div className="relative z-10 flex flex-col justify-center bg-gradient-to-br from-fuchsia-600 via-pink-500 to-rose-500 p-7 lg:p-11">
|
||||
<div className="mb-5 inline-flex w-fit items-center gap-2 rounded-full bg-yellow-300 px-4 py-2 text-xs font-black uppercase tracking-wider text-slate-950"><Sparkles className="size-4" />Celebración ARI</div>
|
||||
<h1 className="text-5xl font-black leading-[.92] tracking-[-.06em] sm:text-6xl lg:text-7xl"><span className="block">Hasta</span><span className="text-yellow-300">50% OFF</span><span className="mt-3 block text-3xl tracking-tight sm:text-4xl">en tesoros seleccionados</span></h1>
|
||||
<p className="mt-6 max-w-md text-base font-semibold text-white/95 sm:text-lg">Personajes, mochilas y regalos que convierten cualquier día en una celebración.</p>
|
||||
<Button asChild variant="yellow" size="lg" className="mt-8 w-fit"><Link href="/catalog">Comprar ahora <ArrowRight className="size-5" /></Link></Button>
|
||||
</div>
|
||||
<div className="relative min-h-[360px] bg-white lg:min-h-full">
|
||||
<Image src="/images/promo/hero-vibrant.webp" alt="Promoción principal de Ari Shopping" fill priority sizes="(max-width: 1024px) 100vw, 42vw" className="object-cover object-center" />
|
||||
</div>
|
||||
</motion.article>
|
||||
|
||||
<div className="grid gap-5 sm:grid-cols-2 lg:grid-cols-1">
|
||||
<motion.article initial={reduceMotion ? false : { opacity: 0, x: 18 }} animate={{ opacity: 1, x: 0 }} transition={{ delay: .08 }} className="grid min-h-60 overflow-hidden rounded-[2rem] bg-red-600 text-white shadow-xl sm:grid-cols-[.9fr_1.1fr] lg:min-h-0">
|
||||
<div className="relative z-10 flex flex-col justify-center bg-gradient-to-br from-red-600 to-rose-700 p-6"><span className="text-xs font-black uppercase tracking-wider text-yellow-300">Héroes favoritos</span><h2 className="mt-2 text-3xl font-black leading-none">Acción y aventura</h2><Button asChild variant="yellow" size="sm" className="mt-5 w-fit"><Link href="/catalog?collection=Marvel">Comprar ahora</Link></Button></div>
|
||||
<div className="relative min-h-56 bg-white"><Image src="/images/promo/promo-marvel.webp" alt="Colección Marvel" fill sizes="(max-width: 1024px) 50vw, 18vw" className="object-cover object-center" /></div>
|
||||
</motion.article>
|
||||
|
||||
<motion.article initial={reduceMotion ? false : { opacity: 0, x: 18 }} animate={{ opacity: 1, x: 0 }} transition={{ delay: .14 }} className="grid min-h-60 overflow-hidden rounded-[2rem] bg-violet-600 text-white shadow-xl sm:grid-cols-[.9fr_1.1fr] lg:min-h-0">
|
||||
<div className="relative z-10 flex flex-col justify-center bg-gradient-to-br from-violet-600 to-cyan-600 p-6"><div className="inline-flex w-fit items-center gap-1 rounded-full bg-white px-3 py-1 text-xs font-black text-fuchsia-600"><BadgePercent className="size-4" />Novedad</div><h2 className="mt-3 text-3xl font-black leading-none">Tesoros para regalar</h2><Button asChild variant="outline" size="sm" className="mt-5 w-fit border-white bg-white"><Link href="/catalog">Descubrir</Link></Button></div>
|
||||
<div className="relative min-h-56 bg-white"><Image src="/images/promo/promo-characters.webp" alt="Personajes y peluches" fill sizes="(max-width: 1024px) 50vw, 18vw" className="object-cover object-center" /></div>
|
||||
</motion.article>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
"use client";
|
||||
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { ArrowRight, BadgePercent, Sparkles } from "lucide-react";
|
||||
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
// ADR 0008 sub-fase 4: hero azul con dots de paginacion (carrusel), en vez
|
||||
// del bento estatico de 3 tarjetas en fucsia/rojo/violeta del esquema
|
||||
// arcoiris original. Un slide a la vez, fondo azul de marca en los tres,
|
||||
// para leerse como una sola pieza de marca en vez de 3 bloques de colores
|
||||
// distintos.
|
||||
const slides = [
|
||||
{
|
||||
id: "celebracion",
|
||||
badge: "Celebración ARI",
|
||||
icon: Sparkles,
|
||||
title: "Hasta 50% OFF",
|
||||
subtitle: "en tesoros seleccionados",
|
||||
description: "Personajes, mochilas y regalos que convierten cualquier día en una celebración.",
|
||||
href: "/catalog",
|
||||
image: "/images/promo/hero-vibrant.webp",
|
||||
imageAlt: "Promoción principal de Ari Shopping",
|
||||
},
|
||||
{
|
||||
id: "marvel",
|
||||
badge: "Héroes favoritos",
|
||||
icon: BadgePercent,
|
||||
title: "Acción y aventura",
|
||||
subtitle: "colección Marvel",
|
||||
description: "Figuras, mochilas y sets listos para la próxima misión.",
|
||||
href: "/catalog?collection=Marvel",
|
||||
image: "/images/promo/promo-marvel.webp",
|
||||
imageAlt: "Colección Marvel",
|
||||
},
|
||||
{
|
||||
id: "regalos",
|
||||
badge: "Novedad",
|
||||
icon: Sparkles,
|
||||
title: "Tesoros para regalar",
|
||||
subtitle: "",
|
||||
description: "Personajes y peluches para sorprender en cualquier ocasión.",
|
||||
href: "/catalog",
|
||||
image: "/images/promo/promo-characters.webp",
|
||||
imageAlt: "Personajes y peluches",
|
||||
},
|
||||
];
|
||||
|
||||
const AUTOPLAY_MS = 6000;
|
||||
|
||||
export function HeroCarousel() {
|
||||
const reduceMotion = useReducedMotion();
|
||||
const [index, setIndex] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
if (reduceMotion) return;
|
||||
const timer = setInterval(() => setIndex((current) => (current + 1) % slides.length), AUTOPLAY_MS);
|
||||
return () => clearInterval(timer);
|
||||
}, [reduceMotion]);
|
||||
|
||||
const slide = slides[index];
|
||||
const Icon = slide.icon;
|
||||
|
||||
return (
|
||||
<section className="mx-auto max-w-7xl px-4 py-7 lg:py-10">
|
||||
<div className="relative overflow-hidden rounded-[2rem] bg-ari-marino text-white shadow-2xl">
|
||||
<AnimatePresence mode="wait">
|
||||
<motion.article
|
||||
key={slide.id}
|
||||
initial={reduceMotion ? false : { opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={reduceMotion ? undefined : { opacity: 0 }}
|
||||
transition={{ duration: 0.4 }}
|
||||
className="grid min-h-[420px] lg:min-h-[500px] lg:grid-cols-2"
|
||||
>
|
||||
<div className="relative z-10 flex flex-col justify-center p-7 lg:p-14">
|
||||
<div className="mb-5 inline-flex w-fit items-center gap-2 rounded-full bg-ari-coral-claro px-4 py-2 text-xs font-black uppercase tracking-wider text-ari-marino">
|
||||
<Icon className="size-4" />
|
||||
{slide.badge}
|
||||
</div>
|
||||
<h1 className="text-5xl font-black leading-[.95] tracking-[-.04em] sm:text-6xl">{slide.title}</h1>
|
||||
{slide.subtitle && <p className="mt-2 text-2xl font-bold text-ari-coral-claro">{slide.subtitle}</p>}
|
||||
<p className="mt-6 max-w-md text-base font-semibold text-white/90 sm:text-lg">{slide.description}</p>
|
||||
<Button asChild variant="yellow" size="lg" className="mt-8 w-fit">
|
||||
<Link href={slide.href}>
|
||||
Comprar ahora <ArrowRight className="size-5" />
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="relative min-h-[280px] bg-white lg:min-h-full">
|
||||
<Image src={slide.image} alt={slide.imageAlt} fill priority={index === 0} sizes="(max-width: 1024px) 100vw, 50vw" className="object-cover object-center" />
|
||||
</div>
|
||||
</motion.article>
|
||||
</AnimatePresence>
|
||||
|
||||
<div className="absolute inset-x-0 bottom-5 z-20 flex justify-center gap-2">
|
||||
{slides.map((item, itemIndex) => (
|
||||
<button
|
||||
key={item.id}
|
||||
type="button"
|
||||
aria-label={`Ir a la diapositiva ${itemIndex + 1}: ${item.badge}`}
|
||||
aria-current={itemIndex === index ? "true" : undefined}
|
||||
onClick={() => setIndex(itemIndex)}
|
||||
className={`h-2.5 rounded-full transition-all ${itemIndex === index ? "w-7 bg-ari-coral-claro" : "w-2.5 bg-white/50 hover:bg-white/80"}`}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { Facebook, Instagram, MessageCircle } from "lucide-react";
|
||||
|
||||
export function Footer() {
|
||||
return <footer className="bg-slate-950 text-white"><div className="mx-auto grid max-w-7xl gap-10 px-4 py-14 sm:grid-cols-2 lg:grid-cols-4"><div><div className="flex items-center gap-4"><div className="relative size-16 overflow-hidden rounded-full"><Image src="/images/brand/logo-ari.png" alt="ARI Shopping" fill sizes="64px" className="object-cover" /></div><div><strong className="text-xl font-black">ARI Shopping</strong><p className="text-xs text-white/60">Tesoros para cada aventura.</p></div></div><div className="mt-5 flex gap-3"><Instagram /><Facebook /><MessageCircle /></div></div><FooterColumn title="Compra" links={["Novedades", "Juguetes", "Mochilas", "Regalos"]} /><FooterColumn title="Ayuda" links={["Preguntas frecuentes", "Envíos", "Cambios", "Contacto"]} /><div><h3 className="font-black">Newsletter</h3><p className="mt-3 text-sm leading-6 text-white/60">Recibe lanzamientos y promociones especiales.</p><div className="mt-4 flex rounded-full bg-white p-1"><input className="min-w-0 flex-1 bg-transparent px-4 text-sm text-slate-950 outline-none" placeholder="Tu correo" /><button className="rounded-full bg-yellow-300 px-4 text-sm font-black text-slate-950">Unirme</button></div></div></div><div className="border-t border-white/10 py-5 text-center text-xs text-white/50">© 2026 ARI Shopping · Frontend headless v4.1 · GitOps</div></footer>;
|
||||
return <footer className="bg-ari-marino text-white"><div className="mx-auto grid max-w-7xl gap-10 px-4 py-14 sm:grid-cols-2 lg:grid-cols-4"><div><div className="flex flex-col items-start gap-3"><img src="/images/brand/logo-ari.svg" alt="ARI shopping" className="h-11 w-auto" width={200} height={64} />{/* eslint-disable-line @next/next/no-img-element -- vector propio, next/image no optimiza SVG sin habilitar dangerouslyAllowSVG */}<p className="text-xs text-white/60">Tesoros para cada aventura.</p></div><div className="mt-5 flex gap-3"><Instagram /><Facebook /><MessageCircle /></div></div><FooterColumn title="Compra" links={["Novedades", "Juguetes", "Mochilas", "Regalos"]} /><FooterColumn title="Ayuda" links={["Preguntas frecuentes", "Envíos", "Cambios", "Contacto"]} /><div><h3 className="font-black">Newsletter</h3><p className="mt-3 text-sm leading-6 text-white/60">Recibe lanzamientos y promociones especiales.</p><div className="mt-4 flex rounded-full bg-white p-1"><input className="min-w-0 flex-1 bg-transparent px-4 text-sm text-slate-950 outline-none" placeholder="Tu correo" /><button className="rounded-full bg-ari-coral px-4 text-sm font-black text-white">Unirme</button></div></div></div><div className="border-t border-white/10 py-5 text-center text-xs text-white/50">© 2026 ARI Shopping · Frontend headless v4.1 · GitOps</div></footer>;
|
||||
}
|
||||
|
||||
function FooterColumn({ title, links }: { title: string; links: string[] }) {
|
||||
return <div><h3 className="font-black">{title}</h3><div className="mt-4 grid gap-3 text-sm text-white/60">{links.map((link) => <Link key={link} href="/catalog" className="hover:text-yellow-300">{link}</Link>)}</div></div>;
|
||||
return <div><h3 className="font-black">{title}</h3><div className="mt-4 grid gap-3 text-sm text-white/60">{links.map((link) => <Link key={link} href="/catalog" className="hover:text-ari-coral-claro">{link}</Link>)}</div></div>;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { usePathname, useSearchParams } from "next/navigation";
|
||||
import { ChevronDown, Heart, LayoutGrid, Menu, MessageCircle, PackageCheck, ShoppingCart, UserRound } from "lucide-react";
|
||||
@@ -46,26 +45,31 @@ export function Navbar({ products, categories }: { products: Product[]; categori
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-40 border-b border-slate-200/80 bg-white/95 shadow-sm backdrop-blur-xl">
|
||||
<div className="bg-gradient-to-r from-amber-300 via-yellow-200 to-lime-200 px-4 py-2 text-center text-xs font-black text-slate-950 sm:text-sm">
|
||||
Paga tus compras a cuotas · Envíos nacionales · <span className="underline decoration-2 underline-offset-2">Compra segura con ARI</span>
|
||||
<div className="bg-ari-marino px-4 py-2 text-center text-xs font-black text-white sm:text-sm">
|
||||
Paga tus compras a cuotas · Envíos nacionales · <span className="underline decoration-ari-coral-claro decoration-2 underline-offset-2">Compra segura con ARI</span>
|
||||
</div>
|
||||
|
||||
<div className="relative overflow-visible bg-white">
|
||||
<div className="pointer-events-none absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-cyan-400 via-violet-500 to-fuchsia-500" />
|
||||
<div className="mx-auto grid max-w-7xl grid-cols-[72px_1fr_auto] items-center gap-4 px-4 py-4 lg:grid-cols-[92px_minmax(420px,1fr)_auto] lg:gap-8">
|
||||
<Link href="/" className="relative size-16 overflow-hidden rounded-full border-2 border-slate-900 bg-black shadow-lg lg:size-20">
|
||||
<Image src="/images/brand/logo-ari.png" alt="ARI Shopping" fill priority sizes="80px" className="object-cover" />
|
||||
<div className="pointer-events-none absolute inset-x-0 top-0 h-1 bg-ari-coral-claro" />
|
||||
<div className="mx-auto grid max-w-7xl grid-cols-[auto_1fr_auto] items-center gap-4 px-4 py-4 lg:gap-8">
|
||||
{/* Isotipo circular con icono + wordmark integrados (como en la
|
||||
version previa a ADR 0008), pedido explicito del usuario en
|
||||
vez del lockup rectangular. logo-ari.svg (rectangular) se
|
||||
mantiene para el footer. */}
|
||||
<Link href="/" aria-label="ARI shopping" className="shrink-0">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element -- vector propio, next/image no optimiza SVG sin habilitar dangerouslyAllowSVG */}
|
||||
<img src="/images/brand/logo-ari-circular.svg" alt="ARI shopping" className="size-16 lg:size-20" width={200} height={200} />
|
||||
</Link>
|
||||
<PredictiveSearch />
|
||||
<div className="flex items-center gap-2">
|
||||
<Button variant="outline" size="icon" aria-label="Mi cuenta" className="hidden border-slate-300 bg-white text-slate-900 hover:border-violet-400 hover:bg-violet-50 sm:inline-flex" onClick={() => setAccountOpen(true)}><UserRound /></Button>
|
||||
<Button variant="outline" size="icon" aria-label={`Favoritos: ${wishlistCount}`} className="relative hidden border-slate-300 bg-white text-slate-900 hover:border-fuchsia-400 hover:bg-fuchsia-50 sm:inline-flex" onClick={openWishlist}>
|
||||
<Button variant="outline" size="icon" aria-label="Mi cuenta" className="hidden border-slate-300 bg-white text-slate-900 hover:border-ari-coral hover:bg-ari-coral/10 sm:inline-flex" onClick={() => setAccountOpen(true)}><UserRound /></Button>
|
||||
<Button variant="outline" size="icon" aria-label={`Favoritos: ${wishlistCount}`} className="relative hidden border-slate-300 bg-white text-slate-900 hover:border-ari-coral hover:bg-ari-coral/10 sm:inline-flex" onClick={openWishlist}>
|
||||
<Heart />
|
||||
{wishlistCount > 0 && <span className="absolute -right-1.5 -top-1.5 grid size-5 place-items-center rounded-full bg-violet-600 text-[10px] font-black text-white">{wishlistCount}</span>}
|
||||
{wishlistCount > 0 && <span className="absolute -right-1.5 -top-1.5 grid size-5 place-items-center rounded-full bg-ari-marino text-[10px] font-black text-white">{wishlistCount}</span>}
|
||||
</Button>
|
||||
<Button variant="primary" size="icon" onClick={openCart} aria-label={`Carrito con ${count} productos`} className="relative shadow-lg shadow-fuchsia-500/20">
|
||||
<Button variant="primary" size="icon" onClick={openCart} aria-label={`Carrito con ${count} productos`} className="relative">
|
||||
<ShoppingCart />
|
||||
<span className="absolute -right-2 -top-2 grid size-6 place-items-center rounded-full bg-yellow-300 text-[11px] font-black text-slate-950">{count}</span>
|
||||
<span className="absolute -right-2 -top-2 grid size-6 place-items-center rounded-full bg-ari-marino text-[11px] font-black text-white">{count}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,7 +86,7 @@ export function Navbar({ products, categories }: { products: Product[]; categori
|
||||
<SheetDescription>Categorías y colecciones del catálogo.</SheetDescription>
|
||||
</SheetHeader>
|
||||
<div className="flex-1 overflow-y-auto p-6">
|
||||
<p className="mb-3 text-xs font-black uppercase tracking-[.16em] text-fuchsia-600">Categorías</p>
|
||||
<p className="mb-3 text-xs font-black uppercase tracking-[.16em] text-ari-coral">Categorías</p>
|
||||
<div className="grid gap-2">
|
||||
<Suspense fallback={<MobileCategoryLinksFallback tree={tree} onNavigate={() => setMenuOpen(false)} />}>
|
||||
<MobileCategoryLinks tree={tree} onNavigate={() => setMenuOpen(false)} />
|
||||
@@ -90,9 +94,9 @@ export function Navbar({ products, categories }: { products: Product[]; categori
|
||||
</div>
|
||||
{collections.length > 0 && (
|
||||
<>
|
||||
<p className="mb-3 mt-8 text-xs font-black uppercase tracking-[.16em] text-violet-600">Colecciones</p>
|
||||
<p className="mb-3 mt-8 text-xs font-black uppercase tracking-[.16em] text-ari-marino">Colecciones</p>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{collections.map((collection) => <Link key={collection} href={`/catalog?collection=${encodeURIComponent(collection)}`} onClick={() => setMenuOpen(false)} className="rounded-full bg-slate-100 px-4 py-2 text-sm font-bold hover:bg-violet-100 hover:text-violet-700">{collection}</Link>)}
|
||||
{collections.map((collection) => <Link key={collection} href={`/catalog?collection=${encodeURIComponent(collection)}`} onClick={() => setMenuOpen(false)} className="rounded-full bg-slate-100 px-4 py-2 text-sm font-bold hover:bg-ari-coral/10 hover:text-ari-coral">{collection}</Link>)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
@@ -107,7 +111,7 @@ export function Navbar({ products, categories }: { products: Product[]; categori
|
||||
<Dialog open={accountOpen} onOpenChange={setAccountOpen}>
|
||||
<DialogContent className="max-w-lg p-7">
|
||||
<div className="pr-10">
|
||||
<span className="text-xs font-black uppercase tracking-[.16em] text-violet-600">Atención personalizada</span>
|
||||
<span className="text-xs font-black uppercase tracking-[.16em] text-ari-coral">Atención personalizada</span>
|
||||
<h2 className="mt-3 text-3xl font-black">Tu cuenta ARI</h2>
|
||||
<p className="mt-3 text-sm leading-6 text-slate-600">El inicio de sesión quedará conectado al backend headless. Mientras tanto, puedes gestionar pedidos y disponibilidad directamente por WhatsApp.</p>
|
||||
<div className="mt-6 grid gap-3">
|
||||
@@ -136,16 +140,16 @@ function useCategoryNavigationState() {
|
||||
function pillClass(active: boolean): string {
|
||||
return `shrink-0 rounded-full px-4 py-2 text-sm font-extrabold transition ${
|
||||
active
|
||||
? "bg-gradient-to-r from-cyan-500 to-violet-500 text-white shadow-lg shadow-violet-950/30"
|
||||
: "text-white/90 hover:bg-gradient-to-r hover:from-cyan-500 hover:to-violet-500 hover:text-white"
|
||||
? "bg-white text-ari-marino shadow-lg shadow-black/10"
|
||||
: "text-white/90 hover:bg-white/10 hover:text-white"
|
||||
}`;
|
||||
}
|
||||
|
||||
function mobileLinkClass(active: boolean): string {
|
||||
return `rounded-2xl border px-4 py-3 font-extrabold transition ${
|
||||
active
|
||||
? "border-violet-500 bg-violet-50 text-violet-700"
|
||||
: "border-slate-200 hover:border-cyan-400 hover:bg-cyan-50"
|
||||
? "border-ari-coral bg-ari-coral/5 text-ari-coral"
|
||||
: "border-slate-200 hover:border-ari-coral/50 hover:bg-ari-coral/5"
|
||||
}`;
|
||||
}
|
||||
|
||||
@@ -170,8 +174,8 @@ function CategoryNavBar({
|
||||
isAllActive: boolean;
|
||||
}) {
|
||||
return (
|
||||
<nav className="border-b-4 border-fuchsia-500 bg-slate-950 text-white">
|
||||
<div className="mx-auto flex max-w-7xl items-center gap-1 px-4 py-2">
|
||||
<nav className="bg-ari-marino text-white">
|
||||
<div className="relative mx-auto flex max-w-7xl items-center gap-1 px-4 py-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
@@ -213,7 +217,7 @@ function DepartmentsMegaMenu({ tree, isActive }: { tree: CategoryNode[]; isActiv
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<div ref={containerRef} className="relative shrink-0" onMouseEnter={() => setOpen(true)} onMouseLeave={() => setOpen(false)}>
|
||||
<div ref={containerRef} className="shrink-0" onMouseEnter={() => setOpen(true)} onMouseLeave={() => setOpen(false)}>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setOpen((value) => !value)}
|
||||
@@ -227,7 +231,7 @@ function DepartmentsMegaMenu({ tree, isActive }: { tree: CategoryNode[]; isActiv
|
||||
</button>
|
||||
|
||||
{open && (
|
||||
<div className="absolute left-0 top-full z-50 mt-1 w-[min(92vw,64rem)] rounded-2xl border border-slate-800 bg-slate-950 p-6 shadow-2xl">
|
||||
<div className="absolute left-0 top-full z-50 mt-1 max-h-[80vh] w-[min(92vw,64rem)] overflow-y-auto rounded-2xl border border-white/10 bg-ari-marino p-6 shadow-2xl">
|
||||
<div className="grid grid-cols-2 gap-x-6 gap-y-5 sm:grid-cols-3 lg:grid-cols-6">
|
||||
{tree.map((root) => (
|
||||
<div key={root.id}>
|
||||
@@ -237,7 +241,7 @@ function DepartmentsMegaMenu({ tree, isActive }: { tree: CategoryNode[]; isActiv
|
||||
aria-current={isActive(root.name) ? "page" : undefined}
|
||||
onClick={() => setOpen(false)}
|
||||
className={`block text-sm font-black uppercase tracking-wide transition ${
|
||||
isActive(root.name) ? "text-fuchsia-400" : "text-white hover:text-fuchsia-400"
|
||||
isActive(root.name) ? "text-ari-coral-claro" : "text-white hover:text-ari-coral-claro"
|
||||
}`}
|
||||
>
|
||||
{root.name}
|
||||
@@ -251,7 +255,7 @@ function DepartmentsMegaMenu({ tree, isActive }: { tree: CategoryNode[]; isActiv
|
||||
prefetch={false}
|
||||
aria-current={isActive(child.name) ? "page" : undefined}
|
||||
onClick={() => setOpen(false)}
|
||||
className={`block text-sm transition ${isActive(child.name) ? "font-bold text-violet-300" : "text-white/70 hover:text-white"}`}
|
||||
className={`block text-sm transition ${isActive(child.name) ? "font-bold text-ari-coral-claro" : "text-white/70 hover:text-white"}`}
|
||||
>
|
||||
{child.name}
|
||||
</Link>
|
||||
|
||||
@@ -33,15 +33,15 @@ export function ProductCard({ product, priority = false }: { product: Product; p
|
||||
: null;
|
||||
|
||||
return (
|
||||
<article className="group flex h-full flex-col overflow-hidden rounded-lg border border-slate-100 bg-white shadow-lg shadow-ari-carbon-oscuro/5 transition duration-300 hover:-translate-y-1.5 hover:shadow-2xl hover:shadow-ari-ciruela/10">
|
||||
<div className="relative aspect-square overflow-hidden bg-ari-hueso">
|
||||
<article className="group flex h-full flex-col overflow-hidden rounded-lg border border-slate-100 bg-white shadow-lg shadow-ari-marino/5 transition duration-300 hover:-translate-y-1.5 hover:shadow-2xl hover:shadow-ari-coral/10">
|
||||
<div className="relative aspect-square overflow-hidden bg-white">
|
||||
<Link href={`/product/${product.slug}`} prefetch={false}><Image src={product.thumbnail} alt={product.name} fill priority={priority} sizes="(max-width: 640px) 82vw, (max-width: 1024px) 44vw, 280px" className="object-cover transition duration-500 group-hover:scale-[1.035]" /></Link>
|
||||
<div className="absolute left-3 top-3 flex gap-2">{discountPercent && discountPercent > 0 && <Badge className="bg-ari-terracota-oscuro text-white">-{discountPercent}%</Badge>}{product.isNew && <Badge className="bg-ari-carbon-oscuro text-white">Nuevo</Badge>}{product.featured && <Badge className="bg-ari-cobre text-white"><Sparkles className="mr-1 size-3" />Top</Badge>}</div>
|
||||
<button type="button" aria-label={isFavorite ? "Quitar de favoritos" : "Agregar a favoritos"} aria-pressed={isFavorite} className={`absolute right-3 top-3 rounded-full p-2.5 shadow-lg backdrop-blur transition ${isFavorite ? "bg-ari-ciruela text-white" : "bg-white/95 text-slate-900 hover:text-ari-ciruela"}`} onClick={() => toggleProduct(product)}><Heart className={`size-4 ${isFavorite ? "fill-current" : ""}`} /></button>
|
||||
<div className="absolute left-3 top-3 flex gap-2">{discountPercent && discountPercent > 0 && <Badge className="bg-ari-coral-claro text-ari-marino">-{discountPercent}%</Badge>}{product.isNew && <Badge className="bg-ari-marino text-white">Nuevo</Badge>}{product.featured && <Badge className="bg-ari-coral-claro text-ari-marino"><Sparkles className="mr-1 size-3" />Top</Badge>}</div>
|
||||
<button type="button" aria-label={isFavorite ? "Quitar de favoritos" : "Agregar a favoritos"} aria-pressed={isFavorite} className={`absolute right-3 top-3 rounded-full p-2.5 shadow-lg backdrop-blur transition ${isFavorite ? "bg-ari-coral text-white" : "bg-white/95 text-slate-900 hover:text-ari-coral"}`} onClick={() => toggleProduct(product)}><Heart className={`size-4 ${isFavorite ? "fill-current" : ""}`} /></button>
|
||||
</div>
|
||||
<div className="flex flex-1 flex-col space-y-3 p-5">
|
||||
<div className="flex items-center justify-between gap-2 text-xs font-bold text-slate-500"><span>{product.category}</span><span className="rounded-md bg-ari-cobre/10 px-2 py-1 text-ari-cobre">{product.collection}</span></div>
|
||||
<Link href={`/product/${product.slug}`} prefetch={false}><h3 className="line-clamp-2 min-h-12 text-lg font-black leading-6 text-ari-carbon group-hover:text-ari-ciruela">{product.name}</h3></Link>
|
||||
<div className="flex items-center justify-between gap-2 text-xs font-bold text-slate-500"><span>{product.category}</span><span className="rounded-md bg-ari-coral-claro/10 px-2 py-1 text-ari-marino">{product.collection}</span></div>
|
||||
<Link href={`/product/${product.slug}`} prefetch={false}><h3 className="line-clamp-2 min-h-12 text-lg font-black leading-6 text-ari-marino group-hover:text-ari-coral">{product.name}</h3></Link>
|
||||
<p className="line-clamp-2 min-h-10 text-sm leading-5 text-slate-500">{product.shortDescription}</p>
|
||||
{product.variants.length > 1 && (
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
@@ -55,7 +55,7 @@ export function ProductCard({ product, priority = false }: { product: Product; p
|
||||
onClick={() => setSelectedVariantId(variant.id)}
|
||||
className={`rounded-md border px-2.5 py-1 text-xs font-bold transition ${
|
||||
selectedVariantId === variant.id
|
||||
? "border-ari-ciruela bg-ari-ciruela/10 text-ari-ciruela"
|
||||
? "border-ari-coral bg-ari-coral/10 text-ari-coral"
|
||||
: "border-slate-200 text-slate-600 hover:border-slate-400"
|
||||
} ${!variant.available ? "cursor-not-allowed opacity-40" : ""}`}
|
||||
>
|
||||
@@ -70,7 +70,7 @@ export function ProductCard({ product, priority = false }: { product: Product; p
|
||||
<div className="mt-auto flex items-center justify-between gap-3 pt-1">
|
||||
<div className="flex flex-col">
|
||||
{product.compareAtPrice && <span className="text-xs font-bold text-slate-400 line-through">{formatMoney(product.compareAtPrice, product.currency)}</span>}
|
||||
<strong className="font-display text-base font-bold text-ari-carbon">{formatMoney(product.price, product.currency)}</strong>
|
||||
<strong className="font-display text-base font-bold text-ari-marino">{formatMoney(product.price, product.currency)}</strong>
|
||||
</div>
|
||||
<Button variant="primary" size="sm" onClick={() => addItem(product, selectedVariantId)}><ShoppingBag className="size-4" />Agregar</Button>
|
||||
</div>
|
||||
|
||||
@@ -18,5 +18,5 @@ export function ProductPurchase({ product }: { product: Product }) {
|
||||
selectedVariant.inventoryQuantity <= LOW_STOCK_THRESHOLD
|
||||
? selectedVariant.inventoryQuantity
|
||||
: null;
|
||||
return <div><div className="mb-5 flex flex-wrap gap-2">{product.variants.map((variant) => <button key={variant.id} onClick={() => setVariantId(variant.id)} className={`rounded-full border px-4 py-2 text-sm font-bold ${variantId === variant.id ? "border-fuchsia-500 bg-fuchsia-50 text-fuchsia-700" : "border-slate-200"}`}>{variant.value}</button>)}</div><div className="mb-6 flex items-end gap-3"><strong className="text-3xl font-black">{formatMoney(product.price, product.currency)}</strong>{product.compareAtPrice && <del className="text-slate-400">{formatMoney(product.compareAtPrice, product.currency)}</del>}</div><Button variant="primary" size="lg" className="w-full" onClick={() => addItem(product, variantId)}><ShoppingBag />Añadir al carrito</Button><div className="mt-5 grid gap-3 rounded-2xl bg-slate-50 p-4 text-sm">{lowStock !== null ? <span className="flex items-center gap-2 font-bold text-amber-600"><TriangleAlert className="size-4" />Quedan {lowStock} unidades</span> : <span className="flex items-center gap-2 font-bold"><CheckCircle2 className="size-4 text-emerald-500" />Disponibilidad por confirmar</span>}<span className="flex items-center gap-2 font-bold"><Truck className="size-4 text-cyan-600" />Envíos nacionales</span></div></div>;
|
||||
return <div><div className="mb-5 flex flex-wrap gap-2">{product.variants.map((variant) => <button key={variant.id} onClick={() => setVariantId(variant.id)} className={`rounded-full border px-4 py-2 text-sm font-bold ${variantId === variant.id ? "border-ari-marino bg-ari-marino text-white" : "border-slate-200"}`}>{variant.value}</button>)}</div><div className="mb-6 flex items-end gap-3"><strong className="text-3xl font-black">{formatMoney(product.price, product.currency)}</strong>{product.compareAtPrice && <del className="text-slate-400">{formatMoney(product.compareAtPrice, product.currency)}</del>}</div>{/* oculto en mobile: MobileAddToCart (barra fija abajo, lg:hidden) ya cubre esa misma accion ahi -- sin el hidden aqui, ambos se mostraban a la vez. */}<Button variant="primary" size="lg" className="hidden w-full lg:inline-flex" onClick={() => addItem(product, variantId)}><ShoppingBag />Añadir al carrito</Button><div className="mt-5 grid gap-3 rounded-2xl bg-slate-50 p-4 text-sm">{lowStock !== null ? <span className="flex items-center gap-2 font-bold text-amber-600"><TriangleAlert className="size-4" />Quedan {lowStock} unidades</span> : <span className="flex items-center gap-2 font-bold"><CheckCircle2 className="size-4 text-emerald-500" />Disponibilidad por confirmar</span>}<span className="flex items-center gap-2 font-bold"><Truck className="size-4 text-cyan-600" />Envíos nacionales</span></div></div>;
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Search, X } from "lucide-react";
|
||||
import { FormEvent, useEffect, useState } from "react";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import type { Product } from "@/lib/headless/types";
|
||||
|
||||
export function PredictiveSearch() {
|
||||
@@ -54,12 +53,34 @@ export function PredictiveSearch() {
|
||||
|
||||
return (
|
||||
<form onSubmit={submit} className="relative w-full">
|
||||
<div className="rounded-full bg-gradient-to-r from-cyan-400 via-violet-500 to-fuchsia-500 p-[2px] shadow-lg shadow-violet-500/10">
|
||||
<div className="relative rounded-full bg-white">
|
||||
<Search className="pointer-events-none absolute left-5 top-1/2 z-10 size-5 -translate-y-1/2 text-violet-600" />
|
||||
<Input value={query} onChange={(event) => setQuery(event.target.value)} placeholder="Busca juguetes, mochilas, personajes…" className="h-[52px] border-0 bg-transparent pl-[52px] pr-12 shadow-none focus-visible:ring-violet-300/30" />
|
||||
{query && <button type="button" aria-label="Limpiar búsqueda" className="absolute right-4 top-1/2 -translate-y-1/2 rounded-full p-1 text-slate-400 hover:bg-slate-100" onClick={() => setQuery("")}><X className="size-4" /></button>}
|
||||
</div>
|
||||
<div className="flex items-center rounded-full border-2 border-slate-200 bg-white pl-5 pr-1.5 shadow-sm transition focus-within:border-ari-marino focus-within:ring-4 focus-within:ring-ari-coral-claro/30">
|
||||
{/* input propio (no el <Input> compartido) -- ese componente trae su
|
||||
propio focus:ring-4 focus:ring-cyan-300/30 hardcodeado que no se
|
||||
anulaba de forma confiable via tailwind-merge dentro de este
|
||||
contenedor compuesto (input + boton circular), causando un
|
||||
segundo ring visible al hacer foco. Mas simple y robusto no
|
||||
heredar clases de foco que hay que pelear despues.
|
||||
|
||||
focus-visible:outline-none (no outline-none a secas): globals.css
|
||||
define un outline de accesibilidad global por teclado
|
||||
(input:focus-visible, azul de marca) que le gana en
|
||||
especificidad a un outline-none plano. El wrapper de este
|
||||
componente ya tiene su propio indicador de foco visible
|
||||
(focus-within:border-ari-marino + ring amarillo, mismo patron
|
||||
que button.tsx) que cumple el mismo proposito de accesibilidad
|
||||
sin duplicarlo -- variante focus-visible: en vez de la base
|
||||
iguala la especificidad de la regla global (mismo truco que ya
|
||||
usa button.tsx) y evita el doble indicador de foco. */}
|
||||
<input
|
||||
value={query}
|
||||
onChange={(event) => setQuery(event.target.value)}
|
||||
placeholder="Busca juguetes, mochilas, personajes…"
|
||||
className="h-[48px] w-full border-0 bg-transparent p-0 text-sm text-slate-950 focus-visible:outline-none"
|
||||
/>
|
||||
{query && <button type="button" aria-label="Limpiar búsqueda" className="mr-1 shrink-0 rounded-full p-1.5 text-slate-400 hover:bg-slate-100" onClick={() => setQuery("")}><X className="size-4" /></button>}
|
||||
<button type="submit" aria-label="Buscar" className="grid size-10 shrink-0 place-items-center rounded-full bg-ari-marino text-white transition hover:brightness-110">
|
||||
<Search className="size-4.5" />
|
||||
</button>
|
||||
</div>
|
||||
{loading && normalized.length >= 2 && matches.length === 0 && (
|
||||
<div className="absolute left-0 right-0 top-[calc(100%+10px)] z-50 rounded-2xl border border-slate-200 bg-white p-4 text-center text-sm text-slate-500 shadow-2xl">
|
||||
@@ -69,12 +90,12 @@ export function PredictiveSearch() {
|
||||
{matches.length > 0 && (
|
||||
<div className="absolute left-0 right-0 top-[calc(100%+10px)] z-50 overflow-hidden rounded-2xl border border-slate-200 bg-white p-2 shadow-2xl">
|
||||
{matches.map((product) => (
|
||||
<Link key={product.id} href={`/product/${product.slug}`} prefetch={false} className="grid grid-cols-[54px_1fr] items-center gap-3 rounded-xl p-2 hover:bg-violet-50" onClick={() => setQuery("")}>
|
||||
<Link key={product.id} href={`/product/${product.slug}`} prefetch={false} className="grid grid-cols-[54px_1fr] items-center gap-3 rounded-xl p-2 hover:bg-ari-marino/5" onClick={() => setQuery("")}>
|
||||
<div className="relative aspect-square overflow-hidden rounded-lg bg-slate-100"><Image src={product.thumbnail} alt="" fill sizes="54px" className="object-cover" /></div>
|
||||
<div><strong className="line-clamp-1 text-sm">{product.name}</strong><span className="text-xs text-slate-500">{product.category} · {product.collection}</span></div>
|
||||
</Link>
|
||||
))}
|
||||
<button type="submit" className="mt-1 w-full rounded-xl bg-slate-950 px-4 py-3 text-sm font-black text-white hover:bg-violet-700">Buscar “{query.trim()}” en todo el catálogo</button>
|
||||
<button type="submit" className="mt-1 w-full rounded-xl bg-ari-marino px-4 py-3 text-sm font-black text-white hover:brightness-110">Buscar “{query.trim()}” en todo el catálogo</button>
|
||||
</div>
|
||||
)}
|
||||
</form>
|
||||
|
||||
@@ -25,7 +25,7 @@ spec:
|
||||
runAsUser: 1001
|
||||
containers:
|
||||
- name: app
|
||||
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.178
|
||||
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.197
|
||||
env:
|
||||
- name: HEADLESS_PROVIDER
|
||||
value: medusa
|
||||
|
||||
@@ -42,6 +42,22 @@ const nextConfig: NextConfig = {
|
||||
},
|
||||
],
|
||||
},
|
||||
// Assets de marca (logo, favicon) cambian con cada iteracion de
|
||||
// identidad visual, a diferencia de las fotos de producto -- el
|
||||
// cache de 7 dias de la regla anterior dejaba servido el logo
|
||||
// viejo en Cloudflare/navegador durante toda una semana despues de
|
||||
// cada deploy (ver ADR 0008). Next.js aplica el ultimo header que
|
||||
// matchee un mismo path, asi que esta regla, al ir despues,
|
||||
// sobreescribe el Cache-Control solo para /images/brand/*.
|
||||
{
|
||||
source: "/images/brand/:path*",
|
||||
headers: [
|
||||
{
|
||||
key: "Cache-Control",
|
||||
value: "public, max-age=300, must-revalidate",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<!-- ADR 0008, paleta "Azul & Amarillo". Isotipo circular (formato de la
|
||||
version previa a ADR 0008, pedido explicito del usuario en vez del
|
||||
lockup rectangular de logo-ari.svg): mariposa geometrica de 4 elipses
|
||||
+ wordmark "ARI shopping", todo dentro del mismo circulo azul.
|
||||
Ver docs-portal/docs/decisiones/0008-identidad-navy-coral.md -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" role="img" aria-label="ARI shopping">
|
||||
<circle cx="100" cy="100" r="98" fill="#0055B8"/>
|
||||
<g transform="translate(100 68) scale(2.6) translate(-17 -11)">
|
||||
<ellipse cx="10" cy="8" rx="9" ry="7" transform="rotate(-18 10 8)" fill="#FFC220"/>
|
||||
<ellipse cx="24" cy="8" rx="9" ry="7" transform="rotate(18 24 8)" fill="#FFC220"/>
|
||||
<ellipse cx="12" cy="16" rx="6" ry="5" transform="rotate(-10 12 16)" fill="#FFDD73"/>
|
||||
<ellipse cx="22" cy="16" rx="6" ry="5" transform="rotate(10 22 16)" fill="#FFDD73"/>
|
||||
<rect x="16" y="3" width="2" height="18" rx="1" fill="#0055B8"/>
|
||||
</g>
|
||||
<text x="100" y="132" text-anchor="middle" font-family="Poppins, ui-sans-serif, system-ui, sans-serif" font-weight="700" font-size="38" fill="#FFFFFF">ARI</text>
|
||||
<text x="100" y="153" text-anchor="middle" font-family="Poppins, ui-sans-serif, system-ui, sans-serif" font-weight="700" font-size="14" letter-spacing="3" fill="#FFC220">shopping</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -1,15 +1,16 @@
|
||||
<!-- ADR 0008 ("Navy & Coral"). Isotipo: mariposa geometrica de 4 elipses
|
||||
sobre circulo/campo marino + wordmark "ARI shopping".
|
||||
<!-- ADR 0008, paleta final "Azul & Amarillo" (Walmart-inspirada). Isotipo:
|
||||
mariposa geometrica de 4 elipses sobre circulo/campo azul + wordmark
|
||||
"ARI shopping".
|
||||
Ver docs-portal/docs/decisiones/0008-identidad-navy-coral.md -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 64" role="img" aria-label="ARI shopping">
|
||||
<rect width="200" height="64" rx="12" fill="#122844"/>
|
||||
<rect width="200" height="64" rx="12" fill="#0055B8"/>
|
||||
<g transform="translate(14 20)">
|
||||
<ellipse cx="10" cy="8" rx="9" ry="7" transform="rotate(-18 10 8)" fill="#D85A30"/>
|
||||
<ellipse cx="24" cy="8" rx="9" ry="7" transform="rotate(18 24 8)" fill="#D85A30"/>
|
||||
<ellipse cx="12" cy="16" rx="6" ry="5" transform="rotate(-10 12 16)" fill="#F0997B"/>
|
||||
<ellipse cx="22" cy="16" rx="6" ry="5" transform="rotate(10 22 16)" fill="#F0997B"/>
|
||||
<rect x="16" y="3" width="2" height="18" rx="1" fill="#122844"/>
|
||||
<ellipse cx="10" cy="8" rx="9" ry="7" transform="rotate(-18 10 8)" fill="#FFC220"/>
|
||||
<ellipse cx="24" cy="8" rx="9" ry="7" transform="rotate(18 24 8)" fill="#FFC220"/>
|
||||
<ellipse cx="12" cy="16" rx="6" ry="5" transform="rotate(-10 12 16)" fill="#FFDD73"/>
|
||||
<ellipse cx="22" cy="16" rx="6" ry="5" transform="rotate(10 22 16)" fill="#FFDD73"/>
|
||||
<rect x="16" y="3" width="2" height="18" rx="1" fill="#0055B8"/>
|
||||
</g>
|
||||
<text x="64" y="38" font-family="Poppins, ui-sans-serif, system-ui, sans-serif" font-weight="700" font-size="26" fill="#FFFFFF">ARI</text>
|
||||
<text x="64" y="53" font-family="Poppins, ui-sans-serif, system-ui, sans-serif" font-weight="700" font-size="11" letter-spacing="2.5" fill="#F0997B">shopping</text>
|
||||
<text x="64" y="53" font-family="Poppins, ui-sans-serif, system-ui, sans-serif" font-weight="700" font-size="11" letter-spacing="2.5" fill="#FFC220">shopping</text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Reference in new issue
Block a user