Files
renato97 a3360ec6e4 feat: fase 2+3 — expansion masiva multi-perfil + bug fixes + hardening
Fase 2 (expansion):
- Francesca: +6 etapas matematicas (5-10), +7 etapas lectura (3-9), +2 ortografia
- Sebastian: +8 etapas matematicas (4-11), +6 lectura, +3 historia, +3 geografia, +1 banderas
- Nuevas paginas: ortografia, lectura, geografia, matematicas
- ~900 ejercicios nuevos, paridad ~500 por perfil

Fase 3 (bug fixes + hardening):
- Fix: SessionLog auto-create en grade route
- Fix: engine cache (no borrar antes de revisar)
- Fix: FSRS cards actualizadas en flujo curriculum
- Fix: responseMs real (no hardcodeado 3000)
- Fix: options dentro de content en sebastian etapa-1
- Fix: trazo-letra consonantes crash
- Security: execFileSync anti-command-injection en TTS
- DB: 18 cascade deletes + indices + unique constraints
- APIs debug: reset, state, seed
- Docker: espeak-ng + prisma + user/group
- E2E: 23 tests nuevos (curriculum-flow.spec.ts)
- Code review: tailwind colors, middleware dev mode, eslint config

Verificado: tsc exit 0, build exit 0, 61 E2E tests pass
2026-07-25 22:07:28 -03:00

94 lines
2.7 KiB
TypeScript

"use client"
import { useEffect } from "react"
import { useRouter } from "next/navigation"
const PROFILES = [
{
id: "isabella",
label: "Isabella",
edad: "4 años",
emoji: "👧",
color: "from-pink-400 to-pink-500",
desc: "Letras, números y primeras palabras",
},
{
id: "francesca",
label: "Francesca",
edad: "6 años",
emoji: "👦",
color: "from-blue-400 to-blue-500",
desc: "Matemáticas, lectura y ortografía",
},
{
id: "sebastian",
label: "Sebastián",
edad: "8 años",
emoji: "🧒",
color: "from-green-400 to-green-500",
desc: "Matemáticas avanzadas, historia y geografía",
},
]
export default function RootPage() {
const router = useRouter()
useEffect(() => {
const host = window.location.hostname
if (host.includes("simulacro")) {
router.replace("/parent")
}
}, [router])
const handleSelect = (id: string) => {
if (id === "isabella") {
router.push("/child")
} else {
router.push(`/${id}`)
}
}
return (
<div className="min-h-dvh bg-background flex flex-col items-center justify-center p-6 gap-6 relative overflow-hidden">
{/* Background decoration */}
<div className="absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-primary via-accent to-secondary opacity-30" />
{/* Logo area */}
<div className="text-center space-y-1 mb-4">
<div className="text-5xl">📚</div>
<h1 className="text-3xl font-display font-bold text-foreground">
EduEasy
</h1>
<p className="text-muted-foreground text-sm">¿Quién va a aprender hoy?</p>
</div>
<div className="flex flex-col gap-4 w-full max-w-sm">
{PROFILES.map((p) => (
<button
key={p.id}
onClick={() => handleSelect(p.id)}
className={`bg-gradient-to-r ${p.color} text-white touch-target-lg rounded-2xl flex items-center gap-4 px-6 py-6 text-left shadow-lg active:scale-95 transition-all hover:shadow-xl font-display`}
>
<span className="text-5xl shrink-0">{p.emoji}</span>
<div className="flex-1 min-w-0">
<div className="text-xl font-bold">{p.label}</div>
<div className="text-sm opacity-80">{p.edad}</div>
<div className="text-xs opacity-70 mt-1">{p.desc}</div>
</div>
<span className="text-2xl opacity-60"></span>
</button>
))}
</div>
<div className="fixed bottom-4 text-center">
<button
onClick={() => router.push("/parent")}
className="text-sm text-muted-foreground underline underline-offset-2"
>
Mamá / Papá
</button>
</div>
</div>
)
}