Compare commits

..
2 Commits
11 changed files with 2921 additions and 43 deletions
+13 -3
View File
@@ -16,6 +16,7 @@
"imap-simple": "^5.1.0", "imap-simple": "^5.1.0",
"jsqr": "^1.4.0", "jsqr": "^1.4.0",
"mailparser": "^3.9.36", "mailparser": "^3.9.36",
"nodemailer": "^10.1.0",
"pg": "^8.23.1", "pg": "^8.23.1",
"puppeteer-core": "^25.12.0", "puppeteer-core": "^25.12.0",
"qrcode": "^1.5.4", "qrcode": "^1.5.4",
@@ -1391,6 +1392,15 @@
"node": ">=20.0.0" "node": ">=20.0.0"
} }
}, },
"node_modules/mailparser/node_modules/nodemailer": {
"version": "10.0.14",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-10.0.14.tgz",
"integrity": "sha512-eJoLFKg55fesSlzUekmfOv/SBXh4KUYT8oiQc2RLP0tfG0rbNMJBK7wgHJwXTJwqyKlSJMz9UzDZ4v+aHEvo8g==",
"license": "MIT-0",
"engines": {
"node": ">=20.0.0"
}
},
"node_modules/math-intrinsics": { "node_modules/math-intrinsics": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -1541,9 +1551,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/nodemailer": { "node_modules/nodemailer": {
"version": "10.0.14", "version": "10.1.0",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-10.0.14.tgz", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-10.1.0.tgz",
"integrity": "sha512-eJoLFKg55fesSlzUekmfOv/SBXh4KUYT8oiQc2RLP0tfG0rbNMJBK7wgHJwXTJwqyKlSJMz9UzDZ4v+aHEvo8g==", "integrity": "sha512-fXW8AulB25aOTuwfRYV6lqHyfz2VM4rr4SGXH03mE7x5znEUpzL5mu6anARUpZN7744Ziwkmr4AxSLPJsBQspg==",
"license": "MIT-0", "license": "MIT-0",
"engines": { "engines": {
"node": ">=20.0.0" "node": ">=20.0.0"
+1
View File
@@ -28,6 +28,7 @@
"imap-simple": "^5.1.0", "imap-simple": "^5.1.0",
"jsqr": "^1.4.0", "jsqr": "^1.4.0",
"mailparser": "^3.9.36", "mailparser": "^3.9.36",
"nodemailer": "^10.1.0",
"pg": "^8.23.1", "pg": "^8.23.1",
"puppeteer-core": "^25.12.0", "puppeteer-core": "^25.12.0",
"qrcode": "^1.5.4", "qrcode": "^1.5.4",
+878
View File
@@ -0,0 +1,878 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Structured Flow — App de Agenda y Recordatorios Visuales</title>
<script src="https://www.gstatic.com/antigravity/web/dev/tailwindcss.min.js"></script>
<style>
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
.theme-transition {
transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}
/* Cápsula móvil estilo Structured */
.structured-pill {
border-radius: 32px;
box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.07), inset 0 1.5px 1px rgba(255, 255, 255, 0.85);
transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.structured-pill:hover {
transform: translateY(-2px);
box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.1), inset 0 1.5px 1px rgba(255, 255, 255, 0.95);
}
.structured-pill:active {
transform: scale(0.98);
}
/* Tarea del Timeline */
.timeline-task {
border-radius: 26px;
box-shadow: 0 6px 20px -3px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.8);
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.timeline-task.completed {
opacity: 0.65;
filter: saturate(0.7);
}
.timeline-task.completed .task-title {
text-decoration: line-through;
}
/* Conector puzzle */
.puzzle-joint {
width: 26px;
height: 22px;
position: relative;
flex-shrink: 0;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
}
/* Marco del teléfono */
.iphone-frame {
box-shadow:
0 0 0 12px #0f172a,
0 0 0 14px #334155,
0 25px 60px -15px rgba(0, 0, 0, 0.35);
}
/* Animación de check */
@keyframes check-pop {
0% { transform: scale(0.7); }
50% { transform: scale(1.2); }
100% { transform: scale(1); }
}
.animate-pop {
animation: check-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
</style>
</head>
<body id="pageBody" class="theme-transition min-h-screen bg-[#e8f4fc] text-slate-800 p-3 sm:p-6 md:p-8 flex flex-col items-center justify-start font-sans">
<!-- TOP BAR DEL PROTOTIPO -->
<header class="w-full max-w-5xl mx-auto mb-6 flex flex-col md:flex-row items-center justify-between gap-4 bg-white/70 backdrop-blur-xl p-4 md:px-6 rounded-3xl border border-white/80 shadow-xs">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-2xl bg-gradient-to-tr from-sky-600 via-cyan-500 to-emerald-400 flex items-center justify-center text-white font-extrabold text-xl shadow-md">
⚡
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-xl font-black tracking-tight text-slate-900">flow</span>
<span class="text-[11px] font-bold uppercase tracking-wider px-2.5 py-0.5 rounded-full bg-sky-100 text-sky-800 border border-sky-200">
Agenda & Recordatorios • Estilo Structured
</span>
</div>
<p class="text-xs text-slate-500 font-medium">Timeline visual de tareas y carrusel de rutinas en colores pastel</p>
</div>
</div>
<!-- SELECTOR DE COLOR PASTEL Y VISTA -->
<div class="flex flex-wrap items-center gap-2">
<!-- Selector de fondo de la app -->
<div class="flex items-center gap-1.5 bg-white/90 p-1.5 rounded-2xl border border-slate-200 shadow-xs">
<span class="text-[11px] font-semibold text-slate-500 pl-1.5">Fondo:</span>
<button onclick="changeTheme('#e0f2fe', '#e8f4fc', 'Cielo Pastel')" title="Cielo Pastel" class="w-6 h-6 rounded-full bg-[#e0f2fe] border-2 border-sky-400 hover:scale-110 transition-transform cursor-pointer"></button>
<button onclick="changeTheme('#d1fae5', '#e6f8f0', 'Menta Fresca')" title="Menta Fresca" class="w-6 h-6 rounded-full bg-[#d1fae5] border-2 border-emerald-400 hover:scale-110 transition-transform cursor-pointer"></button>
<button onclick="changeTheme('#ffedd5', '#fef3e7', 'Melocotón')" title="Melocotón" class="w-6 h-6 rounded-full bg-[#ffedd5] border-2 border-orange-400 hover:scale-110 transition-transform cursor-pointer"></button>
<button onclick="changeTheme('#f3e8ff', '#f7f0fe', 'Lavanda')" title="Lavanda" class="w-6 h-6 rounded-full bg-[#f3e8ff] border-2 border-purple-400 hover:scale-110 transition-transform cursor-pointer"></button>
<button onclick="changeTheme('#fef9c3', '#fefde8', 'Vainilla')" title="Vainilla" class="w-6 h-6 rounded-full bg-[#fef9c3] border-2 border-amber-400 hover:scale-110 transition-transform cursor-pointer"></button>
<button onclick="changeTheme('#ffffff', '#f1f5f9', 'Nieve')" title="Blanco Puro" class="w-6 h-6 rounded-full bg-white border-2 border-slate-300 hover:scale-110 transition-transform cursor-pointer"></button>
</div>
<!-- Botón Nueva Tarea en el simulador -->
<button onclick="openNewTaskModal()" class="px-4 py-2 rounded-2xl bg-slate-900 hover:bg-sky-600 text-white text-xs font-bold shadow-sm transition-all flex items-center gap-1.5 cursor-pointer active:scale-95">
<span>+ Nueva Tarea</span>
</button>
</div>
</header>
<!-- CONTENEDOR PRINCIPAL -->
<main class="w-full max-w-5xl flex flex-col lg:flex-row items-center justify-center gap-8 lg:gap-12">
<!-- FRAME DEL CELULAR CON LA APP (IPHONE 16 PRO) -->
<div id="phoneShell" class="iphone-frame relative w-[390px] h-[812px] bg-slate-950 rounded-[52px] p-3 flex flex-col shrink-0 select-none overflow-hidden transition-all duration-500">
<!-- PANTALLA INTERNA DEL SMARTPHONE -->
<div id="appViewport" class="theme-transition relative w-full h-full bg-[#e0f2fe] rounded-[42px] overflow-hidden flex flex-col justify-between">
<!-- STATUS BAR & DYNAMIC ISLAND -->
<div class="relative pt-3 pb-1 px-7 flex items-center justify-between z-40 text-slate-800 font-semibold text-xs tracking-tight">
<span>9:41</span>
<!-- DYNAMIC ISLAND CON NOTIFICACIÓN DE PRÓXIMA TAREA -->
<div onclick="showAppToast('Próxima: Enfoque Profundo a las 10:00 AM')" class="w-28 h-7 bg-black rounded-full flex items-center justify-between px-2.5 shadow-inner cursor-pointer active:scale-95 transition-transform">
<div class="w-2.5 h-2.5 rounded-full bg-emerald-400 animate-pulse"></div>
<span class="text-[10px] text-white/90 font-medium tracking-wide">flow app</span>
<div class="w-2.5 h-2.5 rounded-full bg-sky-400"></div>
</div>
<div class="flex items-center gap-1.5 text-slate-800">
<svg class="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor"><path d="M12 3c-4.97 0-9 4.03-9 9 0 2.12.74 4.07 1.97 5.61L12 22l7.03-4.39C20.26 16.07 21 14.12 21 12c0-4.97-4.03-9-9-9z"/></svg>
<div class="w-5 h-2.5 border border-slate-700 rounded-sm p-0.5 flex items-center">
<div class="w-full h-full bg-slate-800 rounded-2xs"></div>
</div>
</div>
</div>
<!-- CONTENIDO SCROLLABLE DE LA APP -->
<div id="appContentScroll" class="flex-1 overflow-y-auto no-scrollbar pb-24 px-4 pt-1">
<!-- HEADER DE LA APP (DÍA Y PROGRESO) -->
<div class="flex items-center justify-between mb-4">
<div>
<span class="text-[11px] font-bold tracking-wider uppercase text-sky-900/70 block">
viernes, 10 de octubre
</span>
<h1 class="text-xl font-black text-slate-900 tracking-tight lowercase">
mi agenda de hoy
</h1>
</div>
<!-- CHIP DE PROGRESO DEL DÍA -->
<div class="bg-white/80 backdrop-blur-md px-3 py-1.5 rounded-2xl border border-white/90 shadow-xs flex items-center gap-2">
<div class="w-7 h-7 rounded-full bg-sky-100 flex items-center justify-center font-bold text-xs text-sky-800">
<span id="progressPercent">50%</span>
</div>
<div class="flex flex-col text-left">
<span class="text-[9px] uppercase font-bold text-slate-400">completado</span>
<span id="progressCount" class="text-xs font-black text-slate-800">2 de 4</span>
</div>
</div>
</div>
<!-- SELECTOR DE FECHAS EN PÍLDORAS HORIZONTALES (ESTILO STRUCTURED) -->
<div class="flex items-center gap-2 overflow-x-auto no-scrollbar py-1 mb-4 text-xs font-semibold">
<button onclick="selectDate(this, 'Jue 9')" class="px-3.5 py-1.5 rounded-full bg-white/70 hover:bg-white text-slate-700 shrink-0 border border-white/80 lowercase transition-all cursor-pointer">
jue 9
</button>
<button onclick="selectDate(this, 'Hoy 10')" class="px-4 py-1.5 rounded-full bg-slate-900 text-white shadow-xs shrink-0 lowercase cursor-pointer">
hoy 10
</button>
<button onclick="selectDate(this, 'Sáb 11')" class="px-3.5 py-1.5 rounded-full bg-white/70 hover:bg-white text-slate-700 shrink-0 border border-white/80 lowercase transition-all cursor-pointer">
sáb 11
</button>
<button onclick="selectDate(this, 'Dom 12')" class="px-3.5 py-1.5 rounded-full bg-white/70 hover:bg-white text-slate-700 shrink-0 border border-white/80 lowercase transition-all cursor-pointer">
dom 12
</button>
<button onclick="selectDate(this, 'Lun 13')" class="px-3.5 py-1.5 rounded-full bg-white/70 hover:bg-white text-slate-700 shrink-0 border border-white/80 lowercase transition-all cursor-pointer">
lun 13
</button>
</div>
<!-- ========================================================== -->
<!-- EL CARRUSEL DE LA APP: RUTINAS Y PLANTILLAS DE RECORDATORIO -->
<!-- ========================================================== -->
<div class="mb-5">
<div class="flex items-center justify-between mb-2 px-1">
<div>
<span class="text-[10px] font-bold tracking-wider uppercase text-sky-900/80">plantillas & hábitos</span>
<h3 class="text-sm font-extrabold text-slate-900 tracking-tight lowercase">
rutinas conectadas
</h3>
</div>
<!-- Mini botones de navegación del carrusel -->
<div class="flex items-center gap-1.5">
<button onclick="scrollAppCarousel(-1)" class="w-6 h-6 rounded-full bg-white/80 hover:bg-white border border-white flex items-center justify-center text-slate-700 shadow-2xs active:scale-90 transition-all cursor-pointer">
‹
</button>
<button onclick="scrollAppCarousel(1)" class="w-6 h-6 rounded-full bg-white/80 hover:bg-white border border-white flex items-center justify-center text-slate-700 shadow-2xs active:scale-90 transition-all cursor-pointer">
›
</button>
</div>
</div>
<!-- TRACK CON TARJETAS CÁPSULA Y CONECTORES DE ROMPECABEZAS -->
<div class="relative overflow-hidden py-1.5 -mx-4 px-4">
<div id="agendaCarouselTrack" class="flex items-center overflow-x-auto no-scrollbar scroll-smooth snap-x snap-mandatory py-1" style="scroll-padding-left: 16px;">
<!-- ================= TARJETA 1 (PASTEL SKY) ================= -->
<div class="structured-pill snap-start shrink-0 w-[285px] h-[148px] bg-[#e0f2fe] p-4 flex flex-col justify-between relative cursor-pointer border border-sky-200/50" onclick="insertRoutineToTimeline('🌅 Rutina Mañanera', '07:00 AM', '45 min', '#e0f2fe', '☕', 'Café, meditación y lectura de 10 páginas')">
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-8 h-8 rounded-full bg-white/90 shadow-2xs flex items-center justify-center text-base">
🌅
</div>
<span class="text-[11px] font-bold text-sky-950 uppercase tracking-tight">hábito diario</span>
</div>
<span class="text-[10px] font-black px-2 py-0.5 rounded-full bg-sky-200 text-sky-900 lowercase">
45 min
</span>
</div>
<div>
<h4 class="text-sm font-extrabold text-slate-900 tracking-tight leading-snug lowercase">
rutina mañanera
</h4>
<p class="text-[11px] text-slate-600 line-clamp-1 font-medium mt-0.5">
café, 10 min meditación y journaling
</p>
</div>
<div class="flex items-center justify-between pt-1">
<span class="text-[11px] font-bold text-sky-900">07:00 am</span>
<button class="px-3 py-1 rounded-full bg-slate-900 hover:bg-sky-600 text-white text-[11px] font-bold transition-all shadow-xs flex items-center gap-1">
<span>agendar</span>
<span>+</span>
</button>
</div>
</div>
<!-- CONECTOR PUZZLE 1 (Sky a Mint) -->
<div class="puzzle-joint">
<svg width="26" height="22" viewBox="0 0 26 22" fill="none">
<path d="M0 0 H11 C11 5.5, 16 5.5, 16 11 C16 16.5, 11 16.5, 11 22 H0 Z" fill="#e0f2fe"/>
<path d="M11 0 H26 V22 H11 C11 16.5, 16 16.5, 16 11 C16 5.5, 11 5.5, 11 0 Z" fill="#d1fae5"/>
<path d="M11 0 C11 5.5, 16 5.5, 16 11 C16 16.5, 11 16.5, 11 22" stroke="rgba(0,0,0,0.06)" stroke-width="1.5"/>
</svg>
</div>
<!-- ================= TARJETA 2 (PASTEL MINT) ================= -->
<div class="structured-pill snap-start shrink-0 w-[285px] h-[148px] bg-[#d1fae5] p-4 flex flex-col justify-between relative cursor-pointer border border-emerald-200/50" onclick="insertRoutineToTimeline('⚡ Enfoque Profundo', '10:00 AM', '90 min', '#d1fae5', '💻', 'Bloque de trabajo sin celular ni interrupciones')">
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-8 h-8 rounded-full bg-white/90 shadow-2xs flex items-center justify-center text-base">
⚡
</div>
<span class="text-[11px] font-bold text-emerald-950 uppercase tracking-tight">productividad</span>
</div>
<span class="text-[10px] font-black px-2 py-0.5 rounded-full bg-emerald-200 text-emerald-900 lowercase">
90 min
</span>
</div>
<div>
<h4 class="text-sm font-extrabold text-slate-900 tracking-tight leading-snug lowercase">
enfoque profundo (deep work)
</h4>
<p class="text-[11px] text-slate-600 line-clamp-1 font-medium mt-0.5">
cero notificaciones, proyecto principal
</p>
</div>
<div class="flex items-center justify-between pt-1">
<span class="text-[11px] font-bold text-emerald-900">10:00 am</span>
<button class="px-3 py-1 rounded-full bg-emerald-900 hover:bg-emerald-800 text-white text-[11px] font-bold transition-all shadow-xs flex items-center gap-1">
<span>agendar</span>
<span>+</span>
</button>
</div>
</div>
<!-- CONECTOR PUZZLE 2 (Mint a Peach) -->
<div class="puzzle-joint">
<svg width="26" height="22" viewBox="0 0 26 22" fill="none">
<path d="M0 0 H11 C11 5.5, 16 5.5, 16 11 C16 16.5, 11 16.5, 11 22 H0 Z" fill="#d1fae5"/>
<path d="M11 0 H26 V22 H11 C11 16.5, 16 16.5, 16 11 C16 5.5, 11 5.5, 11 0 Z" fill="#ffedd5"/>
<path d="M11 0 C11 5.5, 16 5.5, 16 11 C16 16.5, 11 16.5, 11 22" stroke="rgba(0,0,0,0.06)" stroke-width="1.5"/>
</svg>
</div>
<!-- ================= TARJETA 3 (PASTEL PEACH) ================= -->
<div class="structured-pill snap-start shrink-0 w-[285px] h-[148px] bg-[#ffedd5] p-4 flex flex-col justify-between relative cursor-pointer border border-orange-200/50" onclick="insertRoutineToTimeline('🏃‍♂️ Ejercicio & Salud', '05:30 PM', '60 min', '#ffedd5', '🏋️', 'Rutina de pesas o cardio al aire libre')">
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-8 h-8 rounded-full bg-white/90 shadow-2xs flex items-center justify-center text-base">
🏃‍♂️
</div>
<span class="text-[11px] font-bold text-orange-950 uppercase tracking-tight">bienestar</span>
</div>
<span class="text-[10px] font-black px-2 py-0.5 rounded-full bg-orange-200 text-orange-900 lowercase">
60 min
</span>
</div>
<div>
<h4 class="text-sm font-extrabold text-slate-900 tracking-tight leading-snug lowercase">
sesión de entrenamiento
</h4>
<p class="text-[11px] text-slate-600 line-clamp-1 font-medium mt-0.5">
rutina funcional y estiramiento activo
</p>
</div>
<div class="flex items-center justify-between pt-1">
<span class="text-[11px] font-bold text-orange-900">05:30 pm</span>
<button class="px-3 py-1 rounded-full bg-orange-950 hover:bg-orange-900 text-white text-[11px] font-bold transition-all shadow-xs flex items-center gap-1">
<span>agendar</span>
<span>+</span>
</button>
</div>
</div>
<!-- CONECTOR PUZZLE 3 (Peach a Lavender) -->
<div class="puzzle-joint">
<svg width="26" height="22" viewBox="0 0 26 22" fill="none">
<path d="M0 0 H11 C11 5.5, 16 5.5, 16 11 C16 16.5, 11 16.5, 11 22 H0 Z" fill="#ffedd5"/>
<path d="M11 0 H26 V22 H11 C11 16.5, 16 16.5, 16 11 C16 5.5, 11 5.5, 11 0 Z" fill="#f3e8ff"/>
<path d="M11 0 C11 5.5, 16 5.5, 16 11 C16 16.5, 11 16.5, 11 22" stroke="rgba(0,0,0,0.06)" stroke-width="1.5"/>
</svg>
</div>
<!-- ================= TARJETA 4 (PASTEL LAVENDER) ================= -->
<div class="structured-pill snap-start shrink-0 w-[285px] h-[148px] bg-[#f3e8ff] p-4 flex flex-col justify-between relative cursor-pointer border border-purple-200/50" onclick="insertRoutineToTimeline('🌙 Desconexión Nocturna', '09:30 PM', '30 min', '#f3e8ff', '📖', 'Apagar pantallas, lectura y té relajante')">
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-8 h-8 rounded-full bg-white/90 shadow-2xs flex items-center justify-center text-base">
🌙
</div>
<span class="text-[11px] font-bold text-purple-950 uppercase tracking-tight">descanso</span>
</div>
<span class="text-[10px] font-black px-2 py-0.5 rounded-full bg-purple-200 text-purple-900 lowercase">
30 min
</span>
</div>
<div>
<h4 class="text-sm font-extrabold text-slate-900 tracking-tight leading-snug lowercase">
rutina de descanso
</h4>
<p class="text-[11px] text-slate-600 line-clamp-1 font-medium mt-0.5">
cero pantallas, preparar el día de mañana
</p>
</div>
<div class="flex items-center justify-between pt-1">
<span class="text-[11px] font-bold text-purple-900">09:30 pm</span>
<button class="px-3 py-1 rounded-full bg-purple-950 hover:bg-purple-900 text-white text-[11px] font-bold transition-all shadow-xs flex items-center gap-1">
<span>agendar</span>
<span>+</span>
</button>
</div>
</div>
</div>
</div>
<!-- Puntos indicadores del carrusel -->
<div class="flex items-center justify-center gap-1.5 mt-2">
<button onclick="jumpToCarousel(0)" class="app-dot w-6 h-1.5 rounded-full bg-slate-900 transition-all cursor-pointer"></button>
<button onclick="jumpToCarousel(1)" class="app-dot w-2 h-1.5 rounded-full bg-slate-300 transition-all cursor-pointer"></button>
<button onclick="jumpToCarousel(2)" class="app-dot w-2 h-1.5 rounded-full bg-slate-300 transition-all cursor-pointer"></button>
<button onclick="jumpToCarousel(3)" class="app-dot w-2 h-1.5 rounded-full bg-slate-300 transition-all cursor-pointer"></button>
</div>
</div>
<!-- ========================================================== -->
<!-- EL TIMELINE VISUAL DE RECORDATORIOS Y TAREAS (STRUCTURED 1:1) -->
<!-- ========================================================== -->
<div class="mb-4">
<div class="flex items-center justify-between mb-3 px-1">
<div>
<span class="text-[10px] font-bold tracking-wider uppercase text-slate-400">línea de tiempo</span>
<h3 class="text-sm font-extrabold text-slate-900 tracking-tight lowercase">
timeline del día
</h3>
</div>
<span class="text-[10px] font-semibold text-slate-500 bg-white/70 px-2.5 py-0.5 rounded-full border border-white">
toca el círculo para tachar
</span>
</div>
<!-- LISTA VERTICAL DE TAREAS CON LÍNEA CENTRAL -->
<div id="timelineTaskList" class="relative pl-7 space-y-3.5">
<!-- Línea vertical continua que une el día -->
<div class="absolute left-2.5 top-3 bottom-3 w-0.5 bg-slate-300/80 rounded-full"></div>
<!-- Tarea 1: Despertar & Desayuno (Completada) -->
<div class="relative timeline-task completed bg-white/90 p-3.5 border border-white flex items-center justify-between cursor-pointer" onclick="toggleTaskCompletion(this)">
<!-- Nodo conector en la línea del tiempo -->
<div class="absolute -left-[27px] top-1/2 -translate-y-1/2 w-4 h-4 rounded-full bg-sky-500 border-2 border-white shadow-xs"></div>
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-full bg-[#e0f2fe] flex items-center justify-center text-lg">
☕
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-[10px] font-bold text-sky-800 uppercase tracking-tight">07:30 am • 30m</span>
</div>
<h5 class="task-title text-xs font-bold text-slate-900 lowercase leading-snug">
desayuno & planificar el día
</h5>
<p class="text-[10px] text-slate-500 font-medium">revisar prioridades y tomar café</p>
</div>
</div>
<!-- Checkbox circular de Structured -->
<div class="check-circle w-6 h-6 rounded-full bg-emerald-500 text-white flex items-center justify-center text-xs font-bold shadow-xs">
✓
</div>
</div>
<!-- Tarea 2: Reunión de equipo (Completada) -->
<div class="relative timeline-task completed bg-white/90 p-3.5 border border-white flex items-center justify-between cursor-pointer" onclick="toggleTaskCompletion(this)">
<div class="absolute -left-[27px] top-1/2 -translate-y-1/2 w-4 h-4 rounded-full bg-purple-500 border-2 border-white shadow-xs"></div>
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-full bg-[#f3e8ff] flex items-center justify-center text-lg">
💼
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-[10px] font-bold text-purple-800 uppercase tracking-tight">09:00 am • 45m</span>
</div>
<h5 class="task-title text-xs font-bold text-slate-900 lowercase leading-snug">
daily sprint con el equipo
</h5>
<p class="text-[10px] text-slate-500 font-medium">revisión de avances del prototipo</p>
</div>
</div>
<div class="check-circle w-6 h-6 rounded-full bg-emerald-500 text-white flex items-center justify-center text-xs font-bold shadow-xs">
✓
</div>
</div>
<!-- Tarea 3: Enfoque Profundo (EN CURSO) -->
<div class="relative timeline-task bg-[#d1fae5]/90 p-3.5 border border-emerald-200/80 flex items-center justify-between cursor-pointer shadow-xs" onclick="toggleTaskCompletion(this)">
<div class="absolute -left-[27px] top-1/2 -translate-y-1/2 w-4 h-4 rounded-full bg-emerald-500 border-2 border-white shadow-xs animate-pulse"></div>
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-full bg-white flex items-center justify-center text-lg shadow-2xs">
💻
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-[10px] font-extrabold text-emerald-950 uppercase tracking-tight">10:00 am • 90m</span>
<span class="text-[9px] font-bold px-1.5 py-0.2 rounded-full bg-emerald-600 text-white">en curso</span>
</div>
<h5 class="task-title text-xs font-extrabold text-emerald-950 lowercase leading-snug">
diseño de la arquitectura & api
</h5>
<p class="text-[10px] text-emerald-800 font-medium">bloque de concentración profunda</p>
</div>
</div>
<div class="check-circle w-6 h-6 rounded-full border-2 border-emerald-600 bg-white flex items-center justify-center text-xs font-bold text-transparent hover:text-emerald-600">
✓
</div>
</div>
<!-- Espacio libre en el Timeline (Structured Gap) -->
<div class="flex items-center gap-2 py-1 text-[10px] font-semibold text-slate-500 italic pl-1">
<span>⏱️ 1h libre para descanso y caminata</span>
</div>
<!-- Tarea 4: Almuerzo & Desconexión (Pendiente) -->
<div class="relative timeline-task bg-white/90 p-3.5 border border-white flex items-center justify-between cursor-pointer" onclick="toggleTaskCompletion(this)">
<div class="absolute -left-[27px] top-1/2 -translate-y-1/2 w-4 h-4 rounded-full bg-orange-400 border-2 border-white shadow-xs"></div>
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-full bg-[#ffedd5] flex items-center justify-center text-lg">
🥗
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-[10px] font-bold text-orange-800 uppercase tracking-tight">01:00 pm • 60m</span>
</div>
<h5 class="task-title text-xs font-bold text-slate-900 lowercase leading-snug">
almuerzo saludable & lectura
</h5>
<p class="text-[10px] text-slate-500 font-medium">desconectarse de pantallas</p>
</div>
</div>
<div class="check-circle w-6 h-6 rounded-full border-2 border-slate-300 bg-white flex items-center justify-center text-xs font-bold text-transparent hover:text-slate-400">
✓
</div>
</div>
</div>
</div>
</div>
<!-- BARRA DE NAVEGACIÓN FLOTANTE (BOTTOM DOCK) -->
<div class="absolute bottom-3 left-4 right-4 z-40">
<div class="bg-white/80 backdrop-blur-2xl px-6 py-2.5 rounded-full border border-white/90 shadow-[0_10px_25px_-5px_rgba(0,0,0,0.1)] flex items-center justify-between">
<!-- Tab Timeline (Activo) -->
<button class="flex flex-col items-center gap-0.5 text-slate-900 cursor-pointer">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
<span class="text-[9px] font-extrabold lowercase">timeline</span>
</button>
<!-- Tab Calendario -->
<button onclick="showAppToast('Vista de Calendario Mensual')" class="flex flex-col items-center gap-0.5 text-slate-400 hover:text-slate-800 cursor-pointer transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>
<span class="text-[9px] font-semibold lowercase">mes</span>
</button>
<!-- BOTÓN CENTRAL "+" DE CREAR TAREA -->
<button onclick="openNewTaskModal()" class="w-12 h-12 -mt-6 rounded-full bg-slate-900 hover:bg-sky-600 text-white flex items-center justify-center shadow-lg active:scale-90 transition-all cursor-pointer">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M12 4v16m8-8H4"/></svg>
</button>
<!-- Tab Inbox (Tareas sin agendar) -->
<button onclick="showAppToast('Buzón: 3 notas rápidas guardadas')" class="flex flex-col items-center gap-0.5 text-slate-400 hover:text-slate-800 cursor-pointer transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"/></svg>
<span class="text-[9px] font-semibold lowercase">inbox</span>
</button>
<!-- Tab Ajustes -->
<button onclick="showAppToast('Configuración y sincronización')" class="flex flex-col items-center gap-0.5 text-slate-400 hover:text-slate-800 cursor-pointer transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
<span class="text-[9px] font-semibold lowercase">ajustes</span>
</button>
</div>
</div>
<!-- HOME BAR DE IPHONE -->
<div class="absolute bottom-1 left-1/2 -translate-x-1/2 w-32 h-1 bg-slate-900/40 rounded-full z-50 pointer-events-none"></div>
<!-- TOAST IN-APP -->
<div id="inAppNotice" class="absolute top-16 left-6 right-6 z-50 bg-slate-900/90 backdrop-blur-md text-white px-4 py-2.5 rounded-2xl text-xs font-semibold shadow-xl flex items-center justify-between transition-all duration-300 opacity-0 -translate-y-4 pointer-events-none">
<span id="inAppNoticeText">¡Rutina añadida a tu agenda!</span>
<span class="text-emerald-400">✓</span>
</div>
</div>
</div>
<!-- PANEL LATERAL: EXPLICACIÓN Y CARACTERÍSTICAS DE LA APP -->
<div class="w-full max-w-md flex flex-col gap-5">
<!-- TARJETA INFORMATIVA -->
<div class="bg-white/80 backdrop-blur-xl p-6 rounded-3xl border border-white/90 shadow-sm">
<div class="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-100 text-emerald-800 text-[11px] font-bold mb-3">
<span>✨ App Independiente de Agenda & Recordatorios</span>
</div>
<h3 class="text-xl font-extrabold text-slate-900 tracking-tight lowercase mb-2">
¿cómo funciona esta app de recordatorios?
</h3>
<p class="text-xs text-slate-600 font-medium mb-4 leading-relaxed">
Esta aplicación adopta el concepto exacto de <strong>Structured</strong>: transformar listas de tareas aburridas en una <strong>línea de tiempo visual</strong> con colores pasteles, donde cada momento de tu día tiene un espacio claro y conectado.
</p>
<div class="space-y-3 text-xs">
<div class="flex items-start gap-3 p-3 rounded-2xl bg-sky-50/70 border border-sky-100">
<span class="text-lg">🧩</span>
<div>
<strong class="text-slate-900 font-bold block lowercase">1. carrusel de rutinas con conectores puzzle</strong>
<p class="text-slate-600 mt-0.5">Las cápsulas del carrusel son plantillas de hábitos frecuentes (rutina mañanera, deep work, gym). Al tocar cualquiera, se inserta directo en tu timeline.</p>
</div>
</div>
<div class="flex items-start gap-3 p-3 rounded-2xl bg-emerald-50/70 border border-emerald-100">
<span class="text-lg">🕒</span>
<div>
<strong class="text-slate-900 font-bold block lowercase">2. timeline visual interactivo</strong>
<p class="text-slate-600 mt-0.5">Cada tarea tiene su horario y duración. Puedes tocar el círculo verde para marcarla como completada y ver cómo avanza tu porcentaje del día.</p>
</div>
</div>
<div class="flex items-start gap-3 p-3 rounded-2xl bg-orange-50/70 border border-orange-100">
<span class="text-lg">🎨</span>
<div>
<strong class="text-slate-900 font-bold block lowercase">3. paleta pastel relajante</strong>
<p class="text-slate-600 mt-0.5">Usa los colores suaves de SiboPay (Cielo, Menta, Melocotón, Lavanda, Vainilla) que reducen el estrés visual característico de Structured.</p>
</div>
</div>
</div>
</div>
<!-- PRUEBAS RÁPIDAS -->
<div class="bg-white/80 backdrop-blur-xl p-5 rounded-3xl border border-white/90 shadow-sm flex flex-col gap-3">
<h4 class="text-xs font-bold text-slate-400 uppercase tracking-wider">
acciones interactivas de prueba
</h4>
<div class="grid grid-cols-2 gap-2 text-xs font-bold">
<button onclick="insertRoutineToTimeline('☕ Pausa de Café', '03:30 PM', '20 min', '#ffedd5', '☕', 'Desconexión rápida')" class="p-2.5 rounded-2xl bg-orange-500 hover:bg-orange-600 text-white transition-all shadow-xs cursor-pointer text-center">
+ Insertar Pausa
</button>
<button onclick="insertRoutineToTimeline('📖 Lectura Nocturna', '09:00 PM', '45 min', '#f3e8ff', '📖', 'Leer 15 páginas')" class="p-2.5 rounded-2xl bg-purple-600 hover:bg-purple-700 text-white transition-all shadow-xs cursor-pointer text-center">
+ Insertar Lectura
</button>
<button onclick="scrollAppCarousel(1)" class="p-2.5 rounded-2xl bg-slate-900 hover:bg-slate-800 text-white transition-all shadow-xs cursor-pointer text-center">
› Siguiente Rutina
</button>
<button onclick="openNewTaskModal()" class="p-2.5 rounded-2xl bg-sky-600 hover:bg-sky-700 text-white transition-all shadow-xs cursor-pointer text-center">
✏️ Crear Personalizada
</button>
</div>
</div>
</div>
</main>
<!-- MODAL PARA CREAR NUEVA TAREA / RECORDATORIO -->
<div id="newTaskModal" class="fixed inset-0 z-50 bg-black/40 backdrop-blur-xs flex items-center justify-center p-4 opacity-0 pointer-events-none transition-opacity duration-300">
<div class="bg-white rounded-[36px] p-6 max-w-sm w-full shadow-2xl border border-slate-100 flex flex-col gap-4">
<div class="flex items-center justify-between">
<h3 class="text-lg font-black text-slate-900 tracking-tight lowercase">nueva tarea o recordatorio</h3>
<button onclick="closeNewTaskModal()" class="w-8 h-8 rounded-full bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-sm flex items-center justify-center cursor-pointer">
✕
</button>
</div>
<!-- Nombre de la tarea -->
<div>
<label class="text-[11px] font-bold text-slate-500 uppercase tracking-wider block mb-1">título de la tarea</label>
<input id="inputTaskTitle" type="text" placeholder="Ej: Llamar al médico, Estudiar..." class="w-full px-4 py-2.5 rounded-2xl bg-slate-50 border border-slate-200 text-xs font-semibold text-slate-800 focus:outline-none focus:border-sky-500">
</div>
<!-- Hora y duración -->
<div class="grid grid-cols-2 gap-2">
<div>
<label class="text-[11px] font-bold text-slate-500 uppercase tracking-wider block mb-1">hora</label>
<input id="inputTaskTime" type="time" value="14:00" class="w-full px-3 py-2 rounded-2xl bg-slate-50 border border-slate-200 text-xs font-semibold text-slate-800 focus:outline-none">
</div>
<div>
<label class="text-[11px] font-bold text-slate-500 uppercase tracking-wider block mb-1">duración</label>
<select id="inputTaskDuration" class="w-full px-3 py-2 rounded-2xl bg-slate-50 border border-slate-200 text-xs font-semibold text-slate-800 focus:outline-none">
<option value="15 min">15 min</option>
<option value="30 min">30 min</option>
<option value="45 min" selected>45 min</option>
<option value="60 min">1 hora</option>
<option value="90 min">1h 30m</option>
</select>
</div>
</div>
<!-- Selector de color pastel -->
<div>
<label class="text-[11px] font-bold text-slate-500 uppercase tracking-wider block mb-1.5">color pastel</label>
<div class="flex items-center gap-2">
<label class="cursor-pointer"><input type="radio" name="colorChoice" value="#e0f2fe" checked class="peer sr-only"><span class="w-7 h-7 rounded-full bg-[#e0f2fe] border-2 border-transparent peer-checked:border-sky-600 block"></span></label>
<label class="cursor-pointer"><input type="radio" name="colorChoice" value="#d1fae5" class="peer sr-only"><span class="w-7 h-7 rounded-full bg-[#d1fae5] border-2 border-transparent peer-checked:border-emerald-600 block"></span></label>
<label class="cursor-pointer"><input type="radio" name="colorChoice" value="#ffedd5" class="peer sr-only"><span class="w-7 h-7 rounded-full bg-[#ffedd5] border-2 border-transparent peer-checked:border-orange-600 block"></span></label>
<label class="cursor-pointer"><input type="radio" name="colorChoice" value="#f3e8ff" class="peer sr-only"><span class="w-7 h-7 rounded-full bg-[#f3e8ff] border-2 border-transparent peer-checked:border-purple-600 block"></span></label>
<label class="cursor-pointer"><input type="radio" name="colorChoice" value="#fef9c3" class="peer sr-only"><span class="w-7 h-7 rounded-full bg-[#fef9c3] border-2 border-transparent peer-checked:border-amber-600 block"></span></label>
</div>
</div>
<!-- Selector de Emoji -->
<div>
<label class="text-[11px] font-bold text-slate-500 uppercase tracking-wider block mb-1.5">icono</label>
<div class="flex items-center gap-1.5">
<button type="button" onclick="selectEmoji(this, '📝')" class="emoji-btn w-8 h-8 rounded-full bg-slate-100 border border-slate-200 text-sm flex items-center justify-center">📝</button>
<button type="button" onclick="selectEmoji(this, '⚡')" class="emoji-btn w-8 h-8 rounded-full bg-slate-100 border border-slate-200 text-sm flex items-center justify-center">⚡</button>
<button type="button" onclick="selectEmoji(this, '📞')" class="emoji-btn w-8 h-8 rounded-full bg-slate-100 border border-slate-200 text-sm flex items-center justify-center">📞</button>
<button type="button" onclick="selectEmoji(this, '🏋️')" class="emoji-btn w-8 h-8 rounded-full bg-slate-100 border border-slate-200 text-sm flex items-center justify-center">🏋️</button>
<button type="button" onclick="selectEmoji(this, '💊')" class="emoji-btn w-8 h-8 rounded-full bg-slate-100 border border-slate-200 text-sm flex items-center justify-center">💊</button>
<button type="button" onclick="selectEmoji(this, '🛒')" class="emoji-btn w-8 h-8 rounded-full bg-slate-100 border border-slate-200 text-sm flex items-center justify-center">🛒</button>
</div>
</div>
<!-- Botón Guardar -->
<div class="pt-2">
<button onclick="saveNewTask()" class="w-full py-3 rounded-full bg-slate-900 hover:bg-sky-600 text-white text-xs font-black uppercase tracking-wider shadow-sm transition-all cursor-pointer">
guardar en el timeline
</button>
</div>
</div>
</div>
<!-- JAVASCRIPT DE LA APLICACIÓN -->
<script>
const carousel = document.getElementById('agendaCarouselTrack');
const dots = document.querySelectorAll('.app-dot');
let selectedEmojiVal = '📝';
// Navegación en el carrusel
function scrollAppCarousel(direction) {
const step = 311; // Ancho tarjeta + conector
carousel.scrollBy({ left: direction * step, behavior: 'smooth' });
setTimeout(updateAppDots, 300);
}
function jumpToCarousel(index) {
const step = 311;
carousel.scrollTo({ left: index * step, behavior: 'smooth' });
setDotActive(index);
}
function updateAppDots() {
const step = 311;
const index = Math.min(3, Math.max(0, Math.round(carousel.scrollLeft / step)));
setDotActive(index);
}
function setDotActive(index) {
dots.forEach((dot, idx) => {
if (idx === index) {
dot.className = 'app-dot w-6 h-1.5 rounded-full bg-slate-900 transition-all cursor-pointer';
} else {
dot.className = 'app-dot w-2 h-1.5 rounded-full bg-slate-300 transition-all cursor-pointer';
}
});
}
carousel.addEventListener('scroll', () => {
clearTimeout(window.appScrollT);
window.appScrollT = setTimeout(updateAppDots, 80);
});
// Marcar/Desmarcar tarea completada estilo Structured
function toggleTaskCompletion(taskElement) {
taskElement.classList.toggle('completed');
const check = taskElement.querySelector('.check-circle');
if (taskElement.classList.contains('completed')) {
check.className = 'check-circle w-6 h-6 rounded-full bg-emerald-500 text-white flex items-center justify-center text-xs font-bold shadow-xs animate-pop';
check.textContent = '✓';
showAppToast('¡Tarea completada!');
} else {
check.className = 'check-circle w-6 h-6 rounded-full border-2 border-slate-300 bg-white flex items-center justify-center text-xs font-bold text-transparent hover:text-slate-400';
check.textContent = '✓';
}
updateProgressStats();
}
// Actualizar porcentaje de productividad
function updateProgressStats() {
const allTasks = document.querySelectorAll('#timelineTaskList .timeline-task');
const completedTasks = document.querySelectorAll('#timelineTaskList .timeline-task.completed');
const total = allTasks.length;
const done = completedTasks.length;
const pct = total === 0 ? 0 : Math.round((done / total) * 100);
document.getElementById('progressPercent').textContent = pct + '%';
document.getElementById('progressCount').textContent = `${done} de ${total}`;
}
// Insertar rutina desde el carrusel directamente al timeline
function insertRoutineToTimeline(title, time, duration, color, emoji, note) {
const list = document.getElementById('timelineTaskList');
const task = document.createElement('div');
task.className = 'relative timeline-task bg-white/95 p-3.5 border border-white flex items-center justify-between cursor-pointer shadow-xs';
task.onclick = function() { toggleTaskCompletion(task); };
task.innerHTML = `
<div class="absolute -left-[27px] top-1/2 -translate-y-1/2 w-4 h-4 rounded-full border-2 border-white shadow-xs" style="background-color: ${color}"></div>
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-full flex items-center justify-center text-lg" style="background-color: ${color}">
${emoji}
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-[10px] font-bold text-slate-800 uppercase tracking-tight">${time} • ${duration}</span>
</div>
<h5 class="task-title text-xs font-bold text-slate-900 lowercase leading-snug">
${title}
</h5>
<p class="text-[10px] text-slate-500 font-medium">${note}</p>
</div>
</div>
<div class="check-circle w-6 h-6 rounded-full border-2 border-slate-300 bg-white flex items-center justify-center text-xs font-bold text-transparent hover:text-slate-400">
✓
</div>
`;
list.appendChild(task);
updateProgressStats();
showAppToast(`"${title}" agregada al timeline`);
// Auto-scroll hacia la nueva tarea
task.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
// Modal de nueva tarea
function openNewTaskModal() {
const modal = document.getElementById('newTaskModal');
modal.classList.remove('opacity-0', 'pointer-events-none');
modal.classList.add('opacity-100');
}
function closeNewTaskModal() {
const modal = document.getElementById('newTaskModal');
modal.classList.remove('opacity-100');
modal.classList.add('opacity-0', 'pointer-events-none');
}
function selectEmoji(btn, emoji) {
document.querySelectorAll('.emoji-btn').forEach(b => b.classList.remove('bg-sky-200', 'border-sky-500'));
btn.classList.add('bg-sky-200', 'border-sky-500');
selectedEmojiVal = emoji;
}
function saveNewTask() {
const titleInput = document.getElementById('inputTaskTitle');
const title = titleInput.value.trim() || 'Recordatorio rápido';
const timeVal = document.getElementById('inputTaskTime').value || '15:00';
const duration = document.getElementById('inputTaskDuration').value;
const color = document.querySelector('input[name="colorChoice"]:checked').value;
insertRoutineToTimeline(title, timeVal, duration, color, selectedEmojiVal, 'Recordatorio personalizado');
titleInput.value = '';
closeNewTaskModal();
}
// Selector de fecha
function selectDate(btn, label) {
btn.parentElement.querySelectorAll('button').forEach(b => {
b.className = 'px-3.5 py-1.5 rounded-full bg-white/70 hover:bg-white text-slate-700 shrink-0 border border-white/80 lowercase transition-all cursor-pointer';
});
btn.className = 'px-4 py-1.5 rounded-full bg-slate-900 text-white shadow-xs shrink-0 lowercase cursor-pointer';
showAppToast(`Viendo agenda de: ${label}`);
}
// Cambiar paleta de tema
function changeTheme(viewportBg, bodyBg, name) {
document.getElementById('appViewport').style.backgroundColor = viewportBg;
document.getElementById('pageBody').style.backgroundColor = bodyBg;
showAppToast(`Tema cambiado a: ${name}`);
}
// Toast flotante dentro de la app
function showAppToast(msg) {
const notice = document.getElementById('inAppNotice');
const text = document.getElementById('inAppNoticeText');
text.textContent = msg;
notice.classList.remove('opacity-0', '-translate-y-4', 'pointer-events-none');
notice.classList.add('opacity-100', 'translate-y-0');
clearTimeout(window.noticeTimer);
window.noticeTimer = setTimeout(() => {
notice.classList.remove('opacity-100', 'translate-y-0');
notice.classList.add('opacity-0', '-translate-y-4', 'pointer-events-none');
}, 2400);
}
</script>
</body>
</html>
+938
View File
@@ -0,0 +1,938 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SiboPay — Carrusel Estilo Structured en la App</title>
<script src="https://www.gstatic.com/antigravity/web/dev/tailwindcss.min.js"></script>
<style>
/* Tipografía y suavizado idéntico a Structured */
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Scrollbar oculta para el snap carousel */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
/* Transición suave de temas */
.theme-transition {
transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s ease;
}
/* Cápsula móvil estilo Structured */
.app-card-pill {
border-radius: 36px;
box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.08), inset 0 1.5px 1px rgba(255, 255, 255, 0.85);
transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.app-card-pill:hover, .app-card-pill:active {
transform: translateY(-2px) scale(1.01);
box-shadow: 0 16px 32px -6px rgba(0, 0, 0, 0.12), inset 0 1.5px 1px rgba(255, 255, 255, 0.95);
}
/* Efecto puzzle connector entre tarjetas */
.puzzle-connector {
width: 28px;
height: 22px;
position: relative;
flex-shrink: 0;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
}
/* Discos circulares interactivos estilo Structured */
.explore-disk {
width: 68px;
height: 68px;
border-radius: 9999px;
box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.07), inset 0 1.5px 1px rgba(255, 255, 255, 0.85);
transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.explore-disk:active {
transform: scale(0.92);
}
/* Timeline vertical de Structured */
.timeline-pill {
border-radius: 26px;
box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.06), inset 0 1px 1px rgba(255, 255, 255, 0.8);
transition: transform 0.2s ease;
}
.timeline-pill:hover {
transform: translateX(3px);
}
/* Animación de pulso suave */
@keyframes gentle-pulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.85; transform: scale(1.05); }
}
.animate-gentle {
animation: gentle-pulse 3s infinite ease-in-out;
}
/* Efecto de marco de iPhone */
.iphone-shell {
box-shadow:
0 0 0 12px #1e293b,
0 0 0 14px #334155,
0 25px 60px -15px rgba(0, 0, 0, 0.35);
}
/* Animación de deslizamiento automático continuo si se activa */
@keyframes marquee-mobile {
0% { transform: translateX(0); }
100% { transform: translateX(-50%); }
}
.track-auto {
animation: marquee-mobile 24s linear infinite;
}
.track-auto:hover {
animation-play-state: paused;
}
</style>
</head>
<body id="mainBody" class="theme-transition min-h-screen font-sans bg-[#e6f4fe] text-slate-800 p-4 md:p-8 flex flex-col items-center justify-start">
<!-- HEADER DEL ESTUDIO / PRESENTACIÓN -->
<header class="w-full max-w-5xl mx-auto mb-6 flex flex-col md:flex-row items-center justify-between gap-4 bg-white/70 backdrop-blur-xl p-4 md:px-6 rounded-3xl border border-white/80 shadow-[0_8px_30px_rgba(0,0,0,0.04)]">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-2xl bg-gradient-to-tr from-sky-600 to-cyan-400 flex items-center justify-center text-white font-extrabold text-xl shadow-md">
S
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-xl font-bold tracking-tight text-slate-900">sibopay</span>
<span class="text-[11px] font-bold uppercase tracking-wider px-2.5 py-0.5 rounded-full bg-sky-100 text-sky-800 border border-sky-200">
Diseño In-App • Structured
</span>
</div>
<p class="text-xs text-slate-500 font-medium">Así luce el carrusel de cápsulas y conectores dentro de la pantalla del celular</p>
</div>
</div>
<!-- CONTROLES DEL PROTOTIPO -->
<div class="flex flex-wrap items-center gap-2">
<!-- Selector de color pastel de la App -->
<div class="flex items-center gap-1.5 bg-white/90 p-1.5 rounded-2xl border border-slate-200/80 shadow-xs">
<span class="text-[11px] font-semibold text-slate-500 pl-1.5">Fondo App:</span>
<button onclick="setTheme('#e0f2fe', '#f0f9ff')" title="Cielo SiboPay" class="w-6 h-6 rounded-full bg-[#e0f2fe] border-2 border-sky-400 hover:scale-110 transition-transform cursor-pointer"></button>
<button onclick="setTheme('#d1fae5', '#ecfdf5')" title="Menta Fresca" class="w-6 h-6 rounded-full bg-[#d1fae5] border-2 border-emerald-400 hover:scale-110 transition-transform cursor-pointer"></button>
<button onclick="setTheme('#ffedd5', '#fff7ed')" title="Melocotón Pastel" class="w-6 h-6 rounded-full bg-[#ffedd5] border-2 border-orange-400 hover:scale-110 transition-transform cursor-pointer"></button>
<button onclick="setTheme('#f3e8ff', '#faf5ff')" title="Lavanda Suave" class="w-6 h-6 rounded-full bg-[#f3e8ff] border-2 border-purple-400 hover:scale-110 transition-transform cursor-pointer"></button>
<button onclick="setTheme('#fef9c3', '#fefce8')" title="Vainilla Cálido" class="w-6 h-6 rounded-full bg-[#fef9c3] border-2 border-amber-400 hover:scale-110 transition-transform cursor-pointer"></button>
<button onclick="setTheme('#f8fafc', '#ffffff')" title="Blanco Minimalista" class="w-6 h-6 rounded-full bg-[#ffffff] border-2 border-slate-300 hover:scale-110 transition-transform cursor-pointer"></button>
</div>
<!-- Selector de Vista -->
<div class="flex items-center bg-slate-100 p-1 rounded-2xl border border-slate-200 text-xs font-semibold">
<button id="btnViewPhone" onclick="setViewMode('phone')" class="px-3 py-1.5 rounded-xl bg-white text-slate-800 shadow-xs transition-all cursor-pointer">
📱 Vista Móvil
</button>
<button id="btnViewComponent" onclick="setViewMode('component')" class="px-3 py-1.5 rounded-xl text-slate-500 hover:text-slate-800 transition-all cursor-pointer">
🔍 Zoom Componente
</button>
</div>
<!-- Botón Autoplay -->
<button id="btnAutoplay" onclick="toggleAutoFlow()" class="px-3.5 py-1.5 rounded-2xl bg-white hover:bg-slate-50 text-slate-700 text-xs font-semibold border border-slate-200 shadow-xs flex items-center gap-1.5 transition-all cursor-pointer">
<span id="autoplayIcon">▶</span>
<span id="autoplayText">Flujo Continuo</span>
</button>
</div>
</header>
<!-- CONTENEDOR PRINCIPAL: VISTA DEL CELULAR (IPHONE 16 PRO FRAME) -->
<main class="w-full max-w-5xl flex flex-col lg:flex-row items-center justify-center gap-10">
<!-- EL TELÉFONO MÓVIL CON LA APP ADENTRO -->
<div id="phoneFrame" class="iphone-shell relative w-[390px] h-[812px] bg-slate-900 rounded-[52px] p-3 flex flex-col shrink-0 select-none overflow-hidden transition-all duration-500">
<!-- Borde interno de pantalla -->
<div id="appScreen" class="theme-transition relative w-full h-full bg-[#e0f2fe] rounded-[42px] overflow-hidden flex flex-col justify-between">
<!-- STATUS BAR & DYNAMIC ISLAND -->
<div class="relative pt-3 pb-1 px-7 flex items-center justify-between z-40 text-slate-800 font-semibold text-xs tracking-tight">
<span>9:41</span>
<!-- DYNAMIC ISLAND DE APPLE -->
<div class="w-28 h-7 bg-black rounded-full flex items-center justify-between px-2.5 shadow-inner">
<div class="w-2.5 h-2.5 rounded-full bg-emerald-500 animate-pulse"></div>
<span class="text-[10px] text-white/90 font-medium tracking-wide">sibopay</span>
<div class="w-2.5 h-2.5 rounded-full bg-sky-400"></div>
</div>
<div class="flex items-center gap-1.5 text-slate-800">
<svg class="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor"><path d="M12 3c-4.97 0-9 4.03-9 9 0 2.12.74 4.07 1.97 5.61L12 22l7.03-4.39C20.26 16.07 21 14.12 21 12c0-4.97-4.03-9-9-9z"/></svg>
<svg class="w-3.5 h-3.5" viewBox="0 0 24 24" fill="currentColor"><path d="M2 17h20v2H2zm1.15-4.05L4 11.47l.85 1.48L6 12.33V17H4v-4.05zM9 17h2v-7H9v7zm5 0h2V7h-2v10zm5 0h2V4h-2v13z"/></svg>
<div class="w-5 h-2.5 border border-slate-700 rounded-sm p-0.5 flex items-center">
<div class="w-full h-full bg-slate-800 rounded-2xs"></div>
</div>
</div>
</div>
<!-- APP BODY SCROLLABLE -->
<div id="appScrollArea" class="flex-1 overflow-y-auto no-scrollbar pb-24 px-4 pt-2">
<!-- APP TOP HEADER CON PERFIL Y SALDO -->
<div class="flex items-center justify-between mb-4 pt-1">
<div class="flex items-center gap-2.5">
<div class="relative">
<img src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=100&auto=format&fit=crop&q=80" alt="Avatar" class="w-10 h-10 rounded-full object-cover border-2 border-white shadow-xs">
<div class="absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 rounded-full bg-emerald-500 border-2 border-white"></div>
</div>
<div>
<div class="flex items-center gap-1 text-[11px] font-semibold text-slate-500 lowercase">
<span>colegio saint paul</span>
<span>•</span>
<span>2° A</span>
</div>
<h2 class="text-sm font-extrabold text-slate-900 tracking-tight leading-tight lowercase">
hola, mateo 👋
</h2>
</div>
</div>
<!-- CHIP DE SALDO CON GLOW SUAVE -->
<div onclick="showToast('Saldo disponible: ₡14.500')" class="flex flex-col items-end bg-white/80 backdrop-blur-md px-3 py-1.5 rounded-2xl border border-white/90 shadow-xs cursor-pointer active:scale-95 transition-transform">
<span class="text-[10px] uppercase font-bold text-slate-400 tracking-wider">saldo disponible</span>
<span class="text-sm font-extrabold text-slate-900">₡14.500</span>
</div>
</div>
<!-- SELECTOR HORIZONTAL DE DÍAS Y RUTINAS (ESTILO STRUCTURED) -->
<div class="flex items-center gap-2 overflow-x-auto no-scrollbar py-1 mb-4 text-xs font-semibold">
<button class="px-3.5 py-1.5 rounded-full bg-slate-900 text-white shadow-sm shrink-0 lowercase">
hoy, 10 oct
</button>
<button class="px-3.5 py-1.5 rounded-full bg-white/70 hover:bg-white text-slate-700 shrink-0 border border-white/80 lowercase transition-colors">
recreo 1
</button>
<button class="px-3.5 py-1.5 rounded-full bg-white/70 hover:bg-white text-slate-700 shrink-0 border border-white/80 lowercase transition-colors">
almuerzo
</button>
<button class="px-3.5 py-1.5 rounded-full bg-white/70 hover:bg-white text-slate-700 shrink-0 border border-white/80 lowercase transition-colors">
recreo 2
</button>
<button class="px-3.5 py-1.5 rounded-full bg-white/70 hover:bg-white text-slate-700 shrink-0 border border-white/80 lowercase transition-colors">
servicios
</button>
</div>
<!-- ======================================================== -->
<!-- SECCIÓN PROTAGONISTA: EL CARRUSEL ESTILO STRUCTURED EN LA APP -->
<!-- ======================================================== -->
<div class="mb-6">
<div class="flex items-center justify-between mb-2.5 px-1">
<div>
<span class="text-[10px] font-bold tracking-wider uppercase text-sky-800/80">combos & promociones</span>
<h3 class="text-base font-extrabold text-slate-900 tracking-tight lowercase">
destacados del día
</h3>
</div>
<!-- Mini Flechas de Navegación -->
<div class="flex items-center gap-1.5">
<button onclick="scrollCarousel(-1)" class="w-7 h-7 rounded-full bg-white/80 hover:bg-white border border-white flex items-center justify-center text-slate-700 shadow-2xs active:scale-90 transition-all cursor-pointer">
‹
</button>
<button onclick="scrollCarousel(1)" class="w-7 h-7 rounded-full bg-white/80 hover:bg-white border border-white flex items-center justify-center text-slate-700 shadow-2xs active:scale-90 transition-all cursor-pointer">
›
</button>
</div>
</div>
<!-- CONTENEDOR DEL CARRUSEL DE CÁPSULAS CONECTADAS -->
<div class="relative overflow-hidden py-2 -mx-4 px-4 mask-fade">
<div id="appCarouselTrack" class="flex items-center overflow-x-auto no-scrollbar scroll-smooth snap-x snap-mandatory py-1" style="scroll-padding-left: 16px;">
<!-- ================= CARD 1 (PASTEL SKY) ================= -->
<div class="app-card-pill snap-start shrink-0 w-[295px] h-[155px] bg-[#e0f2fe] p-4 flex flex-col justify-between relative cursor-pointer border border-sky-200/50" onclick="selectCard('Combo Recreo Saludable', '1.850')">
<!-- Fila superior -->
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-8 h-8 rounded-full bg-white/90 shadow-2xs flex items-center justify-center text-lg">
🥪
</div>
<span class="text-[11px] font-bold text-sky-900/80 uppercase tracking-wide">
recreo 1 • 09:30 am
</span>
</div>
<span class="text-[10px] font-extrabold px-2 py-0.5 rounded-full bg-sky-200/70 text-sky-900 lowercase">
popular
</span>
</div>
<!-- Título y descripción -->
<div>
<h4 class="text-sm font-extrabold text-slate-900 tracking-tight leading-snug lowercase">
sandwich artesanal & jugo
</h4>
<p class="text-[11px] text-slate-600 line-clamp-1 font-medium mt-0.5">
jamón de pavo, queso suizo y jugo de naranja
</p>
</div>
<!-- Fila inferior: Precio y Botón Rápido -->
<div class="flex items-center justify-between pt-1">
<div class="flex items-baseline gap-1">
<span class="text-xs font-bold text-slate-400">₡</span>
<span class="text-base font-black text-slate-900 tracking-tight">1.850</span>
</div>
<button onclick="event.stopPropagation(); orderItem('Sandwich & Jugo', '1.850')" class="px-3 py-1 rounded-full bg-slate-900 hover:bg-sky-600 active:scale-95 text-white text-[11px] font-bold transition-all shadow-xs flex items-center gap-1 cursor-pointer">
<span>pre-ordenar</span>
<span>+</span>
</button>
</div>
</div>
<!-- CONECTOR PUZZLE 1 (Sky a Mint) -->
<div class="puzzle-connector">
<svg width="28" height="22" viewBox="0 0 28 22" fill="none">
<!-- Base izquierda (Sky) -->
<path d="M0 0 H12 C12 6, 17 6, 17 11 C17 16, 12 16, 12 22 H0 Z" fill="#e0f2fe"/>
<!-- Cabeza encajada derecha (Mint) -->
<path d="M12 0 H28 V22 H12 C12 16, 17 16, 17 11 C17 6, 12 6, 12 0 Z" fill="#d1fae5"/>
<!-- Línea de junta tipo rompecabezas -->
<path d="M12 0 C12 6, 17 6, 17 11 C17 16, 12 16, 12 22" stroke="rgba(0,0,0,0.06)" stroke-width="1.5" stroke-linecap="round"/>
</svg>
</div>
<!-- ================= CARD 2 (PASTEL MINT) ================= -->
<div class="app-card-pill snap-start shrink-0 w-[295px] h-[155px] bg-[#d1fae5] p-4 flex flex-col justify-between relative cursor-pointer border border-emerald-200/50" onclick="selectCard('Recarga Inmediata SINPE', 'Personalizado')">
<!-- Fila superior -->
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-8 h-8 rounded-full bg-white/90 shadow-2xs flex items-center justify-center text-lg">
⚡
</div>
<span class="text-[11px] font-bold text-emerald-950/80 uppercase tracking-wide">
sinpe móvil directo
</span>
</div>
<span class="text-[10px] font-extrabold px-2 py-0.5 rounded-full bg-emerald-200/80 text-emerald-900 lowercase">
inmediato
</span>
</div>
<!-- Título y descripción -->
<div>
<h4 class="text-sm font-extrabold text-slate-900 tracking-tight leading-snug lowercase">
recarga de saldo en 1 toque
</h4>
<p class="text-[11px] text-slate-600 line-clamp-1 font-medium mt-0.5">
acreditación sin comisión al número 8888-7777
</p>
</div>
<!-- Fila inferior: Precio y Botón Rápido -->
<div class="flex items-center justify-between pt-1">
<div class="text-[11px] font-extrabold text-emerald-900">
0% comisiones
</div>
<button onclick="event.stopPropagation(); openSinpeModal()" class="px-3 py-1 rounded-full bg-emerald-900 hover:bg-emerald-800 active:scale-95 text-white text-[11px] font-bold transition-all shadow-xs flex items-center gap-1 cursor-pointer">
<span>recargar</span>
<span>⚡</span>
</button>
</div>
</div>
<!-- CONECTOR PUZZLE 2 (Mint a Peach) -->
<div class="puzzle-connector">
<svg width="28" height="22" viewBox="0 0 28 22" fill="none">
<path d="M0 0 H12 C12 6, 17 6, 17 11 C17 16, 12 16, 12 22 H0 Z" fill="#d1fae5"/>
<path d="M12 0 H28 V22 H12 C12 16, 17 16, 17 11 C17 6, 12 6, 12 0 Z" fill="#ffedd5"/>
<path d="M12 0 C12 6, 17 6, 17 11 C17 16, 12 16, 12 22" stroke="rgba(0,0,0,0.06)" stroke-width="1.5" stroke-linecap="round"/>
</svg>
</div>
<!-- ================= CARD 3 (PASTEL PEACH) ================= -->
<div class="app-card-pill snap-start shrink-0 w-[295px] h-[155px] bg-[#ffedd5] p-4 flex flex-col justify-between relative cursor-pointer border border-orange-200/50" onclick="selectCard('Casado Gourmet del Chef', '2.600')">
<!-- Fila superior -->
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-8 h-8 rounded-full bg-white/90 shadow-2xs flex items-center justify-center text-lg">
🍛
</div>
<span class="text-[11px] font-bold text-orange-950/80 uppercase tracking-wide">
almuerzo • 11:45 am
</span>
</div>
<span class="text-[10px] font-extrabold px-2 py-0.5 rounded-full bg-orange-200/80 text-orange-900 lowercase">
menú chef
</span>
</div>
<!-- Título y descripción -->
<div>
<h4 class="text-sm font-extrabold text-slate-900 tracking-tight leading-snug lowercase">
casado completo con pollo
</h4>
<p class="text-[11px] text-slate-600 line-clamp-1 font-medium mt-0.5">
arroz, frijoles, plátano maduro, ensalada y té frío
</p>
</div>
<!-- Fila inferior: Precio y Botón Rápido -->
<div class="flex items-center justify-between pt-1">
<div class="flex items-baseline gap-1">
<span class="text-xs font-bold text-slate-400">₡</span>
<span class="text-base font-black text-slate-900 tracking-tight">2.600</span>
</div>
<button onclick="event.stopPropagation(); orderItem('Casado Gourmet', '2.600')" class="px-3 py-1 rounded-full bg-orange-950 hover:bg-orange-900 active:scale-95 text-white text-[11px] font-bold transition-all shadow-xs flex items-center gap-1 cursor-pointer">
<span>reservar</span>
<span>+</span>
</button>
</div>
</div>
<!-- CONECTOR PUZZLE 3 (Peach a Lavender) -->
<div class="puzzle-connector">
<svg width="28" height="22" viewBox="0 0 28 22" fill="none">
<path d="M0 0 H12 C12 6, 17 6, 17 11 C17 16, 12 16, 12 22 H0 Z" fill="#ffedd5"/>
<path d="M12 0 H28 V22 H12 C12 16, 17 16, 17 11 C17 6, 12 6, 12 0 Z" fill="#f3e8ff"/>
<path d="M12 0 C12 6, 17 6, 17 11 C17 16, 12 16, 12 22" stroke="rgba(0,0,0,0.06)" stroke-width="1.5" stroke-linecap="round"/>
</svg>
</div>
<!-- ================= CARD 4 (PASTEL LAVENDER) ================= -->
<div class="app-card-pill snap-start shrink-0 w-[295px] h-[155px] bg-[#f3e8ff] p-4 flex flex-col justify-between relative cursor-pointer border border-purple-200/50" onclick="selectCard('Aviso: Viernes de Pizza Artesanal', 'Cupos Limitados')">
<!-- Fila superior -->
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-8 h-8 rounded-full bg-white/90 shadow-2xs flex items-center justify-center text-lg">
📢
</div>
<span class="text-[11px] font-bold text-purple-950/80 uppercase tracking-wide">
aviso cafeteria
</span>
</div>
<span class="text-[10px] font-extrabold px-2 py-0.5 rounded-full bg-purple-200/80 text-purple-900 lowercase">
especial
</span>
</div>
<!-- Título y descripción -->
<div>
<h4 class="text-sm font-extrabold text-slate-900 tracking-tight leading-snug lowercase">
viernes de pizza horneada
</h4>
<p class="text-[11px] text-slate-600 line-clamp-1 font-medium mt-0.5">
pre-órdenes abiertas hasta el jueves 4:00 pm
</p>
</div>
<!-- Fila inferior: Botón Informativo -->
<div class="flex items-center justify-between pt-1">
<span class="text-[11px] font-bold text-purple-900">
cupos 48/80
</span>
<button onclick="event.stopPropagation(); showToast('Aviso: Puedes apartar tu porción desde la pestaña Menú')" class="px-3 py-1 rounded-full bg-purple-950 hover:bg-purple-900 active:scale-95 text-white text-[11px] font-bold transition-all shadow-xs flex items-center gap-1 cursor-pointer">
<span>ver aviso</span>
<span>›</span>
</button>
</div>
</div>
<!-- CONECTOR PUZZLE 4 (Lavender a Lemon) -->
<div class="puzzle-connector">
<svg width="28" height="22" viewBox="0 0 28 22" fill="none">
<path d="M0 0 H12 C12 6, 17 6, 17 11 C17 16, 12 16, 12 22 H0 Z" fill="#f3e8ff"/>
<path d="M12 0 H28 V22 H12 C12 16, 17 16, 17 11 C17 6, 12 6, 12 0 Z" fill="#fef9c3"/>
<path d="M12 0 C12 6, 17 6, 17 11 C17 16, 12 16, 12 22" stroke="rgba(0,0,0,0.06)" stroke-width="1.5" stroke-linecap="round"/>
</svg>
</div>
<!-- ================= CARD 5 (PASTEL LEMON) ================= -->
<div class="app-card-pill snap-start shrink-0 w-[295px] h-[155px] bg-[#fef9c3] p-4 flex flex-col justify-between relative cursor-pointer border border-amber-200/50" onclick="selectCard('Bowl de Fruta & Granola', '1.200')">
<!-- Fila superior -->
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-8 h-8 rounded-full bg-white/90 shadow-2xs flex items-center justify-center text-lg">
🍎
</div>
<span class="text-[11px] font-bold text-amber-950/80 uppercase tracking-wide">
snack saludable
</span>
</div>
<span class="text-[10px] font-extrabold px-2 py-0.5 rounded-full bg-amber-200/80 text-amber-950 lowercase">
100% natural
</span>
</div>
<!-- Título y descripción -->
<div>
<h4 class="text-sm font-extrabold text-slate-900 tracking-tight leading-snug lowercase">
bowl de frutas & miel
</h4>
<p class="text-[11px] text-slate-600 line-clamp-1 font-medium mt-0.5">
fresas, banano, piña, yogurt griego y avena
</p>
</div>
<!-- Fila inferior -->
<div class="flex items-center justify-between pt-1">
<div class="flex items-baseline gap-1">
<span class="text-xs font-bold text-slate-400">₡</span>
<span class="text-base font-black text-slate-900 tracking-tight">1.200</span>
</div>
<button onclick="event.stopPropagation(); orderItem('Bowl de Frutas', '1.200')" class="px-3 py-1 rounded-full bg-amber-950 hover:bg-amber-900 active:scale-95 text-white text-[11px] font-bold transition-all shadow-xs flex items-center gap-1 cursor-pointer">
<span>pedir</span>
<span>+</span>
</button>
</div>
</div>
</div>
</div>
<!-- INDICADORES DE PÍLDORA (STRUCTURED DOTS) -->
<div class="flex items-center justify-center gap-1.5 mt-2">
<button onclick="goToSlide(0)" class="carousel-dot w-6 h-1.5 rounded-full bg-slate-900 transition-all cursor-pointer"></button>
<button onclick="goToSlide(1)" class="carousel-dot w-2 h-1.5 rounded-full bg-slate-300 transition-all cursor-pointer"></button>
<button onclick="goToSlide(2)" class="carousel-dot w-2 h-1.5 rounded-full bg-slate-300 transition-all cursor-pointer"></button>
<button onclick="goToSlide(3)" class="carousel-dot w-2 h-1.5 rounded-full bg-slate-300 transition-all cursor-pointer"></button>
<button onclick="goToSlide(4)" class="carousel-dot w-2 h-1.5 rounded-full bg-slate-300 transition-all cursor-pointer"></button>
</div>
</div>
<!-- ======================================================== -->
<!-- DISCOS CIRCULARES DE ACCIÓN RÁPIDA (ESTILO STRUCTURED) -->
<!-- ======================================================== -->
<div class="mb-6">
<div class="flex items-center justify-between mb-3 px-1">
<h3 class="text-xs font-bold text-slate-700 tracking-tight lowercase">
accesos directos
</h3>
<span class="text-[10px] text-slate-400 font-semibold lowercase">toca para abrir</span>
</div>
<div class="grid grid-cols-4 gap-2 text-center">
<!-- Disco 1 -->
<div onclick="openSinpeModal()" class="flex flex-col items-center gap-1.5 cursor-pointer group">
<div class="explore-disk bg-[#d1fae5] flex items-center justify-center text-2xl group-hover:scale-105 transition-transform border border-emerald-200/60">
⚡
</div>
<span class="text-[11px] font-bold text-slate-700 lowercase">recarga</span>
</div>
<!-- Disco 2 -->
<div onclick="showToast('Carné Escolar QR listo para presentar')" class="flex flex-col items-center gap-1.5 cursor-pointer group">
<div class="explore-disk bg-[#e0f2fe] flex items-center justify-center text-2xl group-hover:scale-105 transition-transform border border-sky-200/60">
📱
</div>
<span class="text-[11px] font-bold text-slate-700 lowercase">mi qr</span>
</div>
<!-- Disco 3 -->
<div onclick="showToast('Mostrando menú completo de la soda escolar')" class="flex flex-col items-center gap-1.5 cursor-pointer group">
<div class="explore-disk bg-[#ffedd5] flex items-center justify-center text-2xl group-hover:scale-105 transition-transform border border-orange-200/60">
🥪
</div>
<span class="text-[11px] font-bold text-slate-700 lowercase">menú</span>
</div>
<!-- Disco 4 -->
<div onclick="showToast('Perfil nutricional: Sin alergias registradas')" class="flex flex-col items-center gap-1.5 cursor-pointer group">
<div class="explore-disk bg-[#f3e8ff] flex items-center justify-center text-2xl group-hover:scale-105 transition-transform border border-purple-200/60">
❤️
</div>
<span class="text-[11px] font-bold text-slate-700 lowercase">nutrición</span>
</div>
</div>
</div>
<!-- ======================================================== -->
<!-- AGENDA DEL DÍA: TIMELINE VISUAL EN CÁPSULAS CONECTADAS -->
<!-- ======================================================== -->
<div class="mb-4">
<div class="flex items-center justify-between mb-3 px-1">
<div>
<span class="text-[10px] font-bold tracking-wider uppercase text-slate-400">horario estructurado</span>
<h3 class="text-sm font-extrabold text-slate-900 tracking-tight lowercase">
timeline de hoy
</h3>
</div>
<span class="text-[11px] font-semibold text-sky-800 bg-white/80 px-2 py-0.5 rounded-full border border-sky-100">
4 eventos
</span>
</div>
<!-- Contenedor con línea vertical continua estilo Structured -->
<div class="relative pl-6 space-y-3">
<!-- Línea vertical conectora -->
<div class="absolute left-2.5 top-3 bottom-3 w-0.5 bg-slate-300/70 rounded-full"></div>
<!-- Item 1: Entrada y desayuno -->
<div class="relative timeline-pill bg-white/85 p-3.5 border border-white flex items-center justify-between cursor-pointer">
<div class="absolute -left-6 top-1/2 -translate-y-1/2 w-3.5 h-3.5 rounded-full bg-sky-500 border-2 border-white shadow-xs"></div>
<div class="flex items-center gap-2.5">
<div class="w-8 h-8 rounded-full bg-[#e0f2fe] flex items-center justify-center text-sm">
🥛
</div>
<div>
<h5 class="text-xs font-bold text-slate-900 lowercase leading-tight">desayuno ligero</h5>
<p class="text-[10px] text-slate-500 font-medium">07:15 am • cafetería principal</p>
</div>
</div>
<span class="text-[10px] font-bold px-2 py-0.5 rounded-full bg-slate-100 text-slate-500">completado</span>
</div>
<!-- Item 2: Primer recreo (activo) -->
<div class="relative timeline-pill bg-[#d1fae5]/90 p-3.5 border border-emerald-200/80 flex items-center justify-between cursor-pointer shadow-xs">
<div class="absolute -left-6 top-1/2 -translate-y-1/2 w-3.5 h-3.5 rounded-full bg-emerald-500 border-2 border-white shadow-xs animate-gentle"></div>
<div class="flex items-center gap-2.5">
<div class="w-8 h-8 rounded-full bg-white flex items-center justify-center text-sm shadow-2xs">
🥪
</div>
<div>
<div class="flex items-center gap-1.5">
<h5 class="text-xs font-extrabold text-emerald-950 lowercase leading-tight">primer recreo: retiro combo</h5>
<span class="w-1.5 h-1.5 rounded-full bg-emerald-600 animate-ping"></span>
</div>
<p class="text-[10px] text-emerald-800 font-medium">09:30 am • ventanilla rápida #2</p>
</div>
</div>
<span class="text-[10px] font-black px-2 py-0.5 rounded-full bg-emerald-600 text-white shadow-2xs">en curso</span>
</div>
<!-- Item 3: Almuerzo -->
<div class="relative timeline-pill bg-white/85 p-3.5 border border-white flex items-center justify-between cursor-pointer">
<div class="absolute -left-6 top-1/2 -translate-y-1/2 w-3.5 h-3.5 rounded-full bg-slate-300 border-2 border-white"></div>
<div class="flex items-center gap-2.5">
<div class="w-8 h-8 rounded-full bg-[#ffedd5] flex items-center justify-center text-sm">
🍛
</div>
<div>
<h5 class="text-xs font-bold text-slate-900 lowercase leading-tight">almuerzo en comedor</h5>
<p class="text-[10px] text-slate-500 font-medium">11:45 am • casado con pollo</p>
</div>
</div>
<span class="text-[10px] font-bold px-2 py-0.5 rounded-full bg-orange-100 text-orange-800">reservado</span>
</div>
<!-- Item 4: Segundo Recreo -->
<div class="relative timeline-pill bg-white/85 p-3.5 border border-white flex items-center justify-between cursor-pointer">
<div class="absolute -left-6 top-1/2 -translate-y-1/2 w-3.5 h-3.5 rounded-full bg-slate-300 border-2 border-white"></div>
<div class="flex items-center gap-2.5">
<div class="w-8 h-8 rounded-full bg-[#f3e8ff] flex items-center justify-center text-sm">
🍎
</div>
<div>
<h5 class="text-xs font-bold text-slate-900 lowercase leading-tight">segundo recreo: snack</h5>
<p class="text-[10px] text-slate-500 font-medium">01:45 pm • bowl de frutas</p>
</div>
</div>
<span class="text-[10px] font-bold px-2 py-0.5 rounded-full bg-purple-100 text-purple-800">pendiente</span>
</div>
</div>
</div>
</div>
<!-- BARRA INFERIOR FLOTANTE LIQUID GLASS (BOTTOM DOCK) -->
<div class="absolute bottom-3 left-4 right-4 z-40">
<div class="bg-white/80 backdrop-blur-2xl px-5 py-2.5 rounded-full border border-white/90 shadow-[0_10px_25px_-5px_rgba(0,0,0,0.1)] flex items-center justify-between">
<!-- Tab Inicio (Activo) -->
<button class="flex flex-col items-center gap-0.5 text-sky-800 cursor-pointer">
<div class="w-5 h-5 flex items-center justify-center font-bold">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/></svg>
</div>
<span class="text-[9px] font-extrabold lowercase">inicio</span>
</button>
<!-- Tab Menú -->
<button onclick="showToast('Sección Menú y Pedidos')" class="flex flex-col items-center gap-0.5 text-slate-400 hover:text-slate-800 cursor-pointer transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h7"/></svg>
<span class="text-[9px] font-semibold lowercase">menú</span>
</button>
<!-- Botón Central Destacado (Pagar QR) -->
<button onclick="showToast('Activando lector QR para pagar en caja')" class="w-11 h-11 -mt-5 rounded-full bg-slate-900 hover:bg-sky-600 text-white flex items-center justify-center shadow-lg active:scale-90 transition-all cursor-pointer">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm12 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1zM5 20h2a1 1 0 001-1v-2a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1z"/></svg>
</button>
<!-- Tab Agenda -->
<button onclick="showToast('Vista de Timeline completo')" class="flex flex-col items-center gap-0.5 text-slate-400 hover:text-slate-800 cursor-pointer transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>
<span class="text-[9px] font-semibold lowercase">agenda</span>
</button>
<!-- Tab Perfil -->
<button onclick="showToast('Perfil y ajustes de cuenta')" class="flex flex-col items-center gap-0.5 text-slate-400 hover:text-slate-800 cursor-pointer transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
<span class="text-[9px] font-semibold lowercase">perfil</span>
</button>
</div>
</div>
<!-- HOME INDICATOR (BARRA INFERIOR DE IPHONE) -->
<div class="absolute bottom-1 left-1/2 -translate-x-1/2 w-32 h-1 bg-slate-900/40 rounded-full z-50 pointer-events-none"></div>
<!-- TOAST FLOTANTE IN-APP -->
<div id="inAppToast" class="absolute top-16 left-6 right-6 z-50 bg-slate-900/90 backdrop-blur-md text-white px-4 py-2.5 rounded-2xl text-xs font-semibold shadow-xl flex items-center justify-between transition-all duration-300 opacity-0 -translate-y-4 pointer-events-none">
<span id="inAppToastText">¡Pre-orden agregada con éxito!</span>
<span class="text-emerald-400">✓</span>
</div>
</div>
</div>
<!-- PANEL LATERAL EXPLICATIVO Y DETALLES DE DISEÑO -->
<div class="w-full max-w-md flex flex-col gap-5">
<!-- TARJETA EXPLICATIVA DE CÓMO SE ADAPTÓ STRUCTURED A LA APP -->
<div class="bg-white/80 backdrop-blur-xl p-6 rounded-3xl border border-white/90 shadow-sm">
<div class="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-sky-100 text-sky-800 text-[11px] font-bold mb-3">
<span>✨ Claves del Diseño Structured en la App</span>
</div>
<h3 class="text-xl font-extrabold text-slate-900 tracking-tight lowercase mb-2">
¿por qué se ve exactamente como structured?
</h3>
<p class="text-sm text-slate-600 font-medium mb-4 leading-relaxed">
Structured destaca por tres elementos gráficos inconfundibles que fueron trasladados a la escala real de una pantalla móvil (390px):
</p>
<div class="space-y-3 text-xs">
<!-- Punto 1 -->
<div class="flex items-start gap-3 p-3 rounded-2xl bg-sky-50/70 border border-sky-100">
<span class="text-lg">🧩</span>
<div>
<strong class="text-slate-900 font-bold block lowercase">1. conectores de rompecabezas vectoriales</strong>
<p class="text-slate-600 mt-0.5">En lugar de tarjetas sueltas, cada cápsula se encaja con la siguiente mediante juntas de rompecabezas con colores que coinciden exactamente con ambas tarjetas.</p>
</div>
</div>
<!-- Punto 2 -->
<div class="flex items-start gap-3 p-3 rounded-2xl bg-emerald-50/70 border border-emerald-100">
<span class="text-lg">🎨</span>
<div>
<strong class="text-slate-900 font-bold block lowercase">2. paleta pastel de alto contraste</strong>
<p class="text-slate-600 mt-0.5">Cielo SiboPay (<code class="bg-white px-1 py-0.5 rounded text-[10px]">#e0f2fe</code>), Menta (<code class="bg-white px-1 py-0.5 rounded text-[10px]">#d1fae5</code>), Melocotón (<code class="bg-white px-1 py-0.5 rounded text-[10px]">#ffedd5</code>) y Lavanda con texto legible y oscuro.</p>
</div>
</div>
<!-- Punto 3 -->
<div class="flex items-start gap-3 p-3 rounded-2xl bg-orange-50/70 border border-orange-100">
<span class="text-lg">📱</span>
<div>
<strong class="text-slate-900 font-bold block lowercase">3. snap swipe + micro-interacciones</strong>
<p class="text-slate-600 mt-0.5">El usuario puede deslizar con el dedo en el móvil (touch snap) y cada combo se pre-ordena con un solo toque, sincronizado con el timeline escolar del día.</p>
</div>
</div>
</div>
</div>
<!-- TARJETA DE PRUEBA INTERACTIVA RÁPIDA -->
<div class="bg-white/80 backdrop-blur-xl p-5 rounded-3xl border border-white/90 shadow-sm flex flex-col gap-3">
<h4 class="text-xs font-bold text-slate-400 uppercase tracking-wider">
acciones interactivas para probar ahora
</h4>
<div class="grid grid-cols-2 gap-2 text-xs font-bold">
<button onclick="orderItem('Sandwich de Pavo', '1.850')" class="p-2.5 rounded-2xl bg-sky-500 hover:bg-sky-600 text-white transition-all shadow-xs cursor-pointer text-center">
🥪 Pre-ordenar Combo
</button>
<button onclick="openSinpeModal()" class="p-2.5 rounded-2xl bg-emerald-600 hover:bg-emerald-700 text-white transition-all shadow-xs cursor-pointer text-center">
⚡ Simular Recarga
</button>
<button onclick="scrollCarousel(1)" class="p-2.5 rounded-2xl bg-slate-900 hover:bg-slate-800 text-white transition-all shadow-xs cursor-pointer text-center">
› Siguiente Cápsula
</button>
<button onclick="toggleAutoFlow()" class="p-2.5 rounded-2xl bg-amber-500 hover:bg-amber-600 text-white transition-all shadow-xs cursor-pointer text-center">
🔄 Desplazamiento
</button>
</div>
</div>
</div>
</main>
<!-- MODAL DE SIMULACIÓN SINPE DENTRO DE LA EXPERIENCIA -->
<div id="sinpeModal" class="fixed inset-0 z-50 bg-black/40 backdrop-blur-xs flex items-center justify-center p-4 opacity-0 pointer-events-none transition-opacity duration-300">
<div class="bg-white rounded-3xl p-6 max-w-sm w-full shadow-2xl border border-slate-100 flex flex-col items-center text-center">
<div class="w-14 h-14 rounded-full bg-[#d1fae5] text-emerald-700 flex items-center justify-center text-2xl mb-3 shadow-inner">
⚡
</div>
<h3 class="text-lg font-black text-slate-900 tracking-tight lowercase">recarga rápida sinpe móvil</h3>
<p class="text-xs text-slate-500 font-medium mt-1 mb-4">Envía tu comprobante al <strong class="text-slate-800">8888-7777</strong> o digita el monto a abonar a la cuenta de Mateo.</p>
<div class="w-full flex items-center justify-center gap-2 mb-4">
<button onclick="executeReload(2000)" class="flex-1 py-2 rounded-2xl bg-slate-100 hover:bg-emerald-100 text-xs font-bold text-slate-800 transition-colors">₡2.000</button>
<button onclick="executeReload(5000)" class="flex-1 py-2 rounded-2xl bg-slate-100 hover:bg-emerald-100 text-xs font-bold text-slate-800 transition-colors">₡5.000</button>
<button onclick="executeReload(10000)" class="flex-1 py-2 rounded-2xl bg-slate-100 hover:bg-emerald-100 text-xs font-bold text-slate-800 transition-colors">₡10.000</button>
</div>
<div class="w-full flex items-center gap-2">
<button onclick="closeSinpeModal()" class="flex-1 py-2.5 rounded-full bg-slate-100 text-slate-700 text-xs font-bold hover:bg-slate-200 transition-colors cursor-pointer">
Cancelar
</button>
<button onclick="executeReload(5000)" class="flex-1 py-2.5 rounded-full bg-emerald-600 text-white text-xs font-bold hover:bg-emerald-700 transition-colors shadow-sm cursor-pointer">
Acreditar ya
</button>
</div>
</div>
</div>
<!-- JAVASCRIPT INTERACTIVO -->
<script>
const carouselTrack = document.getElementById('appCarouselTrack');
const dots = document.querySelectorAll('.carousel-dot');
let autoFlowInterval = null;
let isAutoFlowing = false;
// Cambiar color de fondo general y de la app
function setTheme(appBg, bodyBg) {
document.getElementById('appScreen').style.backgroundColor = appBg;
document.getElementById('mainBody').style.backgroundColor = bodyBg;
}
// Navegación con mini flechas
function scrollCarousel(direction) {
const cardWidth = 323; // Ancho tarjeta + conector
carouselTrack.scrollBy({ left: direction * cardWidth, behavior: 'smooth' });
setTimeout(updateActiveDot, 300);
}
function goToSlide(index) {
const cardWidth = 323;
carouselTrack.scrollTo({ left: index * cardWidth, behavior: 'smooth' });
updateDots(index);
}
// Actualizar indicador activo
function updateActiveDot() {
const scrollPos = carouselTrack.scrollLeft;
const cardWidth = 323;
const activeIndex = Math.min(4, Math.max(0, Math.round(scrollPos / cardWidth)));
updateDots(activeIndex);
}
function updateDots(activeIndex) {
dots.forEach((dot, idx) => {
if (idx === activeIndex) {
dot.classList.remove('w-2', 'bg-slate-300');
dot.classList.add('w-6', 'bg-slate-900');
} else {
dot.classList.remove('w-6', 'bg-slate-900');
dot.classList.add('w-2', 'bg-slate-300');
}
});
}
carouselTrack.addEventListener('scroll', () => {
clearTimeout(window.scrollTimeout);
window.scrollTimeout = setTimeout(updateActiveDot, 100);
});
// Activar o desactivar flujo automático
function toggleAutoFlow() {
const btn = document.getElementById('btnAutoplay');
const icon = document.getElementById('autoplayIcon');
const text = document.getElementById('autoplayText');
if (isAutoFlowing) {
clearInterval(autoFlowInterval);
isAutoFlowing = false;
icon.textContent = '▶';
text.textContent = 'Flujo Continuo';
btn.classList.remove('bg-emerald-100', 'text-emerald-900');
btn.classList.add('bg-white', 'text-slate-700');
} else {
isAutoFlowing = true;
icon.textContent = '⏸';
text.textContent = 'Pausar Flujo';
btn.classList.remove('bg-white', 'text-slate-700');
btn.classList.add('bg-emerald-100', 'text-emerald-900');
autoFlowInterval = setInterval(() => {
const maxScroll = carouselTrack.scrollWidth - carouselTrack.clientWidth;
if (carouselTrack.scrollLeft >= maxScroll - 10) {
carouselTrack.scrollTo({ left: 0, behavior: 'smooth' });
} else {
scrollCarousel(1);
}
}, 3200);
}
}
// Mostrar Toast dentro de la pantalla del móvil
function showToast(message) {
const toast = document.getElementById('inAppToast');
const text = document.getElementById('inAppToastText');
text.textContent = message;
toast.classList.remove('opacity-0', '-translate-y-4', 'pointer-events-none');
toast.classList.add('opacity-100', 'translate-y-0');
clearTimeout(window.toastTimer);
window.toastTimer = setTimeout(() => {
toast.classList.remove('opacity-100', 'translate-y-0');
toast.classList.add('opacity-0', '-translate-y-4', 'pointer-events-none');
}, 2600);
}
function orderItem(name, price) {
showToast(`¡Pre-orden: ${name} (₡${price}) agendada para el recreo!`);
}
function selectCard(title, price) {
showToast(`Detalle: ${title} • ₡${price}`);
}
// Modal de SINPE Móvil
function openSinpeModal() {
const modal = document.getElementById('sinpeModal');
modal.classList.remove('opacity-0', 'pointer-events-none');
modal.classList.add('opacity-100');
}
function closeSinpeModal() {
const modal = document.getElementById('sinpeModal');
modal.classList.remove('opacity-100');
modal.classList.add('opacity-0', 'pointer-events-none');
}
function executeReload(amount) {
closeSinpeModal();
showToast(`¡Recarga de ₡${amount.toLocaleString()} aplicada con éxito!`);
}
// Modo de Vista: Teléfono vs Zoom de Componente
function setViewMode(mode) {
const frame = document.getElementById('phoneFrame');
const btnPhone = document.getElementById('btnViewPhone');
const btnComp = document.getElementById('btnViewComponent');
if (mode === 'component') {
frame.classList.remove('w-[390px]', 'h-[812px]', 'rounded-[52px]', 'p-3');
frame.classList.add('w-full', 'max-w-xl', 'h-[640px]', 'rounded-3xl', 'p-1', 'scale-105');
btnComp.classList.add('bg-white', 'text-slate-800', 'shadow-xs');
btnComp.classList.remove('text-slate-500');
btnPhone.classList.remove('bg-white', 'text-slate-800', 'shadow-xs');
btnPhone.classList.add('text-slate-500');
} else {
frame.classList.add('w-[390px]', 'h-[812px]', 'rounded-[52px]', 'p-3');
frame.classList.remove('w-full', 'max-w-xl', 'h-[640px]', 'rounded-3xl', 'p-1', 'scale-105');
btnPhone.classList.add('bg-white', 'text-slate-800', 'shadow-xs');
btnPhone.classList.remove('text-slate-500');
btnComp.classList.remove('bg-white', 'text-slate-800', 'shadow-xs');
btnComp.classList.add('text-slate-500');
}
}
</script>
</body>
</html>
+78 -18
View File
@@ -79,11 +79,15 @@
<input type="text" id="loginUsername" class="login-input" placeholder="Ej: padre, carlos_papa, 8888-1122 o mateo" required autocomplete="username"> <input type="text" id="loginUsername" class="login-input" placeholder="Ej: padre, carlos_papa, 8888-1122 o mateo" required autocomplete="username">
</div> </div>
<div class="login-form-group"> <div class="login-form-group" style="margin-bottom: 8px;">
<label id="lblLoginPass" for="loginPassword">Contraseña o PIN:</label> <label id="lblLoginPass" for="loginPassword">Contraseña o PIN:</label>
<input type="password" id="loginPassword" class="login-input" placeholder="••••••••" required autocomplete="current-password"> <input type="password" id="loginPassword" class="login-input" placeholder="••••••••" required autocomplete="current-password">
</div> </div>
<div style="display: flex; justify-content: flex-end; margin-top: -2px; margin-bottom: 14px;">
<button type="button" onclick="switchSheetView('forgot')" style="background: none; border: none; color: #0284c7; font-weight: 700; cursor: pointer; text-decoration: underline; font-size: 0.8rem; padding: 0;">¿Olvidaste tu contraseña?</button>
</div>
<div id="loginErrorMsg" style="display: none; background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; padding: 9px 12px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; margin-bottom: 12px; text-align: center;"></div> <div id="loginErrorMsg" style="display: none; background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; padding: 9px 12px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; margin-bottom: 12px; text-align: center;"></div>
<button type="submit" id="btnLoginSubmit" class="login-submit-btn" style="display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #0284c7, #0369a1); color: white; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);"> <button type="submit" id="btnLoginSubmit" class="login-submit-btn" style="display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #0284c7, #0369a1); color: white; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);">
@@ -95,7 +99,7 @@
<div style="text-align: center; margin-top: 14px;"> <div style="text-align: center; margin-top: 14px;">
<p style="font-size: 0.82rem; color: #64748b; margin: 0;"> <p style="font-size: 0.82rem; color: #64748b; margin: 0;">
¿Aún no tienes cuenta? ¿Aún no tienes cuenta?
<button type="button" onclick="switchSheetView('register')" style="background: none; border: none; color: #0284c7; font-weight: 800; cursor: pointer; text-decoration: underline; font-size: 0.82rem; padding: 0;">Regístrate como Padre aquí</button> <button type="button" onclick="switchSheetView('register')" style="background: none; border: none; color: #0284c7; font-weight: 800; cursor: pointer; text-decoration: underline; font-size: 0.82rem; padding: 0;">Regístrate aquí</button>
</p> </p>
</div> </div>
@@ -127,32 +131,27 @@
</details> </details>
</div> </div>
<!-- CONTENIDO 2: REGISTRO DE PADRES --> <!-- CONTENIDO 2: REGISTRO DE CUENTA -->
<div id="sheetContentRegister" style="display: none;"> <div id="sheetContentRegister" style="display: none;">
<div style="background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border: 1.5px solid #bae6fd; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px;">
<div style="width: 36px; height: 36px; border-radius: 10px; background: white; border: 1px solid #bae6fd; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 4px;">
<img src="/img/sibopay-emblem.png" alt="SiboPay" style="width: 100%; height: 100%; object-fit: contain;">
</div>
<div>
<strong style="color: #0369a1; font-size: 0.86rem; display: block; font-weight: 800;">Registro de Padres o Encargados</strong>
<span style="font-size: 0.72rem; color: #475569; display: block;">Crea tu cuenta para vincular a tus hijos y recargarles saldo con SINPE móvil.</span>
</div>
</div>
<form id="formRegisterPadre" onsubmit="handleRegisterPadreSubmit(event)"> <form id="formRegisterPadre" onsubmit="handleRegisterPadreSubmit(event)">
<div class="login-form-group"> <div class="login-form-group">
<label for="regNombre">Nombre y Apellidos:</label> <label for="regNombre">Nombre y Apellidos:</label>
<input type="text" id="regNombre" class="login-input" placeholder="Ej: Carlos Alvarado Castro" required autocomplete="name"> <input type="text" id="regNombre" class="login-input" placeholder="Ej: Carlos Alvarado Castro" required autocomplete="name">
</div> </div>
<div class="login-form-group">
<label for="regFechaNacimiento">Fecha de Nacimiento:</label>
<input type="date" id="regFechaNacimiento" class="login-input" required>
</div>
<div class="login-form-group"> <div class="login-form-group">
<label for="regTelefono">Teléfono o Celular (para SINPE):</label> <label for="regTelefono">Teléfono o Celular (para SINPE):</label>
<input type="tel" id="regTelefono" class="login-input" placeholder="Ej: 8888-1122" required autocomplete="tel"> <input type="tel" id="regTelefono" class="login-input" placeholder="Ej: 8888-1122" required autocomplete="tel">
</div> </div>
<div class="login-form-group"> <div class="login-form-group">
<label for="regEmail">Correo Electrónico <span style="font-size: 0.72rem; color: #64748b;">(Opcional)</span>:</label> <label for="regEmail">Correo Electrónico:</label>
<input type="email" id="regEmail" class="login-input" placeholder="Ej: [email protected]" autocomplete="email"> <input type="email" id="regEmail" class="login-input" placeholder="Ej: [email protected]" required autocomplete="email">
</div> </div>
<div class="login-form-group"> <div class="login-form-group">
@@ -162,14 +161,14 @@
<div class="login-form-group"> <div class="login-form-group">
<label for="regPassword">Contraseña:</label> <label for="regPassword">Contraseña:</label>
<input type="password" id="regPassword" class="login-input" placeholder="Mínimo 4 caracteres" required autocomplete="new-password"> <input type="password" id="regPassword" class="login-input" placeholder="Mínimo 6 caracteres" minlength="6" required autocomplete="new-password">
</div> </div>
<div id="registerErrorMsg" style="display: none; background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; padding: 8px 12px; border-radius: 10px; font-size: 0.8rem; font-weight: 700; margin-bottom: 12px; text-align: center;"></div> <div id="registerErrorMsg" style="display: none; background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; padding: 8px 12px; border-radius: 10px; font-size: 0.8rem; font-weight: 700; margin-bottom: 12px; text-align: center;"></div>
<button type="submit" id="btnRegisterSubmit" class="login-submit-btn" style="display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #0284c7, #0369a1); color: white; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);"> <button type="submit" id="btnRegisterSubmit" class="login-submit-btn" style="display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #0284c7, #0369a1); color: white; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="7" r="3.5"/><path d="M3 20v-1.5A4.5 4.5 0 0 1 7.5 14h3A4.5 4.5 0 0 1 15 18.5V20"/><circle cx="17.5" cy="7.5" r="2.5"/><path d="M15 14a3.5 3.5 0 0 1 5.5 3v3"/></svg> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="7" r="3.5"/><path d="M3 20v-1.5A4.5 4.5 0 0 1 7.5 14h3A4.5 4.5 0 0 1 15 18.5V20"/><circle cx="17.5" cy="7.5" r="2.5"/><path d="M15 14a3.5 3.5 0 0 1 5.5 3v3"/></svg>
<span>Crear Cuenta de Padre y Entrar</span> <span>Crear Cuenta y Entrar</span>
</button> </button>
</form> </form>
@@ -180,6 +179,67 @@
</p> </p>
</div> </div>
</div> </div>
<!-- CONTENIDO 3: RESTABLECER CONTRASEÑA -->
<div id="sheetContentForgot" style="display: none;">
<div style="background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border: 1.5px solid #bae6fd; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px;">
<div style="width: 36px; height: 36px; border-radius: 10px; background: white; border: 1px solid #bae6fd; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 4px;">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#0284c7" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
</div>
<div>
<strong style="color: #0369a1; font-size: 0.86rem; display: block; font-weight: 800;">Restablecer Contraseña</strong>
<span style="font-size: 0.72rem; color: #475569; display: block;">Te enviaremos un código de seguridad a tu correo para crear una nueva clave.</span>
</div>
</div>
<!-- PASO 1: ENVIAR CÓDIGO AL CORREO -->
<div id="forgotStep1">
<form id="formForgotRequest" onsubmit="handleForgotRequestSubmit(event)">
<div class="login-form-group">
<label for="forgotEmail">Correo Electrónico Registrado:</label>
<input type="email" id="forgotEmail" class="login-input" placeholder="Ej: [email protected]" required autocomplete="email">
</div>
<div id="forgotMsgStep1" style="display: none; padding: 9px 12px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; margin-bottom: 12px; text-align: center;"></div>
<button type="submit" id="btnForgotSendCode" class="login-submit-btn" style="display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #0284c7, #0369a1); color: white; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 2L11 13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
<span id="lblBtnForgotSend">Enviar Código al Correo</span>
</button>
</form>
</div>
<!-- PASO 2: INGRESAR CÓDIGO Y NUEVA CONTRASEÑA -->
<div id="forgotStep2" style="display: none;">
<form id="formForgotConfirm" onsubmit="handleForgotConfirmSubmit(event)">
<div class="login-form-group">
<label for="forgotCode">Código de Verificación (6 dígitos):</label>
<input type="text" id="forgotCode" class="login-input" placeholder="Ej: 123456" maxlength="6" pattern="[0-9]{6}" required style="letter-spacing: 4px; font-size: 1.15rem; text-align: center; font-weight: 800;">
</div>
<div class="login-form-group">
<label for="forgotNewPass">Nueva Contraseña:</label>
<input type="password" id="forgotNewPass" class="login-input" placeholder="Mínimo 6 caracteres" minlength="6" required autocomplete="new-password">
</div>
<div class="login-form-group">
<label for="forgotConfirmPass">Confirmar Nueva Contraseña:</label>
<input type="password" id="forgotConfirmPass" class="login-input" placeholder="Repite la contraseña" minlength="6" required autocomplete="new-password">
</div>
<div id="forgotMsgStep2" style="display: none; padding: 9px 12px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; margin-bottom: 12px; text-align: center;"></div>
<button type="submit" id="btnForgotResetPass" class="login-submit-btn" style="display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #10b981, #059669); color: white; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
<span id="lblBtnForgotReset">Cambiar Contraseña y Entrar</span>
</button>
</form>
</div>
<div style="text-align: center; margin-top: 14px;">
<button type="button" onclick="switchSheetView('login')" style="background: none; border: none; color: #0284c7; font-weight: 800; cursor: pointer; text-decoration: underline; font-size: 0.82rem; padding: 0;">← Volver a Iniciar Sesión</button>
</div>
</div>
</div> </div>
</div> </div>
@@ -5357,6 +5417,6 @@
<script src="/js/sounds.js?v=19.4"></script> <script src="/js/sounds.js?v=19.4"></script>
<script src="/js/jsQR.js" defer></script> <script src="/js/jsQR.js" defer></script>
<script src="/js/food-icons.js?v=19.4" defer></script> <script src="/js/food-icons.js?v=19.4" defer></script>
<script src="/js/app.js?v=20.5"></script> <script src="/js/app.js?v=20.6"></script>
</body> </body>
</html> </html>
+173 -7
View File
@@ -332,15 +332,29 @@ function closeLoginSheet(e) {
function switchSheetView(view) { function switchSheetView(view) {
const loginContent = document.getElementById('sheetContentLogin'); const loginContent = document.getElementById('sheetContentLogin');
const registerContent = document.getElementById('sheetContentRegister'); const registerContent = document.getElementById('sheetContentRegister');
const forgotContent = document.getElementById('sheetContentForgot');
const title = document.getElementById('bottomSheetTitle'); const title = document.getElementById('bottomSheetTitle');
if (loginContent) loginContent.style.display = 'none';
if (registerContent) registerContent.style.display = 'none';
if (forgotContent) forgotContent.style.display = 'none';
if (view === 'register') { if (view === 'register') {
if (loginContent) loginContent.style.display = 'none';
if (registerContent) registerContent.style.display = 'block'; if (registerContent) registerContent.style.display = 'block';
if (title) title.textContent = 'Registro de Padres'; if (title) title.textContent = 'Crear Cuenta';
} else if (view === 'forgot') {
if (forgotContent) forgotContent.style.display = 'block';
if (title) title.textContent = 'Restablecer Contraseña';
const step1 = document.getElementById('forgotStep1');
const step2 = document.getElementById('forgotStep2');
if (step1) step1.style.display = 'block';
if (step2) step2.style.display = 'none';
const msg1 = document.getElementById('forgotMsgStep1');
if (msg1) msg1.style.display = 'none';
const msg2 = document.getElementById('forgotMsgStep2');
if (msg2) msg2.style.display = 'none';
} else { } else {
if (loginContent) loginContent.style.display = 'block'; if (loginContent) loginContent.style.display = 'block';
if (registerContent) registerContent.style.display = 'none';
if (title) title.textContent = 'Iniciar Sesión'; if (title) title.textContent = 'Iniciar Sesión';
} }
} }
@@ -407,6 +421,8 @@ function selectRegisterRole(role) {
async function handleRegisterPadreSubmit(event) { async function handleRegisterPadreSubmit(event) {
if (event) event.preventDefault(); if (event) event.preventDefault();
const nombre = document.getElementById('regNombre').value.trim(); const nombre = document.getElementById('regNombre').value.trim();
const fechaNacInput = document.getElementById('regFechaNacimiento');
const fecha_nacimiento = fechaNacInput ? fechaNacInput.value.trim() : '';
const telefono = document.getElementById('regTelefono').value.trim(); const telefono = document.getElementById('regTelefono').value.trim();
const emailInput = document.getElementById('regEmail'); const emailInput = document.getElementById('regEmail');
const email = emailInput ? emailInput.value.trim() : ''; const email = emailInput ? emailInput.value.trim() : '';
@@ -416,14 +432,31 @@ async function handleRegisterPadreSubmit(event) {
const btnSubmit = document.getElementById('btnRegisterSubmit'); const btnSubmit = document.getElementById('btnRegisterSubmit');
if (errorMsg) errorMsg.style.display = 'none'; if (errorMsg) errorMsg.style.display = 'none';
if (!email) {
if (errorMsg) {
errorMsg.textContent = 'El correo electrónico es requerido.';
errorMsg.style.display = 'block';
}
return;
}
if (password.length < 6) {
if (errorMsg) {
errorMsg.textContent = 'La contraseña debe tener al menos 6 caracteres.';
errorMsg.style.display = 'block';
}
return;
}
btnSubmit.disabled = true; btnSubmit.disabled = true;
btnSubmit.textContent = 'Creando cuenta de padre...'; btnSubmit.textContent = 'Creando cuenta...';
try { try {
const res = await fetch('/api/auth/register-padre', { const res = await fetch('/api/auth/register-padre', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ nombre, telefono, email, username, password }) body: JSON.stringify({ nombre, fecha_nacimiento, telefono, email, username, password })
}); });
const data = await res.json(); const data = await res.json();
if (!res.ok) throw new Error(data.error || 'Error al registrar la cuenta'); if (!res.ok) throw new Error(data.error || 'Error al registrar la cuenta');
@@ -440,7 +473,7 @@ async function handleRegisterPadreSubmit(event) {
if (window.sounds) window.sounds.playSuccess(); if (window.sounds) window.sounds.playSuccess();
await showAppAlert({ await showAppAlert({
title: '¡Bienvenido(a) a SiboPay!', title: '¡Bienvenido(a) a SiboPay!',
message: `Hola ${data.user.nombre}, tu cuenta de padre fue creada exitosamente.\n\nYa puedes vincular a tus hijos, asignar límites diarios y realizar recargas por SINPE Móvil de forma segura.`, message: `Hola ${data.user.nombre}, tu cuenta fue creada exitosamente.\n\nYa puedes acceder a todos los servicios y monedero digital SiboPay.`,
type: 'success', type: 'success',
confirmText: 'Entrar a mi Panel' confirmText: 'Entrar a mi Panel'
}); });
@@ -453,7 +486,140 @@ async function handleRegisterPadreSubmit(event) {
if (window.sounds) window.sounds.playError(); if (window.sounds) window.sounds.playError();
} finally { } finally {
btnSubmit.disabled = false; btnSubmit.disabled = false;
btnSubmit.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" style="margin-right:6px;"><circle cx="9" cy="7" r="3.5"/><path d="M3 20v-1.5A4.5 4.5 0 0 1 7.5 14h3A4.5 4.5 0 0 1 15 18.5V20"/><circle cx="17.5" cy="7.5" r="2.5"/><path d="M15 14a3.5 3.5 0 0 1 5.5 3v3"/></svg> Crear Cuenta de Padre y Entrar'; btnSubmit.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" style="margin-right:6px;"><circle cx="9" cy="7" r="3.5"/><path d="M3 20v-1.5A4.5 4.5 0 0 1 7.5 14h3A4.5 4.5 0 0 1 15 18.5V20"/><circle cx="17.5" cy="7.5" r="2.5"/><path d="M15 14a3.5 3.5 0 0 1 5.5 3v3"/></svg> Crear Cuenta y Entrar';
}
}
let pendingForgotEmail = '';
async function handleForgotRequestSubmit(event) {
if (event) event.preventDefault();
const emailInput = document.getElementById('forgotEmail');
const email = emailInput ? emailInput.value.trim() : '';
const msg = document.getElementById('forgotMsgStep1');
const btn = document.getElementById('btnForgotSendCode');
if (!email) return;
if (msg) msg.style.display = 'none';
btn.disabled = true;
btn.innerHTML = '<span style="display:inline-block; animation: pulse 1s infinite;">⏳</span> Enviando código...';
try {
const res = await fetch('/api/auth/forgot-password', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email })
});
const data = await res.json();
if (!res.ok) throw new Error(data.error || 'No se pudo enviar el código de recuperación.');
pendingForgotEmail = email;
document.getElementById('forgotStep1').style.display = 'none';
document.getElementById('forgotStep2').style.display = 'block';
const msg2 = document.getElementById('forgotMsgStep2');
if (msg2) {
msg2.textContent = `Código enviado a ${email}. Revisa tu bandeja de entrada o spam e ingrésalo abajo.`;
msg2.style.background = '#dcfce7';
msg2.style.borderColor = '#86efac';
msg2.style.color = '#166534';
msg2.style.border = '1px solid #86efac';
msg2.style.display = 'block';
}
const inputCode = document.getElementById('forgotCode');
if (inputCode) inputCode.focus();
} catch (err) {
if (msg) {
msg.textContent = err.message;
msg.style.background = '#fee2e2';
msg.style.borderColor = '#fca5a5';
msg.style.color = '#991b1b';
msg.style.border = '1px solid #fca5a5';
msg.style.display = 'block';
}
if (window.sounds) window.sounds.playError();
} finally {
btn.disabled = false;
btn.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 2L11 13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg> <span id="lblBtnForgotSend">Enviar Código al Correo</span>';
}
}
async function handleForgotConfirmSubmit(event) {
if (event) event.preventDefault();
const email = pendingForgotEmail || (document.getElementById('forgotEmail') ? document.getElementById('forgotEmail').value.trim() : '');
const code = document.getElementById('forgotCode') ? document.getElementById('forgotCode').value.trim() : '';
const newPass = document.getElementById('forgotNewPass') ? document.getElementById('forgotNewPass').value.trim() : '';
const confirmPass = document.getElementById('forgotConfirmPass') ? document.getElementById('forgotConfirmPass').value.trim() : '';
const msg = document.getElementById('forgotMsgStep2');
const btn = document.getElementById('btnForgotResetPass');
if (msg) msg.style.display = 'none';
if (newPass.length < 6) {
if (msg) {
msg.textContent = 'La nueva contraseña debe tener al menos 6 caracteres.';
msg.style.background = '#fee2e2';
msg.style.borderColor = '#fca5a5';
msg.style.color = '#991b1b';
msg.style.border = '1px solid #fca5a5';
msg.style.display = 'block';
}
return;
}
if (newPass !== confirmPass) {
if (msg) {
msg.textContent = 'Las contraseñas no coinciden. Por favor verifícalas.';
msg.style.background = '#fee2e2';
msg.style.borderColor = '#fca5a5';
msg.style.color = '#991b1b';
msg.style.border = '1px solid #fca5a5';
msg.style.display = 'block';
}
return;
}
btn.disabled = true;
btn.innerHTML = '<span style="display:inline-block; animation: pulse 1s infinite;">⏳</span> Guardando nueva contraseña...';
try {
const res = await fetch('/api/auth/reset-password', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, code, new_password: newPass })
});
const data = await res.json();
if (!res.ok) throw new Error(data.error || 'Error al restablecer la contraseña.');
if (window.sounds) window.sounds.playSuccess();
await showAppAlert({
title: '¡Contraseña Restablecida!',
message: 'Tu contraseña ha sido actualizada exitosamente. Ya puedes iniciar sesión con tu nueva contraseña.',
type: 'success',
confirmText: 'Iniciar Sesión'
});
switchSheetView('login');
const loginUserInput = document.getElementById('loginUsername');
if (loginUserInput) loginUserInput.value = email;
const loginPassInput = document.getElementById('loginPassword');
if (loginPassInput) {
loginPassInput.value = '';
loginPassInput.focus();
}
} catch (err) {
if (msg) {
msg.textContent = err.message;
msg.style.background = '#fee2e2';
msg.style.borderColor = '#fca5a5';
msg.style.color = '#991b1b';
msg.style.border = '1px solid #fca5a5';
msg.style.display = 'block';
}
if (window.sounds) window.sounds.playError();
} finally {
btn.disabled = false;
btn.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg> <span id="lblBtnForgotReset">Cambiar Contraseña y Entrar</span>';
} }
} }
+627
View File
@@ -0,0 +1,627 @@
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SiboPay — Carrusel Idéntico a Structured.app</title>
<script src="https://www.gstatic.com/antigravity/web/dev/tailwindcss.min.js"></script>
<style>
@keyframes marquee-left {
0% { transform: translateX(0); }
100% { transform: translateX(-50%); }
}
@keyframes marquee-right {
0% { transform: translateX(-50%); }
100% { transform: translateX(0); }
}
.track-left {
display: flex;
align-items: center;
width: max-content;
animation: marquee-left 48s linear infinite;
}
.track-right {
display: flex;
align-items: center;
width: max-content;
animation: marquee-right 52s linear infinite;
}
.marquee-row:hover .track-left,
.marquee-row:hover .track-right {
animation-play-state: paused;
}
.mask-fade {
-webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
}
.bg-smooth-transition {
transition: background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Structured Card Glow */
.structured-card {
width: 646px;
height: 193px;
border-radius: 100px;
position: relative;
flex-shrink: 0;
box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.6);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}
.structured-card:hover {
transform: scale(1.02);
box-shadow: 0 20px 42px -6px rgba(0, 0, 0, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}
</style>
</head>
<body id="pageBody" class="bg-smooth-transition antialiased text-slate-800 m-0 p-0 selection:bg-sky-200 overflow-x-hidden" style="background-color: #e0f2fe;">
<!-- NAVEGACIÓN FLOTANTE LIQUID GLASS -->
<nav class="fixed top-0 left-0 w-full z-50 flex items-center justify-center px-4 py-3 pointer-events-none">
<div class="w-full max-w-5xl pointer-events-auto flex items-center justify-between px-6 py-2.5 rounded-full bg-white/45 backdrop-blur-2xl border border-white/60 shadow-[0_8px_30px_rgba(0,0,0,0.06)]">
<div class="flex items-center gap-2.5">
<div class="w-9 h-9 rounded-full bg-gradient-to-tr from-sky-600 to-cyan-400 flex items-center justify-center text-white font-extrabold text-lg shadow-sm">
S
</div>
<span class="text-xl font-bold tracking-tight text-slate-900">sibopay</span>
<span class="text-[12px] font-semibold px-2.5 py-0.5 rounded-full bg-white/80 text-sky-800 border border-sky-200/60 ml-1">Structured 1:1</span>
</div>
<div class="hidden md:flex items-center gap-6 text-[15px] font-medium text-slate-700 lowercase">
<a href="#reviews" class="hover:text-sky-600 transition-colors">carrusel de cápsulas</a>
<a href="#features" class="hover:text-sky-600 transition-colors">discos interactivos</a>
<a href="#timeline" class="hover:text-sky-600 transition-colors">agenda visual</a>
</div>
<div class="flex items-center gap-2">
<button onclick="toggleBackground()" class="px-3.5 py-1.5 rounded-full bg-white/70 hover:bg-white text-slate-700 text-xs font-semibold border border-white/80 shadow-xs transition-all flex items-center gap-1.5 cursor-pointer">
<span>🎨 Cambiar Fondo</span>
</button>
<button class="px-5 py-2 rounded-full bg-slate-900 hover:bg-sky-600 text-white text-sm font-semibold transition-all duration-300 shadow-sm cursor-pointer">
Probar en vivo
</button>
</div>
</div>
</nav>
<!-- HERO TITLE -->
<section class="pt-32 pb-8 px-6 text-center max-w-4xl mx-auto">
<div class="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-white/70 backdrop-blur-md border border-white shadow-xs text-xs font-bold text-sky-800 mb-6">
<span class="w-2 h-2 rounded-full bg-sky-500 animate-pulse"></span>
CARRUSEL DE CÁPSULAS Y CONECTORES DE STRUCTURED.APP
</div>
<h1 class="text-4xl sm:text-6xl font-light text-slate-900 lowercase tracking-tight leading-none mb-4">
el carrusel idéntico de <br/>
<span class="font-extrabold text-sky-800" id="heroTitleSpan">structured con los colores de sibopay</span>
</h1>
<p class="text-base sm:text-lg text-slate-600 font-medium max-w-2xl mx-auto mb-6">
Cápsulas gigantes de <strong class="text-slate-900">646px × 193px</strong> con <strong class="text-slate-900">radio de curvatura de 100px</strong>, estrellas doradas, conectores visuales tipo rompecabezas y dos filas que se desplazan de forma continua en sentidos opuestos.
</p>
<!-- PALETA DE COLOR ACTIVA -->
<div class="flex flex-wrap items-center justify-center gap-2 mb-2">
<button onclick="setTheme('#e0f2fe')" class="px-3.5 py-1 rounded-full text-xs font-bold bg-white text-sky-800 shadow-xs cursor-pointer border border-sky-200">🧊 Cielo SiboPay</button>
<button onclick="setTheme('#d1fae5')" class="px-3.5 py-1 rounded-full text-xs font-bold bg-white/70 hover:bg-white text-emerald-800 shadow-xs cursor-pointer border border-emerald-200">🍃 Menta Recargas</button>
<button onclick="setTheme('#ffedd5')" class="px-3.5 py-1 rounded-full text-xs font-bold bg-white/70 hover:bg-white text-orange-800 shadow-xs cursor-pointer border border-orange-200">🍑 Melocotón Pastel</button>
<button onclick="setTheme('#f3e8ff')" class="px-3.5 py-1 rounded-full text-xs font-bold bg-white/70 hover:bg-white text-purple-800 shadow-xs cursor-pointer border border-purple-200">💜 Lavanda Relax</button>
<button onclick="setTheme('#fef08a')" class="px-3.5 py-1 rounded-full text-xs font-bold bg-white/70 hover:bg-white text-amber-800 shadow-xs cursor-pointer border border-amber-200">🌻 Vainilla Cálido</button>
</div>
</section>
<!-- ============================================================ -->
<!-- SECCIÓN: EL CARRUSEL EXACTO DE STRUCTURED (COMMUNITY REVIEWS) -->
<!-- ============================================================ -->
<section id="reviews" class="py-10 overflow-hidden relative">
<div class="text-center lowercase mx-auto px-5 mb-8">
<div class="text-slate-600 text-lg sm:text-2xl font-light tracking-tight">más de 50.000 clientes satisfechos</div>
<div class="text-slate-900 text-3xl sm:text-5xl font-extrabold tracking-tight">experiencias en tiempo real</div>
</div>
<div class="flex flex-col gap-6 mask-fade marquee-row">
<!-- ======================================================== -->
<!-- FILA 1: MOVIMIENTO CONTINUO HACIA LA IZQUIERDA (48s) -->
<!-- ======================================================== -->
<div class="overflow-hidden w-full h-[205px]">
<div class="track-left flex items-center gap-0">
<!-- CÁPSULA 1: SIBOPAY CYAN / AZUL CIELO (646px x 193px, border-radius 100px) -->
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<!-- 5 Estrellas Doradas -->
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“La recarga por SINPE Móvil entra en 2 segundos y a mi hijo le llega el saldo de inmediato. Cero filas en la soda.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">💬</span>
<span class="text-xs font-bold text-white/90">Reseña WhatsApp de Padres</span>
</div>
</div>
</div>
<!-- CONECTOR 1 (Puzzle Link entre Cápsula 1 y 2) -->
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<!-- CÁPSULA 2: VIOLETA / LAVANDA STRUCTURED -->
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Cuando alguien agenda un servicio en mi página, le llega el WhatsApp con la ruta de Waze al instante. Espectacular.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">📸</span>
<span class="text-xs font-bold text-white/90">Instagram Comment</span>
</div>
</div>
</div>
<!-- CONECTOR 2 -->
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<!-- CÁPSULA 3: MENTA / VERDE SALVIA -->
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #10b981 0%, #047857 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Tengo dos páginas web con el mismo número de WhatsApp enviando recordatorios automáticos sin pagar líneas extra.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">⭐</span>
<span class="text-xs font-bold text-white/90">Google Business Review</span>
</div>
</div>
</div>
<!-- CONECTOR 3 -->
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<!-- CÁPSULA 4: MELOCOTÓN / CORAL CÁLIDO -->
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #f97316 0%, #c2410c 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Los banners de aviso en tiempo real nos salvaron cuando tuvimos que pausar el comedor. Todos los papás lo vieron.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">🍎</span>
<span class="text-xs font-bold text-white/90">App Store Review</span>
</div>
</div>
</div>
<!-- CONECTOR 4 -->
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<!-- DUPLICACIÓN EXACTA DE FILA 1 PARA LOOP INFINITO PERFECTO -->
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“La recarga por SINPE Móvil entra en 2 segundos y a mi hijo le llega el saldo de inmediato. Cero filas en la soda.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">💬</span>
<span class="text-xs font-bold text-white/90">Reseña WhatsApp de Padres</span>
</div>
</div>
</div>
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Cuando alguien agenda un servicio en mi página, le llega el WhatsApp con la ruta de Waze al instante. Espectacular.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">📸</span>
<span class="text-xs font-bold text-white/90">Instagram Comment</span>
</div>
</div>
</div>
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #10b981 0%, #047857 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Tengo dos páginas web con el mismo número de WhatsApp enviando recordatorios automáticos sin pagar líneas extra.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">⭐</span>
<span class="text-xs font-bold text-white/90">Google Business Review</span>
</div>
</div>
</div>
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #f97316 0%, #c2410c 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Los banners de aviso en tiempo real nos salvaron cuando tuvimos que pausar el comedor. Todos los papás lo vieron.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">🍎</span>
<span class="text-xs font-bold text-white/90">App Store Review</span>
</div>
</div>
</div>
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
</div>
</div>
<!-- ======================================================== -->
<!-- FILA 2: MOVIMIENTO CONTINUO HACIA LA DERECHA (52s) -->
<!-- ======================================================== -->
<div class="overflow-hidden w-full h-[205px]">
<div class="track-right flex items-center gap-0">
<!-- CÁPSULA B1: ROSA EMPOVRADO PASTEL -->
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Poder bloquear alimentos chatarra y alergenos en caja desde mi celular me da una tranquilidad inmensa como mamá.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">🛡️</span>
<span class="text-xs font-bold text-white/90">Comentario Portal Padres</span>
</div>
</div>
</div>
<!-- CONECTOR B1 -->
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<!-- CÁPSULA B2: AMBAR / MIEL PASTEL -->
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Mi peluquería ahora llena la agenda sola. Los clientes reservan a la medianoche y les llega la confirmación por correo y WhatsApp.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">✂️</span>
<span class="text-xs font-bold text-white/90">Testimonio de Comercio</span>
</div>
</div>
</div>
<!-- CONECTOR B2 -->
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<!-- CÁPSULA B3: AZUL ACERO PASTEL -->
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“El interruptor en caliente para pausar SINPE Móvil nos permitió hacer mantenimiento sin que ningún padre tuviera errores.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">⚙️</span>
<span class="text-xs font-bold text-white/90">Panel de Administración</span>
</div>
</div>
</div>
<!-- CONECTOR B3 -->
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<!-- CÁPSULA B4: VERDE ESMERALDA DEEP -->
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #059669 0%, #064e3b 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Comprar con carné digital por QR es más rápido que pagar con efectivo. Despachamos 300 estudiantes en 15 minutos.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">🥪</span>
<span class="text-xs font-bold text-white/90">Cajero Soda Escolar</span>
</div>
</div>
</div>
<!-- CONECTOR B4 -->
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<!-- DUPLICACIÓN EXACTA DE FILA 2 PARA LOOP INFINITO PERFECTO -->
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Poder bloquear alimentos chatarra y alergenos en caja desde mi celular me da una tranquilidad inmensa como mamá.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">🛡️</span>
<span class="text-xs font-bold text-white/90">Comentario Portal Padres</span>
</div>
</div>
</div>
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Mi peluquería ahora llena la agenda sola. Los clientes reservan a la medianoche y les llega la confirmación por correo y WhatsApp.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">✂️</span>
<span class="text-xs font-bold text-white/90">Testimonio de Comercio</span>
</div>
</div>
</div>
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“El interruptor en caliente para pausar SINPE Móvil nos permitió hacer mantenimiento sin que ningún padre tuviera errores.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">⚙️</span>
<span class="text-xs font-bold text-white/90">Panel de Administración</span>
</div>
</div>
</div>
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
<div class="structured-card flex flex-col items-center justify-center text-center text-white" style="background: linear-gradient(135deg, #059669 0%, #064e3b 100%);">
<div class="flex flex-col items-center justify-center px-12 py-5" style="transform: translateY(-4px);">
<div class="flex items-center gap-1 mb-2 text-amber-300 text-lg">
★ ★ ★ ★ ★
</div>
<p class="text-[18px] font-medium leading-[1.35] tracking-[-0.4px] text-white/95 max-w-[520px]">
“Comprar con carné digital por QR es más rápido que pagar con efectivo. Despachamos 300 estudiantes en 15 minutos.”
</p>
<div class="flex items-center gap-2 mt-2.5">
<span class="w-5 h-5 rounded-full bg-white/20 flex items-center justify-center text-[10px]">🥪</span>
<span class="text-xs font-bold text-white/90">Cajero Soda Escolar</span>
</div>
</div>
</div>
<div class="flex-shrink-0 flex items-center justify-center relative z-0" style="width: 32px; height: 20px;">
<div style="width: 52px; height: 16px; border-radius: 9999px; background: rgba(255,255,255,0.7); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 2px solid white;"></div>
</div>
</div>
</div>
</div>
</section>
<!-- ============================================================ -->
<!-- SECCIÓN 2: DISCOS REDONDOS PASTEL ("EXPLORE MORE FEATURES") -->
<!-- ============================================================ -->
<section id="features" class="py-16 px-6 max-w-5xl mx-auto">
<div class="text-center lowercase mx-auto mb-12">
<div class="text-slate-600 text-lg sm:text-2xl font-light tracking-tight">explora todas las</div>
<div class="text-slate-900 text-3xl sm:text-5xl font-extrabold tracking-tight">funcionalidades</div>
</div>
<!-- FILA DE DISCOS CIRCULARES DE 178px IDÉNTICOS A STRUCTURED.APP -->
<div class="flex items-center justify-center flex-wrap gap-8 sm:gap-12">
<!-- Disco 1: Pagos SINPE -->
<div class="flex flex-col items-center gap-3 cursor-pointer group" onclick="setTheme('#e0f2fe')">
<div class="w-40 h-40 sm:w-44 sm:h-44 rounded-full bg-gradient-to-tr from-sky-400 to-cyan-200 p-1 shadow-lg group-hover:scale-105 group-hover:shadow-xl transition-all duration-300 flex items-center justify-center">
<div class="w-full h-full rounded-full bg-white/30 backdrop-blur-md flex flex-col items-center justify-center text-slate-900">
<span class="text-4xl mb-1">💳</span>
<span class="text-xs font-bold uppercase tracking-wider text-sky-950">sinpe móvil</span>
</div>
</div>
<div class="text-center lowercase text-slate-800 text-xl font-bold leading-tight">
pagos<br/><span class="font-light text-slate-600">instantáneos</span>
</div>
</div>
<!-- Disco 2: WhatsApp Meta API -->
<div class="flex flex-col items-center gap-3 cursor-pointer group" onclick="setTheme('#d1fae5')">
<div class="w-40 h-40 sm:w-44 sm:h-44 rounded-full bg-gradient-to-tr from-emerald-400 to-teal-200 p-1 shadow-lg group-hover:scale-105 group-hover:shadow-xl transition-all duration-300 flex items-center justify-center">
<div class="w-full h-full rounded-full bg-white/30 backdrop-blur-md flex flex-col items-center justify-center text-slate-900">
<span class="text-4xl mb-1">💬</span>
<span class="text-xs font-bold uppercase tracking-wider text-emerald-950">meta api</span>
</div>
</div>
<div class="text-center lowercase text-slate-800 text-xl font-bold leading-tight">
whatsapp<br/><span class="font-light text-slate-600">automático</span>
</div>
</div>
<!-- Disco 3: Agenda 24/7 -->
<div class="flex flex-col items-center gap-3 cursor-pointer group" onclick="setTheme('#f3e8ff')">
<div class="w-40 h-40 sm:w-44 sm:h-44 rounded-full bg-gradient-to-tr from-purple-400 to-violet-200 p-1 shadow-lg group-hover:scale-105 group-hover:shadow-xl transition-all duration-300 flex items-center justify-center">
<div class="w-full h-full rounded-full bg-white/30 backdrop-blur-md flex flex-col items-center justify-center text-slate-900">
<span class="text-4xl mb-1">🗓️</span>
<span class="text-xs font-bold uppercase tracking-wider text-purple-950">turnos 24/7</span>
</div>
</div>
<div class="text-center lowercase text-slate-800 text-xl font-bold leading-tight">
reservas<br/><span class="font-light text-slate-600">sin llamadas</span>
</div>
</div>
<!-- Disco 4: Banners Globales -->
<div class="flex flex-col items-center gap-3 cursor-pointer group" onclick="setTheme('#ffedd5')">
<div class="w-40 h-40 sm:w-44 sm:h-44 rounded-full bg-gradient-to-tr from-orange-400 to-amber-200 p-1 shadow-lg group-hover:scale-105 group-hover:shadow-xl transition-all duration-300 flex items-center justify-center">
<div class="w-full h-full rounded-full bg-white/30 backdrop-blur-md flex flex-col items-center justify-center text-slate-900">
<span class="text-4xl mb-1">📢</span>
<span class="text-xs font-bold uppercase tracking-wider text-amber-950">difusión</span>
</div>
</div>
<div class="text-center lowercase text-slate-800 text-xl font-bold leading-tight">
avisos<br/><span class="font-light text-slate-600">en caliente</span>
</div>
</div>
<!-- Disco 5: Control Total -->
<div class="flex flex-col items-center gap-3 cursor-pointer group" onclick="setTheme('#fef08a')">
<div class="w-40 h-40 sm:w-44 sm:h-44 rounded-full bg-gradient-to-tr from-yellow-400 to-amber-100 p-1 shadow-lg group-hover:scale-105 group-hover:shadow-xl transition-all duration-300 flex items-center justify-center">
<div class="w-full h-full rounded-full bg-white/30 backdrop-blur-md flex flex-col items-center justify-center text-slate-900">
<span class="text-4xl mb-1">🛡️</span>
<span class="text-xs font-bold uppercase tracking-wider text-yellow-950">seguridad</span>
</div>
</div>
<div class="text-center lowercase text-slate-800 text-xl font-bold leading-tight">
control<br/><span class="font-light text-slate-600">parental</span>
</div>
</div>
</div>
</section>
<!-- ============================================================ -->
<!-- SECCIÓN 3: AGENDA TIMELINE VISUAL DE STRUCTURED -->
<!-- ============================================================ -->
<section id="timeline" class="py-12 px-6 max-w-3xl mx-auto">
<div class="text-center lowercase mx-auto mb-8">
<div class="text-slate-600 text-lg sm:text-2xl font-light tracking-tight">una sola línea de tiempo</div>
<div class="text-slate-900 text-3xl sm:text-5xl font-extrabold tracking-tight">tu día organizado bloque a bloque</div>
</div>
<div class="relative pl-6 sm:pl-8 border-l-2 border-sky-400/60 flex flex-col gap-4 my-6">
<!-- Bloque 1 -->
<div class="p-5 rounded-[28px] bg-white/80 backdrop-blur-md border border-white shadow-xs flex items-center justify-between gap-4">
<div class="flex items-center gap-3.5">
<span class="w-12 h-12 rounded-2xl bg-sky-100 text-sky-700 flex items-center justify-center text-2xl shrink-0">💳</span>
<div>
<div class="text-xs font-bold text-sky-700">08:00 AM • Pagos</div>
<h4 class="text-base font-extrabold text-slate-900">Recarga SINPE de ₡10,000 confirmada</h4>
<p class="text-xs text-slate-500">Comprobante #9412 verificado automáticamente</p>
</div>
</div>
<span class="px-3 py-1 rounded-full bg-emerald-100 text-emerald-800 text-xs font-bold">Completado ✅</span>
</div>
<!-- Bloque 2 -->
<div class="p-5 rounded-[28px] bg-white/80 backdrop-blur-md border border-white shadow-xs flex items-center justify-between gap-4">
<div class="flex items-center gap-3.5">
<span class="w-12 h-12 rounded-2xl bg-purple-100 text-purple-700 flex items-center justify-center text-2xl shrink-0">✂️</span>
<div>
<div class="text-xs font-bold text-purple-700">11:30 AM • Cita de Servicio</div>
<h4 class="text-base font-extrabold text-slate-900">Corte & Tratamiento Capilar</h4>
<p class="text-xs text-slate-500">Recordatorio de WhatsApp enviado al cliente</p>
</div>
</div>
<span class="px-3 py-1 rounded-full bg-purple-100 text-purple-800 text-xs font-bold">En 45 min</span>
</div>
<!-- Bloque 3 -->
<div class="p-5 rounded-[28px] bg-white/80 backdrop-blur-md border border-white shadow-xs flex items-center justify-between gap-4">
<div class="flex items-center gap-3.5">
<span class="w-12 h-12 rounded-2xl bg-amber-100 text-amber-700 flex items-center justify-center text-2xl shrink-0">🥪</span>
<div>
<div class="text-xs font-bold text-amber-700">01:45 PM • Comedor</div>
<h4 class="text-base font-extrabold text-slate-900">Despacho de Pre-órdenes</h4>
<p class="text-xs text-slate-500">Alergias validadas: 0 incidentes reportados</p>
</div>
</div>
<span class="px-3 py-1 rounded-full bg-amber-100 text-amber-800 text-xs font-bold">Programado ☕</span>
</div>
</div>
</section>
<!-- PIE DE PÁGINA -->
<footer class="py-12 px-6 border-t border-white/60 text-center text-xs text-slate-600 font-medium">
<div class="max-w-4xl mx-auto flex flex-col sm:flex-row items-center justify-between gap-4">
<div class="flex items-center gap-2">
<div class="w-6 h-6 rounded-full bg-sky-600 text-white flex items-center justify-center font-bold text-xs">S</div>
<span class="font-bold text-slate-900 text-sm">SiboPay</span>
<span>• Réplica 1:1 Carrusel Structured.app</span>
</div>
<div>646px × 193px Pills • Border Radius 100px • Interlocking Connectors</div>
</div>
</footer>
<script>
const themes = ['#e0f2fe', '#d1fae5', '#ffedd5', '#f3e8ff', '#fef08a'];
let themeIdx = 0;
function setTheme(hex) {
const body = document.getElementById('pageBody');
if (body) body.style.backgroundColor = hex;
}
function toggleBackground() {
themeIdx = (themeIdx + 1) % themes.length;
setTheme(themes[themeIdx]);
}
</script>
</body>
</html>
+3 -3
View File
@@ -1,5 +1,5 @@
// SiboPay PWA Service Worker v20.5 - Ultra Fast Startup & Stale-While-Revalidate // SiboPay PWA Service Worker v20.6 - Ultra Fast Startup & Stale-While-Revalidate
const CACHE_NAME = 'sibopay-v20.5'; const CACHE_NAME = 'sibopay-v20.6';
const STATIC_ASSETS = [ const STATIC_ASSETS = [
'/', '/',
'/index.html', '/index.html',
@@ -11,7 +11,7 @@ const STATIC_ASSETS = [
'/css/styles.css?v=19.9', '/css/styles.css?v=19.9',
'/css/desktop.css?v=2.2', '/css/desktop.css?v=2.2',
'/js/dialogs.js?v=19.4', '/js/dialogs.js?v=19.4',
'/js/app.js?v=20.5', '/js/app.js?v=20.6',
'/js/pos.js?v=20.5', '/js/pos.js?v=20.5',
'/js/sounds.js?v=19.4', '/js/sounds.js?v=19.4',
'/js/food-icons.js?v=19.4', '/js/food-icons.js?v=19.4',
+23 -1
View File
@@ -216,6 +216,16 @@ function initDatabase() {
db.exec('ALTER TABLE transacciones_saldo ADD COLUMN IF NOT EXISTS revertido_en TIMESTAMP;'); db.exec('ALTER TABLE transacciones_saldo ADD COLUMN IF NOT EXISTS revertido_en TIMESTAMP;');
db.exec('ALTER TABLE transacciones_saldo ADD COLUMN IF NOT EXISTS escuela_id INTEGER DEFAULT 1 REFERENCES escuelas(id);'); db.exec('ALTER TABLE transacciones_saldo ADD COLUMN IF NOT EXISTS escuela_id INTEGER DEFAULT 1 REFERENCES escuelas(id);');
db.exec('ALTER TABLE usuarios ADD COLUMN IF NOT EXISTS escuela_id INTEGER DEFAULT 1 REFERENCES escuelas(id);'); db.exec('ALTER TABLE usuarios ADD COLUMN IF NOT EXISTS escuela_id INTEGER DEFAULT 1 REFERENCES escuelas(id);');
db.exec('ALTER TABLE usuarios ADD COLUMN IF NOT EXISTS fecha_nacimiento VARCHAR(50);');
db.exec(`
CREATE TABLE IF NOT EXISTS password_resets (
id SERIAL PRIMARY KEY,
email VARCHAR(150) NOT NULL,
code VARCHAR(10) NOT NULL,
expires_at TIMESTAMP NOT NULL,
creado_en TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
`);
db.exec('ALTER TABLE estudiantes ADD COLUMN IF NOT EXISTS escuela_id INTEGER DEFAULT 1 REFERENCES escuelas(id);'); db.exec('ALTER TABLE estudiantes ADD COLUMN IF NOT EXISTS escuela_id INTEGER DEFAULT 1 REFERENCES escuelas(id);');
db.exec('ALTER TABLE estudiantes ADD COLUMN IF NOT EXISTS card_theme VARCHAR(50);'); db.exec('ALTER TABLE estudiantes ADD COLUMN IF NOT EXISTS card_theme VARCHAR(50);');
db.exec('ALTER TABLE estudiantes ADD COLUMN IF NOT EXISTS bloqueo_qr_biometrico INTEGER DEFAULT 0;'); db.exec('ALTER TABLE estudiantes ADD COLUMN IF NOT EXISTS bloqueo_qr_biometrico INTEGER DEFAULT 0;');
@@ -265,6 +275,7 @@ function initDatabase() {
nombre TEXT NOT NULL, nombre TEXT NOT NULL,
telefono TEXT, telefono TEXT,
email TEXT, email TEXT,
fecha_nacimiento TEXT,
creado_en DATETIME DEFAULT CURRENT_TIMESTAMP creado_en DATETIME DEFAULT CURRENT_TIMESTAMP
); );
@@ -435,8 +446,19 @@ function initDatabase() {
try { db.exec('ALTER TABLE ordenes ADD COLUMN observaciones TEXT'); } catch (e) {} try { db.exec('ALTER TABLE ordenes ADD COLUMN observaciones TEXT'); } catch (e) {}
try { db.exec('ALTER TABLE ordenes ADD COLUMN escuela_id INTEGER DEFAULT 1'); } catch (e) {} try { db.exec('ALTER TABLE ordenes ADD COLUMN escuela_id INTEGER DEFAULT 1'); } catch (e) {}
try { db.exec('ALTER TABLE estudiantes ADD COLUMN card_theme TEXT'); } catch (e) {} try { db.exec('ALTER TABLE estudiantes ADD COLUMN card_theme TEXT'); } catch (e) {}
try { db.exec('ALTER TABLE usuarios ADD COLUMN card_theme TEXT'); } catch (e) {}
try { db.exec('ALTER TABLE estudiantes ADD COLUMN bloqueo_qr_biometrico INTEGER DEFAULT 0'); } catch (e) {} try { db.exec('ALTER TABLE estudiantes ADD COLUMN bloqueo_qr_biometrico INTEGER DEFAULT 0'); } catch (e) {}
try { db.exec('ALTER TABLE usuarios ADD COLUMN fecha_nacimiento TEXT'); } catch (e) {}
try {
db.exec(`
CREATE TABLE IF NOT EXISTS password_resets (
id INTEGER PRIMARY KEY AUTOINCREMENT,
email TEXT NOT NULL,
code TEXT NOT NULL,
expires_at DATETIME NOT NULL,
creado_en DATETIME DEFAULT CURRENT_TIMESTAMP
);
`);
} catch (e) {}
// 10. Diseños de Tarjetas Virtuales para Estudiantes // 10. Diseños de Tarjetas Virtuales para Estudiantes
try { try {
+75
View File
@@ -0,0 +1,75 @@
const nodemailer = require('nodemailer');
/**
* Servicio de envío de correos electrónicos transaccionales para SiboPay
*/
function getTransporter() {
const user = process.env.SMTP_USER || process.env.SINPE_EMAIL_USER || '[email protected]';
const rawPass = process.env.SMTP_PASSWORD || process.env.SINPE_EMAIL_PASSWORD || 'aeguiflzmskmaswq';
const pass = String(rawPass).replace(/\s+/g, '');
return nodemailer.createTransport({
host: process.env.SMTP_HOST || 'smtp.gmail.com',
port: parseInt(process.env.SMTP_PORT || '465', 10),
secure: (process.env.SMTP_PORT || '465') === '465', // true para 465, false para 587
auth: {
user: user,
pass: pass
}
});
}
/**
* Envía el código numérico de 6 dígitos para restablecer contraseña
*/
async function enviarCodigoRecuperacion(destinatario, codigo, nombreUsuario = 'Usuario') {
const transporter = getTransporter();
const remitente = process.env.SMTP_FROM || `SiboPay Soporte <${process.env.SMTP_USER || '[email protected]'}>`;
const mailOptions = {
from: remitente,
to: destinatario,
subject: `🔐 SiboPay - Código para restablecer contraseña: ${codigo}`,
text: `Hola ${nombreUsuario},\n\nTu código de verificación para restablecer tu contraseña en SiboPay es: ${codigo}\n\nEste código es válido durante 15 minutos. Si no solicitaste este cambio, puedes ignorar este mensaje.\n\nAtentamente,\nEquipo SiboPay`,
html: `
<div style="font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background-color: #f8fafc; padding: 30px 15px; color: #1e293b;">
<div style="max-width: 520px; margin: 0 auto; background: #ffffff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.06); border: 1px solid #e2e8f0;">
<div style="background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); padding: 26px 20px; text-align: center; color: white;">
<h1 style="margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.5px;">SiboPay</h1>
<p style="margin: 6px 0 0; font-size: 13px; opacity: 0.9;">Recuperación Segura de Cuenta</p>
</div>
<div style="padding: 28px 24px; text-align: center;">
<h2 style="font-size: 18px; color: #0f172a; margin-top: 0; margin-bottom: 12px; font-weight: 700;">Restablecer tu Contraseña</h2>
<p style="font-size: 14px; color: #64748b; line-height: 1.5; margin: 0 0 24px;">
Hola <strong>${nombreUsuario}</strong>, recibimos una solicitud para restablecer la contraseña de tu cuenta. Ingresa el siguiente código de verificación en la aplicación:
</p>
<div style="background: #f0f9ff; border: 2px dashed #0284c7; border-radius: 12px; padding: 18px 10px; margin-bottom: 24px; display: inline-block; min-width: 200px;">
<span style="font-family: monospace; font-size: 34px; font-weight: 800; letter-spacing: 8px; color: #0369a1;">${codigo}</span>
</div>
<p style="font-size: 12px; color: #94a3b8; line-height: 1.4; margin: 0;">
⏳ Este código vencerá en <strong>15 minutos</strong>.<br>
Si no solicitaste este cambio, haz caso omiso a este correo.
</p>
</div>
<div style="background: #f1f5f9; padding: 14px 20px; text-align: center; border-top: 1px solid #e2e8f0;">
<p style="margin: 0; font-size: 11px; color: #64748b;">
&copy; SiboPay - Sistema Inteligente de Billetera Online. Todos los derechos reservados.
</p>
</div>
</div>
</div>
`
};
return transporter.sendMail(mailOptions);
}
module.exports = {
enviarCodigoRecuperacion
};
+112 -11
View File
@@ -53,6 +53,7 @@ const {
const { checkSinpeEmailsOnce, simularSinpeEmail } = require('./sinpeImapService'); const { checkSinpeEmailsOnce, simularSinpeEmail } = require('./sinpeImapService');
const { normalizarCodigoDetalle, parseSinpeEmail } = require('./sinpeParser'); const { normalizarCodigoDetalle, parseSinpeEmail } = require('./sinpeParser');
const { simpleParser } = require('mailparser'); const { simpleParser } = require('mailparser');
const { enviarCodigoRecuperacion } = require('./emailService');
const webpush = require('web-push'); const webpush = require('web-push');
@@ -533,25 +534,29 @@ app.post('/api/auth/login', (req, res) => {
} }
}); });
// Registro de nuevos padres desde la pantalla de bienvenida // Registro de nuevos usuarios desde la pantalla de bienvenida
app.post('/api/auth/register-padre', (req, res) => { app.post('/api/auth/register-padre', (req, res) => {
try { try {
const { nombre, telefono, email, username, password } = req.body; const { nombre, telefono, email, username, password, fecha_nacimiento } = req.body;
if (!nombre || !username || !password) { if (!nombre || !username || !password || !email) {
return res.status(400).json({ error: 'Nombre completo, usuario y contraseña son requeridos' }); return res.status(400).json({ error: 'Nombre completo, correo electrónico, usuario y contraseña son requeridos' });
} }
const cleanUser = String(username).trim().toLowerCase(); const cleanUser = String(username).trim().toLowerCase();
const cleanPass = String(password).trim(); const cleanPass = String(password).trim();
const cleanNombre = String(nombre).trim(); const cleanNombre = String(nombre).trim();
const cleanTel = telefono ? String(telefono).trim() : ''; const cleanTel = telefono ? String(telefono).trim() : '';
const cleanEmail = email ? String(email).trim().toLowerCase() : ''; const cleanEmail = String(email).trim().toLowerCase();
const cleanFechaNac = fecha_nacimiento ? String(fecha_nacimiento).trim() : '';
if (cleanUser.length < 3) { if (cleanUser.length < 3) {
return res.status(400).json({ error: 'El nombre de usuario debe tener al menos 3 caracteres' }); return res.status(400).json({ error: 'El nombre de usuario debe tener al menos 3 caracteres' });
} }
if (cleanPass.length < 4) { if (cleanPass.length < 6) {
return res.status(400).json({ error: 'La contraseña debe tener al menos 4 caracteres' }); return res.status(400).json({ error: 'La contraseña debe tener al menos 6 caracteres' });
}
if (!cleanEmail.includes('@') || !cleanEmail.includes('.')) {
return res.status(400).json({ error: 'Ingresa un correo electrónico válido' });
} }
// Comprobar si el usuario ya existe // Comprobar si el usuario ya existe
@@ -560,11 +565,17 @@ app.post('/api/auth/register-padre', (req, res) => {
return res.status(400).json({ error: 'Ese nombre de usuario ya está en uso. Por favor elige otro.' }); return res.status(400).json({ error: 'Ese nombre de usuario ya está en uso. Por favor elige otro.' });
} }
// Comprobar si el correo ya está registrado
const emailExists = db.prepare('SELECT id FROM usuarios WHERE LOWER(email) = ?').get(cleanEmail);
if (emailExists) {
return res.status(400).json({ error: 'Ese correo electrónico ya está registrado. Puedes iniciar sesión o restablecer tu contraseña.' });
}
const insert = db.prepare(` const insert = db.prepare(`
INSERT INTO usuarios (username, password_hash, rol, nombre, telefono, email) INSERT INTO usuarios (username, password_hash, rol, nombre, telefono, email, fecha_nacimiento)
VALUES (?, ?, 'padre', ?, ?, ?) VALUES (?, ?, 'padre', ?, ?, ?, ?)
`); `);
const result = insert.run(cleanUser, cleanPass, cleanNombre, cleanTel, cleanEmail); const result = insert.run(cleanUser, cleanPass, cleanNombre, cleanTel, cleanEmail, cleanFechaNac);
const newUser = { const newUser = {
id: result.lastInsertRowid, id: result.lastInsertRowid,
@@ -572,7 +583,8 @@ app.post('/api/auth/register-padre', (req, res) => {
rol: 'padre', rol: 'padre',
nombre: cleanNombre, nombre: cleanNombre,
telefono: cleanTel, telefono: cleanTel,
email: cleanEmail email: cleanEmail,
fecha_nacimiento: cleanFechaNac
}; };
res.json({ res.json({
@@ -585,6 +597,95 @@ app.post('/api/auth/register-padre', (req, res) => {
} }
}); });
// ==========================================
// RESTABLECIMIENTO DE CONTRASEÑA VÍA CORREO
// ==========================================
// 1. Enviar código de 6 dígitos al correo
app.post('/api/auth/forgot-password', async (req, res) => {
try {
const { email } = req.body;
if (!email) {
return res.status(400).json({ error: 'Por favor ingresa tu correo electrónico' });
}
const cleanEmail = String(email).trim().toLowerCase();
const user = db.prepare('SELECT id, username, nombre, email FROM usuarios WHERE LOWER(email) = ?').get(cleanEmail);
if (!user) {
return res.status(404).json({ error: 'No encontramos ninguna cuenta asociada a este correo electrónico.' });
}
// Generar código numérico de 6 dígitos
const code = Math.floor(100000 + Math.random() * 900000).toString();
const expiresAt = new Date(Date.now() + 15 * 60 * 1000).toISOString();
// Guardar código en la base de datos (eliminar previos para este correo)
try {
db.prepare('DELETE FROM password_resets WHERE LOWER(email) = ?').run(cleanEmail);
} catch (_) {}
db.prepare('INSERT INTO password_resets (email, code, expires_at) VALUES (?, ?, ?)').run(cleanEmail, code, expiresAt);
// Enviar código por correo electrónico vía SMTP
await enviarCodigoRecuperacion(cleanEmail, code, user.nombre || user.username);
res.json({
success: true,
message: 'Hemos enviado un código de 6 dígitos a tu correo electrónico.'
});
} catch (err) {
console.error('[AUTH] ❌ Error en forgot-password:', err);
res.status(500).json({ error: 'Error al enviar el código de recuperación: ' + (err.message || 'Error de conexión') });
}
});
// 2. Validar código y asignar nueva contraseña
app.post('/api/auth/reset-password', (req, res) => {
try {
const { email, code, new_password } = req.body;
if (!email || !code || !new_password) {
return res.status(400).json({ error: 'Correo, código y nueva contraseña son requeridos' });
}
const cleanEmail = String(email).trim().toLowerCase();
const cleanCode = String(code).trim();
const cleanPass = String(new_password).trim();
if (cleanPass.length < 6) {
return res.status(400).json({ error: 'La nueva contraseña debe tener al menos 6 caracteres' });
}
const resetEntry = db.prepare('SELECT id, code, expires_at FROM password_resets WHERE LOWER(email) = ? ORDER BY id DESC LIMIT 1').get(cleanEmail);
if (!resetEntry || resetEntry.code !== cleanCode) {
return res.status(400).json({ error: 'El código de verificación es inválido. Verifícalo e intenta de nuevo.' });
}
const now = new Date();
const expires = new Date(resetEntry.expires_at);
if (now > expires) {
return res.status(400).json({ error: 'El código de verificación ha expirado (validez de 15 minutos). Solicita uno nuevo.' });
}
// Actualizar contraseña del usuario
const update = db.prepare('UPDATE usuarios SET password_hash = ? WHERE LOWER(email) = ?').run(cleanPass, cleanEmail);
if (update.changes === 0) {
return res.status(404).json({ error: 'No se pudo encontrar la cuenta para actualizar la contraseña.' });
}
// Eliminar código utilizado
try {
db.prepare('DELETE FROM password_resets WHERE LOWER(email) = ?').run(cleanEmail);
} catch (_) {}
res.json({
success: true,
message: '¡Contraseña actualizada exitosamente! Ya puedes iniciar sesión con tu nueva contraseña.'
});
} catch (err) {
console.error('[AUTH] ❌ Error en reset-password:', err);
res.status(500).json({ error: 'Error al restablecer la contraseña: ' + (err.message || 'Error interno') });
}
});
// ========================================== // ==========================================
// ELIMINACIÓN DE CUENTA Y SUPRESIÓN DE DATOS (GOOGLE PLAY & APPLE COMPLIANCE) // ELIMINACIÓN DE CUENTA Y SUPRESIÓN DE DATOS (GOOGLE PLAY & APPLE COMPLIANCE)
// ========================================== // ==========================================