feat(ui): rediseño visual del frontend (tema oscuro vidrio + lava)
This commit is contained in:
1 parent
188d0b94b0
commit
ac6fdedf17
12 files changed
+1295
-407
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 367 KiB |
+367
-17
@@ -1,26 +1,376 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
/*
|
||||
* Paleta del producto registrada como tokens de Tailwind v4.
|
||||
* Esto genera utilidades como bg-azul, text-marino, border-borde, etc.
|
||||
* - marino: azul marino para títulos y texto principal
|
||||
* - azul: azul brillante para acentos y botones (estilo Calendly)
|
||||
* - lienzo: fondo claro de la página
|
||||
* Sistema visual "Collina" — rediseño oscuro (vidrio esmerilado sobre lava),
|
||||
* acentos magenta→naranja. Clases portadas 1:1 del handoff de diseño.
|
||||
* Las fuentes (Source Serif 4 / Hanken Grotesk) llegan como variables CSS
|
||||
* desde layout.tsx (next/font).
|
||||
*/
|
||||
@theme {
|
||||
--color-marino: #13284b;
|
||||
--color-marino-2: #54658a;
|
||||
--color-azul: #0b69ff;
|
||||
--color-azul-fuerte: #0a56d6;
|
||||
--color-azul-suave: #eaf1ff;
|
||||
--color-borde: #e6e8f0;
|
||||
--color-lienzo: #f3f5fb;
|
||||
|
||||
--font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background: var(--color-lienzo);
|
||||
color: var(--color-marino);
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
background: #0a0613;
|
||||
color: #fbeff6;
|
||||
font-family: var(--font-hanken), "Hanken Grotesk", sans-serif;
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
outline: 2px solid #ff7a33;
|
||||
outline-offset: 2px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Tipografía serif para títulos */
|
||||
.serif {
|
||||
font-family: var(--font-serif), "Source Serif 4", serif;
|
||||
}
|
||||
|
||||
/* Helpers de texto */
|
||||
.eyebrow {
|
||||
font-weight: 700;
|
||||
font-size: 11px;
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(248, 232, 240, 0.55);
|
||||
}
|
||||
.flabel {
|
||||
font-weight: 700;
|
||||
font-size: 12px;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(248, 232, 240, 0.55);
|
||||
}
|
||||
.ferr {
|
||||
font-size: 12.5px;
|
||||
font-weight: 600;
|
||||
color: #ff9e7a;
|
||||
}
|
||||
|
||||
/* ===== Layout de la tarjeta ===== */
|
||||
.collina-shell {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 44px 22px 64px;
|
||||
}
|
||||
.collina-grid {
|
||||
width: 100%;
|
||||
max-width: 980px;
|
||||
display: grid;
|
||||
grid-template-columns: 340px 1fr;
|
||||
background: linear-gradient(160deg, rgba(36, 17, 46, 0.62), rgba(17, 8, 25, 0.68));
|
||||
backdrop-filter: blur(28px) saturate(140%);
|
||||
-webkit-backdrop-filter: blur(28px) saturate(140%);
|
||||
border: 1px solid rgba(255, 200, 225, 0.14);
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 44px 96px -44px rgba(0, 0, 0, 0.78);
|
||||
overflow: hidden;
|
||||
}
|
||||
.collina-panel {
|
||||
background: rgba(255, 255, 255, 0.045);
|
||||
border-right: 1px solid rgba(255, 200, 225, 0.1);
|
||||
padding: 34px 30px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 22px;
|
||||
}
|
||||
.collina-content {
|
||||
padding: 36px 38px;
|
||||
min-height: 560px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* ===== Fondo de lava (capas fijas) ===== */
|
||||
.lava-layer {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
.lava-veil {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
pointer-events: none;
|
||||
background: radial-gradient(
|
||||
ellipse 95% 90% at 50% 60%,
|
||||
rgba(8, 4, 16, 0.05) 0%,
|
||||
rgba(8, 4, 16, 0.38) 100%
|
||||
);
|
||||
}
|
||||
|
||||
/* ===== Inputs ===== */
|
||||
.ci {
|
||||
width: 100%;
|
||||
font-family: var(--font-hanken), "Hanken Grotesk", sans-serif;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
color: #fbeff6;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border: 1px solid rgba(255, 200, 225, 0.16);
|
||||
border-radius: 12px;
|
||||
padding: 13px 14px;
|
||||
outline: none;
|
||||
transition: border-color 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
.ci::placeholder {
|
||||
color: rgba(248, 232, 240, 0.42);
|
||||
font-weight: 400;
|
||||
}
|
||||
.ci:focus {
|
||||
border-color: #ff3d90;
|
||||
box-shadow: 0 0 0 3px rgba(255, 61, 144, 0.22);
|
||||
}
|
||||
.ci--err {
|
||||
border-color: #ff6b6b;
|
||||
}
|
||||
textarea.ci {
|
||||
resize: vertical;
|
||||
min-height: 88px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* ===== Navegación de calendario ===== */
|
||||
.cal-nav {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(255, 200, 225, 0.22);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: #ff9e5c;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: 0.15s;
|
||||
padding: 0;
|
||||
}
|
||||
.cal-nav:hover:not(:disabled) {
|
||||
border-color: #ff7a33;
|
||||
color: #ff7a33;
|
||||
background: rgba(255, 122, 51, 0.14);
|
||||
}
|
||||
.cal-nav:disabled {
|
||||
opacity: 0.3;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* ===== Días del calendario ===== */
|
||||
.cal-day {
|
||||
width: 100%;
|
||||
aspect-ratio: 1;
|
||||
max-width: 46px;
|
||||
margin: 0 auto;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: var(--font-hanken), "Hanken Grotesk", sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 15px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: #fbeff6;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
transition: 0.12s;
|
||||
}
|
||||
.cal-day--empty {
|
||||
visibility: hidden;
|
||||
}
|
||||
.cal-day--off {
|
||||
color: rgba(248, 232, 240, 0.26);
|
||||
cursor: default;
|
||||
}
|
||||
.cal-day--avail {
|
||||
background: rgba(255, 122, 51, 0.16);
|
||||
color: #ffb37a;
|
||||
}
|
||||
.cal-day--avail:hover {
|
||||
background: linear-gradient(135deg, #e82b7b, #ff7a33);
|
||||
color: #fff;
|
||||
}
|
||||
.cal-day--sel {
|
||||
background: linear-gradient(135deg, #e82b7b, #ff7a33) !important;
|
||||
color: #fff !important;
|
||||
box-shadow: 0 8px 20px -8px rgba(232, 43, 123, 0.85);
|
||||
}
|
||||
.cal-day__today {
|
||||
position: absolute;
|
||||
bottom: 6px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 50%;
|
||||
background: #ff7a33;
|
||||
display: none;
|
||||
}
|
||||
.cal-day--today .cal-day__today {
|
||||
display: block;
|
||||
}
|
||||
.cal-day--sel .cal-day__today {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
/* ===== Slots de horario ===== */
|
||||
.slot {
|
||||
height: 48px;
|
||||
border: 1px solid rgba(255, 200, 225, 0.16);
|
||||
border-radius: 12px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
color: #fbeff6;
|
||||
font-family: var(--font-hanken), "Hanken Grotesk", sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
cursor: pointer;
|
||||
transition: 0.14s;
|
||||
}
|
||||
.slot:hover {
|
||||
border-color: #ff7a33;
|
||||
color: #fff;
|
||||
background: rgba(255, 122, 51, 0.16);
|
||||
}
|
||||
.slot--sel {
|
||||
background: linear-gradient(135deg, #e82b7b, #ff7a33) !important;
|
||||
border-color: transparent !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
/* ===== Pills (industria) ===== */
|
||||
.pill {
|
||||
min-height: 44px;
|
||||
padding: 0 18px;
|
||||
border: 1px solid rgba(255, 200, 225, 0.16);
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: rgba(248, 232, 240, 0.72);
|
||||
font-family: var(--font-hanken), "Hanken Grotesk", sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: 0.14s;
|
||||
}
|
||||
.pill:hover {
|
||||
border-color: #ff7a33;
|
||||
color: #ffb37a;
|
||||
}
|
||||
.pill--sel {
|
||||
background: rgba(232, 43, 123, 0.18);
|
||||
border-color: #e82b7b;
|
||||
color: #ffb37a;
|
||||
}
|
||||
|
||||
/* ===== Botones ===== */
|
||||
.btn-primary {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 9px;
|
||||
height: 50px;
|
||||
padding: 0 26px;
|
||||
border-radius: 13px;
|
||||
background: linear-gradient(135deg, #e82b7b, #ff7a33);
|
||||
color: #fff;
|
||||
font-family: var(--font-hanken), "Hanken Grotesk", sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 15px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: 0.15s;
|
||||
box-shadow: 0 12px 30px -12px rgba(232, 43, 123, 0.7);
|
||||
}
|
||||
.btn-primary:hover:not(:disabled) {
|
||||
filter: brightness(1.08);
|
||||
box-shadow: 0 16px 38px -12px rgba(232, 43, 123, 0.8);
|
||||
}
|
||||
.btn-primary:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: default;
|
||||
filter: none;
|
||||
}
|
||||
.btn-ghost {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: #ffb37a;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
font-family: var(--font-hanken), "Hanken Grotesk", sans-serif;
|
||||
font-size: 13.5px;
|
||||
letter-spacing: 0.02em;
|
||||
padding: 4px 0;
|
||||
}
|
||||
.btn-ghost:hover {
|
||||
color: #ff7a33;
|
||||
}
|
||||
|
||||
/* ===== Animaciones ===== */
|
||||
@keyframes cpulse {
|
||||
0%,
|
||||
80%,
|
||||
100% {
|
||||
opacity: 0.22;
|
||||
transform: scale(0.7);
|
||||
}
|
||||
40% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
.cdot {
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border-radius: 50%;
|
||||
background: #ff7a33;
|
||||
animation: cpulse 1.1s infinite ease-in-out;
|
||||
}
|
||||
.cdot:nth-child(2) {
|
||||
animation-delay: 0.15s;
|
||||
}
|
||||
.cdot:nth-child(3) {
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
@keyframes cpop {
|
||||
0% {
|
||||
transform: scale(0.5);
|
||||
opacity: 0;
|
||||
}
|
||||
60% {
|
||||
transform: scale(1.08);
|
||||
}
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.check-badge {
|
||||
animation: cpop 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.2) both;
|
||||
}
|
||||
|
||||
/* ===== Responsivo ===== */
|
||||
@media (max-width: 860px) {
|
||||
.collina-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.collina-panel {
|
||||
border-right: none;
|
||||
border-bottom: 1px solid rgba(255, 200, 225, 0.1);
|
||||
}
|
||||
.slot-grid {
|
||||
grid-template-columns: repeat(2, 1fr) !important;
|
||||
}
|
||||
}
|
||||
+26
-2
@@ -1,5 +1,21 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Source_Serif_4, Hanken_Grotesk } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import LavaBackground from "@/components/LavaBackground";
|
||||
|
||||
// Tipografías del diseño (Google Fonts vía next/font, expuestas como variables).
|
||||
const serif = Source_Serif_4({
|
||||
subsets: ["latin"],
|
||||
weight: ["600", "700"],
|
||||
variable: "--font-serif",
|
||||
display: "swap",
|
||||
});
|
||||
const hanken = Hanken_Grotesk({
|
||||
subsets: ["latin"],
|
||||
weight: ["400", "500", "600", "700", "800"],
|
||||
variable: "--font-hanken",
|
||||
display: "swap",
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Plática inicial · Collina Systems",
|
||||
@@ -13,8 +29,16 @@ export default function RootLayout({
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="es" className="h-full antialiased">
|
||||
<body className="min-h-full flex flex-col">{children}</body>
|
||||
<html
|
||||
lang="es"
|
||||
className={`${serif.variable} ${hanken.variable} antialiased`}
|
||||
>
|
||||
<body>
|
||||
{/* Fondo de lava decorativo (capas fijas, detrás de todo) */}
|
||||
<LavaBackground />
|
||||
<div className="lava-veil" aria-hidden />
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
+4
-4
@@ -120,13 +120,13 @@ export default function Page() {
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen items-center justify-center bg-lienzo p-4 sm:p-6">
|
||||
<div className="grid w-full max-w-4xl overflow-hidden rounded-2xl border border-borde bg-white shadow-[0_10px_44px_rgba(19,40,75,0.10)] md:min-h-[36rem] md:grid-cols-[20rem_1fr]">
|
||||
<main className="collina-shell">
|
||||
<div className="collina-grid">
|
||||
{/* Columna izquierda: panel de información (fijo en todas las etapas) */}
|
||||
<PanelInfo fechaSeleccionada={fecha} horaSeleccionada={hora} />
|
||||
|
||||
{/* Columna derecha: cambia según la etapa */}
|
||||
<section>
|
||||
<div className="collina-content">
|
||||
{etapa === "fecha" && (
|
||||
<Calendario
|
||||
fechaSeleccionada={fecha}
|
||||
@@ -165,7 +165,7 @@ export default function Page() {
|
||||
eventLink={resultado?.eventLink ?? null}
|
||||
/>
|
||||
)}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
|
||||
+144
-67
@@ -1,11 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import {
|
||||
CalendarClock,
|
||||
CheckCircle2,
|
||||
AlertTriangle,
|
||||
} from "lucide-react";
|
||||
import { AlertTriangle, Check, RotateCcw } from "lucide-react";
|
||||
import PanelInfo from "@/components/PanelInfo";
|
||||
import Calendario from "@/components/Calendario";
|
||||
import SelectorHora from "@/components/SelectorHora";
|
||||
import { fechaISOLocal } from "@/lib/fechas";
|
||||
@@ -17,15 +14,29 @@ interface InfoCita {
|
||||
fechaHoraActual: string;
|
||||
}
|
||||
|
||||
/** Spinner + texto centrado. */
|
||||
/** Tres puntos pulsantes + texto, centrado. */
|
||||
function EstadoCargando({ texto }: { texto: string }) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center gap-3 p-10 text-marino-2">
|
||||
<span
|
||||
className="h-6 w-6 animate-spin rounded-full border-2 border-azul/30 border-t-azul"
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="text-sm">{texto}</span>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: 16,
|
||||
padding: "60px 0",
|
||||
minHeight: 220,
|
||||
margin: "auto 0",
|
||||
}}
|
||||
>
|
||||
<div style={{ display: "flex", gap: 7 }}>
|
||||
<span className="cdot" />
|
||||
<span className="cdot" />
|
||||
<span className="cdot" />
|
||||
</div>
|
||||
<span style={{ fontSize: 14.5, fontWeight: 600, color: "rgba(248,232,240,0.55)" }}>
|
||||
{texto}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -33,11 +44,38 @@ function EstadoCargando({ texto }: { texto: string }) {
|
||||
/** Pantalla de enlace inválido. */
|
||||
function EstadoInvalido({ mensaje }: { mensaje: string }) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center gap-3 p-10 text-center">
|
||||
<AlertTriangle className="h-10 w-10 text-amber-500" aria-hidden />
|
||||
<h2 className="text-lg font-bold text-marino">No pudimos abrir tu cita</h2>
|
||||
<p className="max-w-xs text-sm text-marino-2">{mensaje}</p>
|
||||
<p className="text-sm text-marino-2">
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
textAlign: "center",
|
||||
gap: 14,
|
||||
padding: "24px 8px",
|
||||
margin: "auto 0",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
width: 64,
|
||||
height: 64,
|
||||
borderRadius: "50%",
|
||||
background: "rgba(255,158,92,0.15)",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<AlertTriangle size={30} style={{ color: "#FF9E5C" }} aria-hidden />
|
||||
</div>
|
||||
<h2 className="serif" style={{ margin: 0, fontWeight: 700, fontSize: 24, color: "#FBEFF6" }}>
|
||||
No pudimos abrir tu cita
|
||||
</h2>
|
||||
<p style={{ margin: 0, maxWidth: 340, fontSize: 14.5, lineHeight: 1.55, color: "rgba(248,232,240,0.72)" }}>
|
||||
{mensaje}
|
||||
</p>
|
||||
<p style={{ margin: 0, fontSize: 13.5, color: "rgba(248,232,240,0.55)" }}>
|
||||
Revisa el enlace de tu correo o escríbenos para reagendar.
|
||||
</p>
|
||||
</div>
|
||||
@@ -47,16 +85,81 @@ function EstadoInvalido({ mensaje }: { mensaje: string }) {
|
||||
/** Pantalla de éxito. */
|
||||
function EstadoExito({ cuando }: { cuando: string }) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center gap-3 p-10 text-center">
|
||||
<CheckCircle2 className="h-12 w-12 text-emerald-500" aria-hidden />
|
||||
<h2 className="text-xl font-bold text-marino">¡Tu cita fue reagendada!</h2>
|
||||
{cuando && (
|
||||
<p className="text-[15px] font-semibold text-marino">{cuando}</p>
|
||||
)}
|
||||
<p className="max-w-xs text-sm text-marino-2">
|
||||
Te enviamos una nueva confirmación por correo con el enlace de la
|
||||
reunión actualizado.
|
||||
</p>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
textAlign: "center",
|
||||
gap: 18,
|
||||
padding: "24px 8px",
|
||||
margin: "auto 0",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="check-badge"
|
||||
style={{
|
||||
width: 76,
|
||||
height: 76,
|
||||
borderRadius: "50%",
|
||||
background: "rgba(255,122,51,0.18)",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
boxShadow: "0 0 0 8px rgba(255,122,51,0.10)",
|
||||
}}
|
||||
>
|
||||
<Check size={36} strokeWidth={2.6} style={{ color: "#FF7A33" }} aria-hidden />
|
||||
</div>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 8, maxWidth: 420 }}>
|
||||
<h2 className="serif" style={{ margin: 0, fontWeight: 700, fontSize: 28, color: "#FBEFF6" }}>
|
||||
¡Tu cita fue reagendada!
|
||||
</h2>
|
||||
{cuando && (
|
||||
<p style={{ margin: 0, fontSize: 15, fontWeight: 700, color: "#FBEFF6" }}>{cuando}</p>
|
||||
)}
|
||||
<p style={{ margin: 0, fontSize: 15, fontWeight: 500, lineHeight: 1.6, color: "rgba(248,232,240,0.72)" }}>
|
||||
Te enviamos una nueva confirmación por correo con el enlace de la
|
||||
reunión actualizado.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** Banner que muestra la cita actual sobre el calendario. */
|
||||
function BannerReagendar({ texto }: { texto: string }) {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "flex-start",
|
||||
gap: 11,
|
||||
background: "rgba(232,43,123,0.12)",
|
||||
border: "1px solid rgba(232,43,123,0.32)",
|
||||
borderRadius: 14,
|
||||
padding: "14px 16px",
|
||||
}}
|
||||
>
|
||||
<RotateCcw size={19} style={{ color: "#FF9E5C", flexShrink: 0, marginTop: 1 }} aria-hidden />
|
||||
<div style={{ fontSize: 13.5, lineHeight: 1.5, color: "rgba(248,232,240,0.74)" }}>
|
||||
<span
|
||||
style={{
|
||||
display: "block",
|
||||
fontWeight: 700,
|
||||
color: "#FFB37A",
|
||||
textTransform: "uppercase",
|
||||
letterSpacing: "0.1em",
|
||||
fontSize: 11,
|
||||
marginBottom: 3,
|
||||
}}
|
||||
>
|
||||
Reagendar
|
||||
</span>
|
||||
Tu cita actual es{" "}
|
||||
<strong style={{ color: "#FBEFF6", fontWeight: 700 }}>{texto}</strong>. Elige
|
||||
una nueva fecha.
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -192,47 +295,14 @@ export default function ReagendarPage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="flex min-h-screen items-center justify-center bg-lienzo p-4 sm:p-6">
|
||||
<div className="grid w-full max-w-4xl overflow-hidden rounded-2xl border border-borde bg-white shadow-[0_10px_44px_rgba(19,40,75,0.10)] md:min-h-[36rem] md:grid-cols-[20rem_1fr]">
|
||||
{/* Panel izquierdo */}
|
||||
<aside className="flex flex-col gap-5 border-b border-borde p-7 md:border-b-0 md:border-r md:p-8">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-marino-2">Collina Systems</p>
|
||||
<h1 className="mt-1 text-2xl font-bold leading-tight text-marino">
|
||||
Reagendar tu cita
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div className="flex items-start gap-2.5">
|
||||
<CalendarClock
|
||||
className="mt-0.5 h-4 w-4 shrink-0 text-marino-2"
|
||||
aria-hidden
|
||||
/>
|
||||
<div className="text-[15px]">
|
||||
{info?.fechaHoraActual ? (
|
||||
<>
|
||||
<span className="block text-marino-2">Tu cita actual es:</span>
|
||||
<span className="font-semibold text-marino">
|
||||
{info.fechaHoraActual}
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<span className="text-marino-2">Cargando tu cita…</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="mt-1 border-t border-borde pt-5 text-sm leading-relaxed text-marino-2">
|
||||
Elige una nueva fecha y hora para tu Plática inicial. Te enviaremos
|
||||
una nueva confirmación por correo con el enlace de la reunión.
|
||||
</p>
|
||||
</aside>
|
||||
<main className="collina-shell">
|
||||
<div className="collina-grid">
|
||||
{/* Panel izquierdo (mismo panel del flujo de reserva) */}
|
||||
<PanelInfo fechaSeleccionada={fecha} horaSeleccionada={null} />
|
||||
|
||||
{/* Columna derecha: cambia según la etapa */}
|
||||
<section>
|
||||
{etapa === "validando" && (
|
||||
<EstadoCargando texto="Validando enlace…" />
|
||||
)}
|
||||
<div className="collina-content">
|
||||
{etapa === "validando" && <EstadoCargando texto="Validando enlace…" />}
|
||||
|
||||
{etapa === "invalido" && (
|
||||
<EstadoInvalido mensaje={errorAcceso ?? "Enlace inválido."} />
|
||||
@@ -243,6 +313,12 @@ export default function ReagendarPage() {
|
||||
{!reagendando && etapa === "fecha" && (
|
||||
<Calendario
|
||||
fechaSeleccionada={fecha}
|
||||
eyebrow="Elige una nueva fecha"
|
||||
banner={
|
||||
info?.fechaHoraActual ? (
|
||||
<BannerReagendar texto={info.fechaHoraActual} />
|
||||
) : null
|
||||
}
|
||||
onSeleccionar={(d) => {
|
||||
setFecha(d);
|
||||
setAvisoHora(null);
|
||||
@@ -255,13 +331,14 @@ export default function ReagendarPage() {
|
||||
<SelectorHora
|
||||
fecha={fecha}
|
||||
aviso={avisoHora}
|
||||
etiquetaConfirmar="Confirmar nueva hora"
|
||||
onSeleccionar={reagendar}
|
||||
onVolver={() => setEtapa("fecha")}
|
||||
/>
|
||||
)}
|
||||
|
||||
{etapa === "exito" && <EstadoExito cuando={cuandoExito} />}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useState, type ReactNode } from "react";
|
||||
import { ChevronLeft, ChevronRight, Globe } from "lucide-react";
|
||||
import { evento, esDiaHabil } from "@/config/evento";
|
||||
import { formatearMesAnio, inicioDeHoy } from "@/lib/fechas";
|
||||
@@ -10,6 +10,10 @@ interface CalendarioProps {
|
||||
fechaSeleccionada: Date | null;
|
||||
/** Se llama al elegir un día disponible. */
|
||||
onSeleccionar: (fecha: Date) => void;
|
||||
/** Texto del eyebrow superior (visual). */
|
||||
eyebrow?: string;
|
||||
/** Contenido opcional encima del calendario (p. ej. banner de reagendar). */
|
||||
banner?: ReactNode;
|
||||
}
|
||||
|
||||
// Encabezados de la semana, empezando en lunes (como en español).
|
||||
@@ -31,11 +35,13 @@ function mismoDia(a: Date, b: Date): boolean {
|
||||
/**
|
||||
* Etapa "fecha": calendario mensual navegable.
|
||||
* Solo habilita días hábiles (lun–vie) de hoy en adelante; los fines de
|
||||
* semana y las fechas pasadas se muestran en gris y no son clickeables.
|
||||
* semana y las fechas pasadas se muestran atenuados y no son clickeables.
|
||||
*/
|
||||
export default function Calendario({
|
||||
fechaSeleccionada,
|
||||
onSeleccionar,
|
||||
eyebrow = "Selecciona una fecha",
|
||||
banner,
|
||||
}: CalendarioProps) {
|
||||
const hoy = inicioDeHoy();
|
||||
|
||||
@@ -48,8 +54,7 @@ export default function Calendario({
|
||||
const mes = mesVisible.getMonth();
|
||||
|
||||
// ¿El mes visible es el mes actual? Entonces no se puede retroceder más.
|
||||
const enMesActual =
|
||||
anio === hoy.getFullYear() && mes === hoy.getMonth();
|
||||
const enMesActual = anio === hoy.getFullYear() && mes === hoy.getMonth();
|
||||
|
||||
const diasEnMes = new Date(anio, mes + 1, 0).getDate();
|
||||
const huecosIniciales = indiceLunes(new Date(anio, mes, 1));
|
||||
@@ -74,41 +79,60 @@ export default function Calendario({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col p-7 md:p-8">
|
||||
<h2 className="mb-5 text-lg font-bold text-marino">Selecciona el día</h2>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 22 }}>
|
||||
{banner}
|
||||
|
||||
<span className="eyebrow">{eyebrow}</span>
|
||||
|
||||
{/* Encabezado: mes/año + navegación */}
|
||||
<div className="mb-3 flex items-center justify-between">
|
||||
<span className="text-base font-semibold capitalize text-marino">
|
||||
<div className="flex items-center justify-between">
|
||||
<h2
|
||||
className="serif"
|
||||
style={{
|
||||
margin: 0,
|
||||
fontWeight: 600,
|
||||
fontSize: 25,
|
||||
letterSpacing: "-0.01em",
|
||||
color: "#FBEFF6",
|
||||
}}
|
||||
>
|
||||
{formatearMesAnio(mesVisible)}
|
||||
</span>
|
||||
<div className="flex items-center gap-1">
|
||||
</h2>
|
||||
<div style={{ display: "flex", gap: 8 }}>
|
||||
<button
|
||||
type="button"
|
||||
className="cal-nav"
|
||||
onClick={irMesAnterior}
|
||||
disabled={enMesActual}
|
||||
aria-label="Mes anterior"
|
||||
className="grid h-9 w-9 place-items-center rounded-full text-marino transition-colors hover:bg-azul-suave disabled:cursor-not-allowed disabled:text-slate-300 disabled:hover:bg-transparent"
|
||||
>
|
||||
<ChevronLeft className="h-5 w-5" />
|
||||
<ChevronLeft size={16} strokeWidth={2.2} />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="cal-nav"
|
||||
onClick={irMesSiguiente}
|
||||
aria-label="Mes siguiente"
|
||||
className="grid h-9 w-9 place-items-center rounded-full text-marino transition-colors hover:bg-azul-suave"
|
||||
>
|
||||
<ChevronRight className="h-5 w-5" />
|
||||
<ChevronRight size={16} strokeWidth={2.2} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Cabecera de días de la semana */}
|
||||
<div className="grid grid-cols-7 gap-1">
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: 4 }}>
|
||||
{DIAS_SEMANA.map((dia) => (
|
||||
<div
|
||||
key={dia}
|
||||
className="py-2 text-center text-xs font-semibold uppercase tracking-wide text-marino-2"
|
||||
style={{
|
||||
textAlign: "center",
|
||||
fontWeight: 700,
|
||||
fontSize: 11,
|
||||
letterSpacing: "0.06em",
|
||||
textTransform: "uppercase",
|
||||
color: "rgba(248,232,240,0.45)",
|
||||
paddingBottom: 4,
|
||||
}}
|
||||
>
|
||||
{dia}
|
||||
</div>
|
||||
@@ -116,50 +140,70 @@ export default function Calendario({
|
||||
</div>
|
||||
|
||||
{/* Rejilla de días */}
|
||||
<div className="grid grid-cols-7 gap-1">
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: 5 }}>
|
||||
{celdas.map((dia, i) => {
|
||||
if (!dia) return <div key={`hueco-${i}`} aria-hidden />;
|
||||
if (!dia) {
|
||||
return (
|
||||
<button
|
||||
key={`hueco-${i}`}
|
||||
className="cal-day cal-day--empty"
|
||||
disabled
|
||||
aria-hidden
|
||||
tabIndex={-1}
|
||||
>
|
||||
<span />
|
||||
<span className="cal-day__today" />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
const disponible = estaDisponible(dia);
|
||||
const seleccionado =
|
||||
fechaSeleccionada && mismoDia(dia, fechaSeleccionada);
|
||||
!!fechaSeleccionada && mismoDia(dia, fechaSeleccionada);
|
||||
const esHoy = mismoDia(dia, hoy);
|
||||
|
||||
const cls = [
|
||||
"cal-day",
|
||||
disponible ? "cal-day--avail" : "cal-day--off",
|
||||
esHoy ? "cal-day--today" : "",
|
||||
seleccionado ? "cal-day--sel" : "",
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" ");
|
||||
|
||||
return (
|
||||
<div key={dia.toISOString()} className="flex justify-center py-0.5">
|
||||
<button
|
||||
type="button"
|
||||
disabled={!disponible}
|
||||
onClick={() => onSeleccionar(dia)}
|
||||
aria-label={dia.toLocaleDateString("es-MX", {
|
||||
weekday: "long",
|
||||
day: "numeric",
|
||||
month: "long",
|
||||
})}
|
||||
aria-pressed={!!seleccionado}
|
||||
className={[
|
||||
"relative grid h-11 w-11 place-items-center rounded-full text-[15px] transition-colors",
|
||||
seleccionado
|
||||
? "bg-azul font-bold text-white"
|
||||
: disponible
|
||||
? "bg-azul-suave font-semibold text-azul hover:bg-azul hover:text-white"
|
||||
: "cursor-not-allowed font-normal text-slate-300",
|
||||
].join(" ")}
|
||||
>
|
||||
{dia.getDate()}
|
||||
{esHoy && !seleccionado && (
|
||||
<span className="absolute bottom-1.5 h-1 w-1 rounded-full bg-azul" />
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
key={dia.toISOString()}
|
||||
type="button"
|
||||
className={cls}
|
||||
disabled={!disponible}
|
||||
onClick={() => onSeleccionar(dia)}
|
||||
aria-pressed={seleccionado}
|
||||
aria-label={dia.toLocaleDateString("es-MX", {
|
||||
weekday: "long",
|
||||
day: "numeric",
|
||||
month: "long",
|
||||
})}
|
||||
>
|
||||
<span>{dia.getDate()}</span>
|
||||
<span className="cal-day__today" />
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Zona horaria */}
|
||||
<div className="mt-6 flex items-center gap-2 border-t border-borde pt-5 text-sm text-marino-2">
|
||||
<Globe className="h-4 w-4 shrink-0" aria-hidden />
|
||||
<span>Zona horaria: {evento.zonaHorariaLabel}</span>
|
||||
<div
|
||||
className="flex items-center gap-2"
|
||||
style={{
|
||||
marginTop: 4,
|
||||
fontSize: 13,
|
||||
fontWeight: 500,
|
||||
color: "rgba(248,232,240,0.5)",
|
||||
}}
|
||||
>
|
||||
<Globe size={16} style={{ color: "rgba(248,232,240,0.42)", flexShrink: 0 }} aria-hidden />
|
||||
<span>Zona horaria: {evento.zonaHorariaLabel} (GMT-6)</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
+103
-83
@@ -1,6 +1,6 @@
|
||||
import { CheckCircle2, Calendar, Clock, Video, ExternalLink } from "lucide-react";
|
||||
import { Check, User, Calendar, Clock, ExternalLink } from "lucide-react";
|
||||
import { evento } from "@/config/evento";
|
||||
import { formatearFechaLarga, formatearRango } from "@/lib/fechas";
|
||||
import { formatearFechaLarga } from "@/lib/fechas";
|
||||
import type { DatosFormulario } from "@/components/Formulario";
|
||||
|
||||
interface ConfirmacionProps {
|
||||
@@ -13,6 +13,8 @@ interface ConfirmacionProps {
|
||||
eventLink: string | null;
|
||||
}
|
||||
|
||||
const ACENTO = "#FF9E5C";
|
||||
|
||||
/**
|
||||
* Etapa "confirmado": pantalla de éxito con el resumen de la cita.
|
||||
*
|
||||
@@ -24,102 +26,120 @@ export default function Confirmacion({
|
||||
fecha,
|
||||
hora,
|
||||
datos,
|
||||
meetLink,
|
||||
eventLink,
|
||||
}: ConfirmacionProps) {
|
||||
// Industria a mostrar: si eligió "Otro", mostramos el texto libre.
|
||||
const industriaMostrada =
|
||||
datos.industria === evento.preguntas.opcionOtro
|
||||
? `${evento.preguntas.opcionOtro} — ${datos.industriaOtro}`
|
||||
: datos.industria;
|
||||
|
||||
const filas: { etiqueta: string; valor: string }[] = [
|
||||
{ etiqueta: "Nombre", valor: datos.nombre },
|
||||
{ etiqueta: "Empresa", valor: datos.empresa },
|
||||
{ etiqueta: "Correo electrónico", valor: datos.correo },
|
||||
{ etiqueta: "Teléfono", valor: datos.telefono },
|
||||
{ etiqueta: evento.preguntas.procesoLabel, valor: datos.proceso },
|
||||
{ etiqueta: evento.preguntas.industriaLabel, valor: industriaMostrada },
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="flex flex-col p-7 md:p-8">
|
||||
<div className="flex flex-col items-center text-center">
|
||||
<CheckCircle2 className="h-12 w-12 text-emerald-500" aria-hidden />
|
||||
<h2 className="mt-3 text-xl font-bold text-marino">
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
textAlign: "center",
|
||||
gap: 18,
|
||||
padding: "24px 8px",
|
||||
margin: "auto 0",
|
||||
}}
|
||||
>
|
||||
{/* Badge de éxito */}
|
||||
<div
|
||||
className="check-badge"
|
||||
style={{
|
||||
width: 76,
|
||||
height: 76,
|
||||
borderRadius: "50%",
|
||||
background: "rgba(255,122,51,0.18)",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
boxShadow: "0 0 0 8px rgba(255,122,51,0.10)",
|
||||
}}
|
||||
>
|
||||
<Check size={36} strokeWidth={2.6} style={{ color: "#FF7A33" }} aria-hidden />
|
||||
</div>
|
||||
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 8, maxWidth: 420 }}>
|
||||
<h2
|
||||
className="serif"
|
||||
style={{
|
||||
margin: 0,
|
||||
fontWeight: 700,
|
||||
fontSize: 28,
|
||||
letterSpacing: "-0.01em",
|
||||
color: "#FBEFF6",
|
||||
}}
|
||||
>
|
||||
¡Listo! Tu evento está programado
|
||||
</h2>
|
||||
<p className="mt-1 text-sm text-marino-2">
|
||||
Te enviaremos una invitación con los detalles de la conferencia web.
|
||||
<p
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: 15,
|
||||
fontWeight: 500,
|
||||
lineHeight: 1.6,
|
||||
color: "rgba(248,232,240,0.72)",
|
||||
}}
|
||||
>
|
||||
Te enviamos una invitación con el enlace de la reunión a tu correo.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Resumen de la cita */}
|
||||
<div className="mt-6 rounded-xl border border-borde bg-lienzo p-5">
|
||||
<p className="text-base font-bold text-marino">{evento.titulo}</p>
|
||||
|
||||
<div className="mt-3 flex items-center gap-2.5 text-marino">
|
||||
<Calendar className="h-4 w-4 shrink-0 text-marino-2" aria-hidden />
|
||||
<span className="text-[15px] capitalize">
|
||||
{/* Tarjeta resumen */}
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
maxWidth: 380,
|
||||
background: "rgba(255,255,255,0.05)",
|
||||
border: "1px solid rgba(255,255,255,0.10)",
|
||||
borderRadius: 16,
|
||||
padding: "20px 22px",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: 14,
|
||||
textAlign: "left",
|
||||
}}
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
<User size={19} style={{ color: ACENTO, flexShrink: 0 }} aria-hidden />
|
||||
<span style={{ fontSize: 15, fontWeight: 700, color: "#FBEFF6" }}>
|
||||
{datos.nombre}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<Calendar size={19} style={{ color: ACENTO, flexShrink: 0 }} aria-hidden />
|
||||
<span style={{ fontSize: 15, fontWeight: 600, color: "#FBEFF6" }}>
|
||||
{formatearFechaLarga(fecha)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-2 flex items-center gap-2.5 text-marino">
|
||||
<Clock className="h-4 w-4 shrink-0 text-marino-2" aria-hidden />
|
||||
<span className="text-[15px]">
|
||||
{formatearRango(hora, evento.duracionMin)} · {evento.zonaHorariaLabel}
|
||||
<div className="flex items-center gap-3">
|
||||
<Clock size={19} style={{ color: ACENTO, flexShrink: 0 }} aria-hidden />
|
||||
<span style={{ fontSize: 15, fontWeight: 600, color: "#FBEFF6" }}>
|
||||
{hora} · {evento.zonaHorariaLabel} (GMT-6)
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Enlace de Google Meet */}
|
||||
{meetLink ? (
|
||||
<div className="mt-4 flex flex-col gap-2 border-t border-borde pt-4">
|
||||
<div className="flex items-center gap-2.5 text-marino">
|
||||
<Video className="h-4 w-4 shrink-0 text-marino-2" aria-hidden />
|
||||
<span className="text-[15px] font-medium">Google Meet</span>
|
||||
</div>
|
||||
<a
|
||||
href={meetLink}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex w-fit items-center gap-2 rounded-full bg-azul px-5 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-azul-fuerte"
|
||||
>
|
||||
<Video className="h-4 w-4" aria-hidden />
|
||||
Unirse a la videollamada
|
||||
</a>
|
||||
<span className="break-all text-xs text-marino-2">{meetLink}</span>
|
||||
</div>
|
||||
) : (
|
||||
<p className="mt-4 border-t border-borde pt-4 text-sm text-marino-2">
|
||||
El enlace de la videollamada llegará en el correo de invitación.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Enlace al evento en Google Calendar */}
|
||||
{eventLink && (
|
||||
<a
|
||||
href={eventLink}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="mt-3 inline-flex w-fit items-center gap-1.5 text-sm font-medium text-azul hover:underline"
|
||||
>
|
||||
Ver en Google Calendar
|
||||
<ExternalLink className="h-3.5 w-3.5" aria-hidden />
|
||||
</a>
|
||||
)}
|
||||
|
||||
{/* Datos del invitado */}
|
||||
<dl className="mt-5 flex flex-col divide-y divide-borde">
|
||||
{filas.map((fila) => (
|
||||
<div key={fila.etiqueta} className="flex flex-col gap-0.5 py-3">
|
||||
<dt className="text-xs font-semibold uppercase tracking-wide text-marino-2">
|
||||
{fila.etiqueta}
|
||||
</dt>
|
||||
<dd className="text-[15px] text-marino">{fila.valor}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
{/* Acciones */}
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
gap: 12,
|
||||
marginTop: 2,
|
||||
}}
|
||||
>
|
||||
{eventLink && (
|
||||
<a
|
||||
href={eventLink}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="btn-ghost"
|
||||
>
|
||||
Ver en Google Calendar
|
||||
<ExternalLink size={15} aria-hidden />
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { ArrowLeft } from "lucide-react";
|
||||
import { ChevronLeft } from "lucide-react";
|
||||
import { evento } from "@/config/evento";
|
||||
|
||||
/** Datos capturados en el formulario (se usan también en la confirmación). */
|
||||
@@ -127,33 +127,33 @@ export default function Formulario({
|
||||
});
|
||||
}
|
||||
|
||||
const claseInput = (hayError: boolean) =>
|
||||
[
|
||||
"w-full rounded-lg border bg-white px-3 py-2.5 text-[15px] text-marino outline-none transition-colors placeholder:text-slate-400",
|
||||
hayError
|
||||
? "border-red-400 focus:border-red-500"
|
||||
: "border-borde focus:border-azul",
|
||||
].join(" ");
|
||||
const claseInput = (hayError: boolean) => "ci" + (hayError ? " ci--err" : "");
|
||||
|
||||
return (
|
||||
<div className="flex flex-col p-7 md:p-8">
|
||||
<div className="mb-5 flex items-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onVolver}
|
||||
aria-label="Volver a elegir la hora"
|
||||
className="grid h-9 w-9 place-items-center rounded-full text-marino transition-colors hover:bg-azul-suave"
|
||||
>
|
||||
<ArrowLeft className="h-5 w-5" />
|
||||
</button>
|
||||
<h2 className="text-lg font-bold text-marino">Introduzca los detalles</h2>
|
||||
</div>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 20 }}>
|
||||
<button type="button" className="btn-ghost" onClick={onVolver}>
|
||||
<ChevronLeft size={16} strokeWidth={2.2} />
|
||||
Volver a horarios
|
||||
</button>
|
||||
|
||||
<form noValidate onSubmit={manejarEnvio} className="flex flex-col gap-4">
|
||||
<h2
|
||||
className="serif"
|
||||
style={{
|
||||
margin: 0,
|
||||
fontWeight: 600,
|
||||
fontSize: 25,
|
||||
letterSpacing: "-0.01em",
|
||||
color: "#FBEFF6",
|
||||
}}
|
||||
>
|
||||
Introduzca los detalles
|
||||
</h2>
|
||||
|
||||
<form noValidate onSubmit={manejarEnvio} style={{ display: "flex", flexDirection: "column", gap: 18 }}>
|
||||
{/* Nombre */}
|
||||
<div>
|
||||
<label htmlFor="nombre" className="mb-1.5 block text-sm font-semibold text-marino">
|
||||
Nombre <span className="text-red-500">*</span>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 7 }}>
|
||||
<label htmlFor="nombre" className="flabel">
|
||||
Nombre *
|
||||
</label>
|
||||
<input
|
||||
id="nombre"
|
||||
@@ -163,15 +163,13 @@ export default function Formulario({
|
||||
className={claseInput(!!errores.nombre)}
|
||||
aria-invalid={!!errores.nombre}
|
||||
/>
|
||||
{errores.nombre && (
|
||||
<p className="mt-1 text-sm text-red-600">{errores.nombre}</p>
|
||||
)}
|
||||
{errores.nombre && <span className="ferr">{errores.nombre}</span>}
|
||||
</div>
|
||||
|
||||
{/* Empresa */}
|
||||
<div>
|
||||
<label htmlFor="empresa" className="mb-1.5 block text-sm font-semibold text-marino">
|
||||
Empresa <span className="text-red-500">*</span>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 7 }}>
|
||||
<label htmlFor="empresa" className="flabel">
|
||||
Empresa *
|
||||
</label>
|
||||
<input
|
||||
id="empresa"
|
||||
@@ -181,15 +179,13 @@ export default function Formulario({
|
||||
className={claseInput(!!errores.empresa)}
|
||||
aria-invalid={!!errores.empresa}
|
||||
/>
|
||||
{errores.empresa && (
|
||||
<p className="mt-1 text-sm text-red-600">{errores.empresa}</p>
|
||||
)}
|
||||
{errores.empresa && <span className="ferr">{errores.empresa}</span>}
|
||||
</div>
|
||||
|
||||
{/* Correo electrónico */}
|
||||
<div>
|
||||
<label htmlFor="correo" className="mb-1.5 block text-sm font-semibold text-marino">
|
||||
Correo electrónico <span className="text-red-500">*</span>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 7 }}>
|
||||
<label htmlFor="correo" className="flabel">
|
||||
Correo electrónico *
|
||||
</label>
|
||||
<input
|
||||
id="correo"
|
||||
@@ -199,15 +195,13 @@ export default function Formulario({
|
||||
className={claseInput(!!errores.correo)}
|
||||
aria-invalid={!!errores.correo}
|
||||
/>
|
||||
{errores.correo && (
|
||||
<p className="mt-1 text-sm text-red-600">{errores.correo}</p>
|
||||
)}
|
||||
{errores.correo && <span className="ferr">{errores.correo}</span>}
|
||||
</div>
|
||||
|
||||
{/* Teléfono */}
|
||||
<div>
|
||||
<label htmlFor="telefono" className="mb-1.5 block text-sm font-semibold text-marino">
|
||||
Teléfono <span className="text-red-500">*</span>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 7 }}>
|
||||
<label htmlFor="telefono" className="flabel">
|
||||
Teléfono *
|
||||
</label>
|
||||
<input
|
||||
id="telefono"
|
||||
@@ -217,91 +211,85 @@ export default function Formulario({
|
||||
className={claseInput(!!errores.telefono)}
|
||||
aria-invalid={!!errores.telefono}
|
||||
/>
|
||||
{errores.telefono && (
|
||||
<p className="mt-1 text-sm text-red-600">{errores.telefono}</p>
|
||||
)}
|
||||
{errores.telefono && <span className="ferr">{errores.telefono}</span>}
|
||||
</div>
|
||||
|
||||
{/* Pregunta abierta: proceso */}
|
||||
<div>
|
||||
<label htmlFor="proceso" className="mb-1.5 block text-sm font-semibold text-marino">
|
||||
{preguntas.procesoLabel} <span className="text-red-500">*</span>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 7 }}>
|
||||
<label htmlFor="proceso" className="flabel">
|
||||
{preguntas.procesoLabel} *
|
||||
</label>
|
||||
<textarea
|
||||
id="proceso"
|
||||
rows={3}
|
||||
value={datos.proceso}
|
||||
onChange={(e) => actualizar("proceso", e.target.value)}
|
||||
className={`${claseInput(!!errores.proceso)} resize-none`}
|
||||
placeholder="Cuéntanos brevemente…"
|
||||
className={claseInput(!!errores.proceso)}
|
||||
aria-invalid={!!errores.proceso}
|
||||
/>
|
||||
{errores.proceso && (
|
||||
<p className="mt-1 text-sm text-red-600">{errores.proceso}</p>
|
||||
)}
|
||||
{errores.proceso && <span className="ferr">{errores.proceso}</span>}
|
||||
</div>
|
||||
|
||||
{/* Industria: radios + opción "Otro" con campo libre */}
|
||||
<fieldset>
|
||||
<legend className="mb-1.5 block text-sm font-semibold text-marino">
|
||||
{preguntas.industriaLabel} <span className="text-red-500">*</span>
|
||||
</legend>
|
||||
<div className="flex flex-col gap-1.5">
|
||||
{/* Industria: pills + opción "Otro" con campo libre */}
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 10 }}>
|
||||
<span className="flabel">{preguntas.industriaLabel} *</span>
|
||||
<div style={{ display: "flex", flexWrap: "wrap", gap: 9 }}>
|
||||
{[...preguntas.industrias, preguntas.opcionOtro].map((opcion) => (
|
||||
<label
|
||||
<button
|
||||
key={opcion}
|
||||
className="flex cursor-pointer items-center gap-2.5 text-[15px] text-marino"
|
||||
type="button"
|
||||
className={"pill" + (datos.industria === opcion ? " pill--sel" : "")}
|
||||
onClick={() => actualizar("industria", opcion)}
|
||||
aria-pressed={datos.industria === opcion}
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
name="industria"
|
||||
value={opcion}
|
||||
checked={datos.industria === opcion}
|
||||
onChange={() => actualizar("industria", opcion)}
|
||||
className="h-4 w-4 accent-azul"
|
||||
/>
|
||||
{opcion}
|
||||
</label>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Campo libre que solo aparece al elegir "Otro" */}
|
||||
{datos.industria === preguntas.opcionOtro && (
|
||||
<div className="mt-2.5 pl-7">
|
||||
<input
|
||||
type="text"
|
||||
value={datos.industriaOtro}
|
||||
onChange={(e) => actualizar("industriaOtro", e.target.value)}
|
||||
placeholder="¿Cuál es tu industria?"
|
||||
className={claseInput(!!errores.industriaOtro)}
|
||||
aria-invalid={!!errores.industriaOtro}
|
||||
aria-label="Especifica tu industria"
|
||||
/>
|
||||
{errores.industriaOtro && (
|
||||
<p className="mt-1 text-sm text-red-600">{errores.industriaOtro}</p>
|
||||
)}
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
value={datos.industriaOtro}
|
||||
onChange={(e) => actualizar("industriaOtro", e.target.value)}
|
||||
placeholder="¿Cuál es tu industria?"
|
||||
className={claseInput(!!errores.industriaOtro)}
|
||||
aria-invalid={!!errores.industriaOtro}
|
||||
aria-label="Especifica tu industria"
|
||||
style={{ marginTop: 2 }}
|
||||
/>
|
||||
)}
|
||||
|
||||
{errores.industria && (
|
||||
<p className="mt-1 text-sm text-red-600">{errores.industria}</p>
|
||||
{errores.industriaOtro && (
|
||||
<span className="ferr">{errores.industriaOtro}</span>
|
||||
)}
|
||||
</fieldset>
|
||||
{errores.industria && <span className="ferr">{errores.industria}</span>}
|
||||
</div>
|
||||
|
||||
{/* Error devuelto por el backend (no se pierden los datos) */}
|
||||
{errorEnvio && (
|
||||
<p
|
||||
<div
|
||||
role="alert"
|
||||
className="rounded-lg border border-red-200 bg-red-50 px-3 py-2.5 text-sm text-red-700"
|
||||
style={{
|
||||
background: "rgba(255,107,107,0.12)",
|
||||
border: "1px solid rgba(255,107,107,0.4)",
|
||||
borderRadius: 12,
|
||||
padding: "12px 14px",
|
||||
fontSize: 13.5,
|
||||
fontWeight: 600,
|
||||
color: "#FF9E7A",
|
||||
}}
|
||||
>
|
||||
{errorEnvio}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
className="btn-primary"
|
||||
disabled={enviando}
|
||||
aria-busy={enviando}
|
||||
className="mt-2 inline-flex w-fit items-center gap-2 rounded-full bg-azul px-7 py-3 text-[15px] font-semibold text-white transition-colors hover:bg-azul-fuerte disabled:cursor-not-allowed disabled:opacity-70 disabled:hover:bg-azul"
|
||||
style={{ alignSelf: "flex-start", marginTop: 6 }}
|
||||
>
|
||||
{enviando && (
|
||||
<span
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
/*
|
||||
* Fondo decorativo de "lámpara de lava": campo de metaballs en un fragment
|
||||
* shader WebGL. 100% visual, sin interacción ni lógica de negocio. Portado
|
||||
* del prototipo de diseño (Lava Hero). Si WebGL no está disponible, no pinta
|
||||
* nada (queda el fondo oscuro base + el velo).
|
||||
*/
|
||||
|
||||
const N = 7;
|
||||
const SPEED = 1;
|
||||
const GRAIN = 0.045;
|
||||
|
||||
// Colores de la lava (de los props por defecto del diseño).
|
||||
const COL_BG: [number, number, number] = hexToRgb("#0a0613");
|
||||
const COL_DEEP: [number, number, number] = hexToRgb("#4c1280");
|
||||
const COL_MID: [number, number, number] = hexToRgb("#e82b7b");
|
||||
const COL_HOT: [number, number, number] = hexToRgb("#ff6b1a");
|
||||
|
||||
function hexToRgb(hex: string): [number, number, number] {
|
||||
const m = /^#?([0-9a-fA-F]{6})$/.exec(hex);
|
||||
const h = m ? m[1] : "000000";
|
||||
const n = parseInt(h, 16);
|
||||
return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];
|
||||
}
|
||||
|
||||
// Blobs con frecuencias inconmensurables → movimiento sin bucle aparente.
|
||||
const BLOBS = [
|
||||
{ r: 0.46, cx: 0.5, ax: 0.1, sx: 0.03, px: 0.0, by: -0.2, ay: 0.05, sy: 0.041, py: 1.7 },
|
||||
{ r: 0.2, cx: 0.3, ax: 0.1, sx: 0.059, px: 2.1, by: 0.46, ay: 0.4, sy: 0.071, py: 0.4 },
|
||||
{ r: 0.165, cx: 0.7, ax: 0.12, sx: 0.047, px: 4.4, by: 0.52, ay: 0.36, sy: 0.053, py: 2.6 },
|
||||
{ r: 0.13, cx: 0.5, ax: 0.14, sx: 0.067, px: 1.0, by: 0.58, ay: 0.33, sy: 0.089, py: 5.0 },
|
||||
{ r: 0.105, cx: 0.85, ax: 0.09, sx: 0.083, px: 3.3, by: 0.4, ay: 0.34, sy: 0.103, py: 1.2 },
|
||||
{ r: 0.085, cx: 0.14, ax: 0.1, sx: 0.097, px: 5.6, by: 0.55, ay: 0.36, sy: 0.113, py: 3.9 },
|
||||
{ r: 0.07, cx: 0.62, ax: 0.12, sx: 0.109, px: 0.7, by: 0.76, ay: 0.24, sy: 0.131, py: 4.7 },
|
||||
];
|
||||
|
||||
const VS_SRC =
|
||||
"attribute vec2 aPos; void main() { gl_Position = vec4(aPos, 0.0, 1.0); }";
|
||||
|
||||
const FS_SRC = `
|
||||
precision highp float;
|
||||
uniform vec2 uRes;
|
||||
uniform float uTime;
|
||||
uniform vec3 uBalls[${N}];
|
||||
uniform vec3 uBg;
|
||||
uniform vec3 uC1;
|
||||
uniform vec3 uC2;
|
||||
uniform vec3 uC3;
|
||||
uniform float uGrain;
|
||||
|
||||
float hash(vec2 p) {
|
||||
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec2 p = gl_FragCoord.xy / uRes.y;
|
||||
float f = 0.0;
|
||||
for (int i = 0; i < ${N}; i++) {
|
||||
vec2 d = p - uBalls[i].xy;
|
||||
float r = uBalls[i].z;
|
||||
f += (r * r) / (dot(d, d) + 1e-4);
|
||||
}
|
||||
float core = smoothstep(0.94, 1.24, f);
|
||||
float halo = pow(clamp(smoothstep(0.40, 1.02, f), 0.0, 1.0), 2.0) * (1.0 - core);
|
||||
vec3 bg = mix(uBg, mix(uBg, uC1, 0.5), pow(1.0 - p.y, 2.4));
|
||||
float heat = clamp((f - 1.0) * 0.55 + (1.0 - p.y) * 0.85, 0.0, 1.0);
|
||||
vec3 lava = mix(uC1, uC2, smoothstep(0.05, 0.5, heat));
|
||||
lava = mix(lava, uC3, smoothstep(0.45, 1.0, heat));
|
||||
float rim = smoothstep(0.98, 1.10, f) * (1.0 - smoothstep(1.10, 1.65, f));
|
||||
lava += uC3 * rim * 0.18;
|
||||
vec3 col = bg + mix(uC1, uC2, 0.6) * halo * 0.45;
|
||||
col = mix(col, lava, core);
|
||||
vec2 q = gl_FragCoord.xy / uRes.xy;
|
||||
col *= 1.0 - 0.30 * pow(length(q - 0.5) * 1.22, 2.0);
|
||||
float g = hash(gl_FragCoord.xy + fract(uTime * 0.37) * 311.0);
|
||||
col += (g - 0.5) * uGrain;
|
||||
gl_FragColor = vec4(col, 1.0);
|
||||
}`;
|
||||
|
||||
export default function LavaBackground() {
|
||||
const canvasRef = useRef<HTMLCanvasElement | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const canvas = canvasRef.current;
|
||||
if (!canvas) return;
|
||||
const gl = canvas.getContext("webgl", {
|
||||
antialias: false,
|
||||
alpha: false,
|
||||
depth: false,
|
||||
stencil: false,
|
||||
});
|
||||
if (!gl) return;
|
||||
|
||||
const compile = (type: number, src: string): WebGLShader | null => {
|
||||
const sh = gl.createShader(type);
|
||||
if (!sh) return null;
|
||||
gl.shaderSource(sh, src);
|
||||
gl.compileShader(sh);
|
||||
return sh;
|
||||
};
|
||||
|
||||
const vs = compile(gl.VERTEX_SHADER, VS_SRC);
|
||||
const fs = compile(gl.FRAGMENT_SHADER, FS_SRC);
|
||||
const prog = gl.createProgram();
|
||||
if (!vs || !fs || !prog) return;
|
||||
gl.attachShader(prog, vs);
|
||||
gl.attachShader(prog, fs);
|
||||
gl.linkProgram(prog);
|
||||
if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) return;
|
||||
gl.useProgram(prog);
|
||||
|
||||
const buf = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, buf);
|
||||
gl.bufferData(
|
||||
gl.ARRAY_BUFFER,
|
||||
new Float32Array([-1, -1, 3, -1, -1, 3]),
|
||||
gl.STATIC_DRAW
|
||||
);
|
||||
const aPos = gl.getAttribLocation(prog, "aPos");
|
||||
gl.enableVertexAttribArray(aPos);
|
||||
gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);
|
||||
|
||||
const u = {
|
||||
res: gl.getUniformLocation(prog, "uRes"),
|
||||
time: gl.getUniformLocation(prog, "uTime"),
|
||||
balls: gl.getUniformLocation(prog, "uBalls"),
|
||||
bg: gl.getUniformLocation(prog, "uBg"),
|
||||
c1: gl.getUniformLocation(prog, "uC1"),
|
||||
c2: gl.getUniformLocation(prog, "uC2"),
|
||||
c3: gl.getUniformLocation(prog, "uC3"),
|
||||
grain: gl.getUniformLocation(prog, "uGrain"),
|
||||
};
|
||||
|
||||
const ballData = new Float32Array(N * 3);
|
||||
const dpr = Math.min(window.devicePixelRatio || 1, 1.5);
|
||||
|
||||
const resize = () => {
|
||||
const w = Math.max(1, Math.round(canvas.clientWidth * dpr));
|
||||
const h = Math.max(1, Math.round(canvas.clientHeight * dpr));
|
||||
if (canvas.width !== w || canvas.height !== h) {
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
gl.viewport(0, 0, w, h);
|
||||
}
|
||||
};
|
||||
const ro = new ResizeObserver(resize);
|
||||
ro.observe(canvas);
|
||||
resize();
|
||||
|
||||
let raf = 0;
|
||||
let t = 0;
|
||||
let last = performance.now();
|
||||
|
||||
const loop = (now: number) => {
|
||||
raf = requestAnimationFrame(loop);
|
||||
const dt = Math.min((now - last) / 1000, 0.05);
|
||||
last = now;
|
||||
if (document.hidden || canvas.width === 0) return;
|
||||
|
||||
t += dt * SPEED;
|
||||
const tt = t + 40; // arranca a mitad de ciclo
|
||||
const aspect = canvas.width / canvas.height;
|
||||
|
||||
for (let i = 0; i < BLOBS.length; i++) {
|
||||
const b = BLOBS[i];
|
||||
ballData[i * 3] =
|
||||
b.cx * aspect +
|
||||
b.ax * Math.sin(tt * b.sx + b.px) +
|
||||
0.05 * Math.sin(tt * b.sx * 2.71 + b.px * 1.7);
|
||||
ballData[i * 3 + 1] =
|
||||
b.by +
|
||||
b.ay * Math.sin(tt * b.sy + b.py) +
|
||||
0.045 * Math.sin(tt * b.sy * 3.13 + b.py * 0.6);
|
||||
ballData[i * 3 + 2] = b.r * (1 + 0.07 * Math.sin(tt * 0.31 + b.px * 2.3));
|
||||
}
|
||||
|
||||
gl.uniform2f(u.res, canvas.width, canvas.height);
|
||||
gl.uniform1f(u.time, t);
|
||||
gl.uniform3fv(u.balls, ballData);
|
||||
gl.uniform3fv(u.bg, COL_BG);
|
||||
gl.uniform3fv(u.c1, COL_DEEP);
|
||||
gl.uniform3fv(u.c2, COL_MID);
|
||||
gl.uniform3fv(u.c3, COL_HOT);
|
||||
gl.uniform1f(u.grain, GRAIN);
|
||||
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
||||
};
|
||||
raf = requestAnimationFrame(loop);
|
||||
|
||||
return () => {
|
||||
cancelAnimationFrame(raf);
|
||||
ro.disconnect();
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="lava-layer" aria-hidden>
|
||||
<canvas
|
||||
ref={canvasRef}
|
||||
style={{ display: "block", width: "100%", height: "100%" }}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import Image from "next/image";
|
||||
import { Clock, Video, Calendar, Globe } from "lucide-react";
|
||||
import { evento } from "@/config/evento";
|
||||
import { formatearFechaLarga, formatearRango } from "@/lib/fechas";
|
||||
import { formatearFechaCorta } from "@/lib/fechas";
|
||||
|
||||
interface PanelInfoProps {
|
||||
/** Fecha elegida (si ya se eligió), para mostrar el resumen en el panel. */
|
||||
@@ -9,64 +10,117 @@ interface PanelInfoProps {
|
||||
horaSeleccionada: string | null;
|
||||
}
|
||||
|
||||
const ACENTO = "#FF9E5C";
|
||||
|
||||
/**
|
||||
* Columna izquierda fija que acompaña todas las etapas del flujo.
|
||||
* Muestra empresa, título, duración, nota de conferencia y descripción.
|
||||
* Cuando ya hay fecha/hora, agrega el resumen de la cita (igual que Calendly).
|
||||
* Columna izquierda fija (panel de info) en el rediseño oscuro.
|
||||
* Lee los datos de la config; solo cambia la apariencia.
|
||||
*/
|
||||
export default function PanelInfo({
|
||||
fechaSeleccionada,
|
||||
horaSeleccionada,
|
||||
}: PanelInfoProps) {
|
||||
const panelDateTime = fechaSeleccionada
|
||||
? formatearFechaCorta(fechaSeleccionada) +
|
||||
(horaSeleccionada ? ` · ${horaSeleccionada}` : "")
|
||||
: "";
|
||||
|
||||
return (
|
||||
<aside className="flex flex-col gap-5 border-b border-borde p-7 md:border-b-0 md:border-r md:p-8">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-marino-2">{evento.empresa}</p>
|
||||
<h1 className="mt-1 text-2xl font-bold leading-tight text-marino">
|
||||
<aside className="collina-panel">
|
||||
<Image
|
||||
src="/collina-logo-light.png"
|
||||
alt="Collina Systems"
|
||||
width={2374}
|
||||
height={948}
|
||||
priority
|
||||
style={{ width: 152, height: "auto", margin: "0 auto", display: "block" }}
|
||||
/>
|
||||
|
||||
<div style={{ marginTop: 12 }}>
|
||||
<h1
|
||||
className="serif"
|
||||
style={{
|
||||
margin: 0,
|
||||
fontWeight: 700,
|
||||
fontSize: 31,
|
||||
lineHeight: 1.08,
|
||||
letterSpacing: "-0.01em",
|
||||
color: "#FBEFF6",
|
||||
}}
|
||||
>
|
||||
{evento.titulo}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-3 text-marino-2">
|
||||
<div className="flex items-center gap-2.5">
|
||||
<Clock className="h-4 w-4 shrink-0 text-marino-2" aria-hidden />
|
||||
<span className="text-[15px] font-medium">
|
||||
{evento.duracionMin} min
|
||||
</span>
|
||||
{/* Meta */}
|
||||
<div className="flex flex-col gap-3">
|
||||
<div
|
||||
className="flex items-center gap-2.5"
|
||||
style={{ fontSize: 14.5, fontWeight: 600, color: "rgba(248,232,240,0.78)" }}
|
||||
>
|
||||
<Clock size={18} style={{ color: ACENTO, flexShrink: 0 }} aria-hidden />
|
||||
<span style={{ whiteSpace: "nowrap" }}>{evento.duracionMin} min</span>
|
||||
</div>
|
||||
|
||||
<div className="flex items-start gap-2.5">
|
||||
<Video className="mt-0.5 h-4 w-4 shrink-0 text-marino-2" aria-hidden />
|
||||
<span className="text-[15px] leading-snug">
|
||||
{evento.notaConferencia}
|
||||
</span>
|
||||
<div
|
||||
className="flex items-start gap-2.5"
|
||||
style={{
|
||||
fontSize: 13.5,
|
||||
fontWeight: 500,
|
||||
lineHeight: 1.5,
|
||||
color: "rgba(248,232,240,0.72)",
|
||||
}}
|
||||
>
|
||||
<Video
|
||||
size={18}
|
||||
style={{ color: ACENTO, flexShrink: 0, marginTop: 1 }}
|
||||
aria-hidden
|
||||
/>
|
||||
<span>{evento.notaConferencia}</span>
|
||||
</div>
|
||||
|
||||
{/* Resumen de la cita: aparece en cuanto se elige fecha y hora */}
|
||||
{fechaSeleccionada && horaSeleccionada && (
|
||||
<div className="flex items-start gap-2.5 font-semibold text-marino">
|
||||
<Calendar
|
||||
className="mt-0.5 h-4 w-4 shrink-0 text-marino"
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="text-[15px] leading-snug">
|
||||
{formatearRango(horaSeleccionada, evento.duracionMin)},{" "}
|
||||
{formatearFechaLarga(fechaSeleccionada)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{fechaSeleccionada && horaSeleccionada && (
|
||||
<div className="flex items-center gap-2.5">
|
||||
<Globe className="h-4 w-4 shrink-0 text-marino-2" aria-hidden />
|
||||
<span className="text-[15px]">{evento.zonaHorariaLabel}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<p className="mt-1 border-t border-borde pt-5 text-sm leading-relaxed text-marino-2">
|
||||
<p
|
||||
style={{
|
||||
margin: 0,
|
||||
fontSize: 14,
|
||||
fontWeight: 400,
|
||||
lineHeight: 1.6,
|
||||
color: "rgba(248,232,240,0.7)",
|
||||
}}
|
||||
>
|
||||
{evento.descripcion}
|
||||
</p>
|
||||
|
||||
{/* Selección elegida (aparece al elegir fecha) */}
|
||||
{fechaSeleccionada && (
|
||||
<div
|
||||
className="flex flex-col gap-3"
|
||||
style={{
|
||||
paddingTop: 20,
|
||||
borderTop: "1px solid rgba(255,200,225,0.12)",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="flex items-start gap-2.5"
|
||||
style={{ fontSize: 14, fontWeight: 700, color: "#FBEFF6" }}
|
||||
>
|
||||
<Calendar
|
||||
size={18}
|
||||
style={{ color: ACENTO, flexShrink: 0, marginTop: 1 }}
|
||||
aria-hidden
|
||||
/>
|
||||
<span>{panelDateTime}</span>
|
||||
</div>
|
||||
<div
|
||||
className="flex items-center gap-2.5"
|
||||
style={{ fontSize: 13.5, fontWeight: 500, color: "rgba(248,232,240,0.7)" }}
|
||||
>
|
||||
<Globe size={18} style={{ color: ACENTO, flexShrink: 0 }} aria-hidden />
|
||||
<span>{evento.zonaHorariaLabel} (GMT-6)</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
+168
-53
@@ -1,36 +1,43 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { ArrowLeft, CalendarX2, RotateCw } from "lucide-react";
|
||||
import { evento } from "@/config/evento";
|
||||
import { ChevronLeft, CalendarX2, RotateCw } from "lucide-react";
|
||||
import { formatearFechaLarga, fechaISOLocal } from "@/lib/fechas";
|
||||
|
||||
interface SelectorHoraProps {
|
||||
/** Fecha elegida en la etapa anterior. */
|
||||
fecha: Date;
|
||||
/** Se llama al elegir un bloque de horario "HH:mm". */
|
||||
/** Se llama al confirmar un bloque de horario "HH:mm". */
|
||||
onSeleccionar: (hora: string) => void;
|
||||
/** Volver a la etapa de elegir fecha. */
|
||||
onVolver: () => void;
|
||||
/** Aviso opcional (p. ej. cuando un horario se ocupó y hay que reelegir). */
|
||||
aviso?: string | null;
|
||||
/** Texto del botón de confirmación (visual). */
|
||||
etiquetaConfirmar?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Etapa "hora": consulta la disponibilidad real del día a /api/disponibilidad
|
||||
* y muestra solo los bloques libres. Maneja carga, vacío y error.
|
||||
*
|
||||
* El usuario marca un horario y lo confirma con el botón ("Continuar"); ahí se
|
||||
* dispara onSeleccionar con el mismo "HH:mm" del backend.
|
||||
*/
|
||||
export default function SelectorHora({
|
||||
fecha,
|
||||
onSeleccionar,
|
||||
onVolver,
|
||||
aviso = null,
|
||||
etiquetaConfirmar = "Continuar",
|
||||
}: SelectorHoraProps) {
|
||||
const [horarios, setHorarios] = useState<string[]>([]);
|
||||
const [cargando, setCargando] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
// Cambiar este contador fuerza un reintento del fetch.
|
||||
const [intento, setIntento] = useState(0);
|
||||
// Horario marcado antes de confirmar (barra "Continuar").
|
||||
const [slotElegido, setSlotElegido] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
let activo = true;
|
||||
@@ -69,61 +76,94 @@ export default function SelectorHora({
|
||||
}, [fecha, intento]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col p-7 md:p-8">
|
||||
<div className="mb-5 flex items-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={onVolver}
|
||||
aria-label="Volver a elegir la fecha"
|
||||
className="grid h-9 w-9 place-items-center rounded-full text-marino transition-colors hover:bg-azul-suave"
|
||||
>
|
||||
<ArrowLeft className="h-5 w-5" />
|
||||
</button>
|
||||
<div>
|
||||
<h2 className="text-lg font-bold leading-tight text-marino">
|
||||
Selecciona una hora
|
||||
</h2>
|
||||
<p className="text-sm capitalize text-marino-2">
|
||||
{formatearFechaLarga(fecha)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 20 }}>
|
||||
<button type="button" className="btn-ghost" onClick={onVolver}>
|
||||
<ChevronLeft size={16} strokeWidth={2.2} />
|
||||
Volver al calendario
|
||||
</button>
|
||||
|
||||
{/* Aviso (p. ej. tras un horario que se ocupó) */}
|
||||
{aviso && (
|
||||
<p
|
||||
<div
|
||||
role="alert"
|
||||
className="mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2.5 text-sm text-amber-800"
|
||||
style={{
|
||||
background: "rgba(232,43,123,0.12)",
|
||||
border: "1px solid rgba(232,43,123,0.32)",
|
||||
borderRadius: 14,
|
||||
padding: "12px 14px",
|
||||
fontSize: 13.5,
|
||||
lineHeight: 1.5,
|
||||
color: "rgba(248,232,240,0.82)",
|
||||
}}
|
||||
>
|
||||
{aviso}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<p className="mb-3 text-sm font-medium text-marino-2">
|
||||
Duración: {evento.duracionMin} min
|
||||
</p>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 6 }}>
|
||||
<span className="eyebrow">Selecciona un horario</span>
|
||||
<h2
|
||||
className="serif"
|
||||
style={{
|
||||
margin: 0,
|
||||
fontWeight: 600,
|
||||
fontSize: 24,
|
||||
letterSpacing: "-0.01em",
|
||||
color: "#FBEFF6",
|
||||
}}
|
||||
>
|
||||
{formatearFechaLarga(fecha)}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
{/* Estado: cargando */}
|
||||
{cargando && (
|
||||
<div className="flex items-center gap-2.5 py-8 text-marino-2">
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: 16,
|
||||
padding: "60px 0",
|
||||
minHeight: 220,
|
||||
}}
|
||||
>
|
||||
<div style={{ display: "flex", gap: 7 }}>
|
||||
<span className="cdot" />
|
||||
<span className="cdot" />
|
||||
<span className="cdot" />
|
||||
</div>
|
||||
<span
|
||||
className="h-4 w-4 animate-spin rounded-full border-2 border-azul/30 border-t-azul"
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="text-sm">Cargando horarios…</span>
|
||||
style={{ fontSize: 14.5, fontWeight: 600, color: "rgba(248,232,240,0.55)" }}
|
||||
>
|
||||
Cargando horarios…
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Estado: error con reintento */}
|
||||
{!cargando && error && (
|
||||
<div className="flex flex-col items-start gap-3 py-6">
|
||||
<p className="text-sm text-red-600">{error}</p>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
gap: 14,
|
||||
padding: "48px 24px",
|
||||
minHeight: 220,
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
<p style={{ margin: 0, fontSize: 15, fontWeight: 600, color: "#FF9E7A" }}>
|
||||
{error}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
className="btn-ghost"
|
||||
onClick={() => setIntento((n) => n + 1)}
|
||||
className="inline-flex items-center gap-2 rounded-full border border-azul/40 px-4 py-2 text-sm font-semibold text-azul transition-colors hover:bg-azul hover:text-white"
|
||||
>
|
||||
<RotateCw className="h-4 w-4" aria-hidden />
|
||||
<RotateCw size={16} strokeWidth={2.2} />
|
||||
Reintentar
|
||||
</button>
|
||||
</div>
|
||||
@@ -131,16 +171,45 @@ export default function SelectorHora({
|
||||
|
||||
{/* Estado: sin horarios */}
|
||||
{!cargando && !error && horarios.length === 0 && (
|
||||
<div className="flex flex-col items-center gap-3 py-10 text-center">
|
||||
<CalendarX2 className="h-8 w-8 text-marino-2" aria-hidden />
|
||||
<p className="text-sm text-marino-2">
|
||||
No hay horarios disponibles este día, elige otro.
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: 12,
|
||||
padding: "52px 24px",
|
||||
minHeight: 220,
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
width: 54,
|
||||
height: 54,
|
||||
borderRadius: "50%",
|
||||
background: "rgba(255,255,255,0.05)",
|
||||
border: "1px solid rgba(255,255,255,0.12)",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
>
|
||||
<CalendarX2 size={24} style={{ color: "rgba(248,232,240,0.45)" }} aria-hidden />
|
||||
</div>
|
||||
<p style={{ margin: 0, fontSize: 15, fontWeight: 700, color: "#FBEFF6" }}>
|
||||
No hay horarios disponibles este día
|
||||
</p>
|
||||
<p style={{ margin: 0, fontSize: 14, fontWeight: 500, color: "rgba(248,232,240,0.7)" }}>
|
||||
Vuelve al calendario y elige otra fecha.
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
className="btn-ghost"
|
||||
onClick={onVolver}
|
||||
className="inline-flex items-center gap-2 rounded-full bg-azul px-5 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-azul-fuerte"
|
||||
style={{ marginTop: 4 }}
|
||||
>
|
||||
<ChevronLeft size={16} strokeWidth={2.2} />
|
||||
Elegir otra fecha
|
||||
</button>
|
||||
</div>
|
||||
@@ -148,18 +217,64 @@ export default function SelectorHora({
|
||||
|
||||
{/* Estado: lista de horarios disponibles */}
|
||||
{!cargando && !error && horarios.length > 0 && (
|
||||
<div className="flex max-h-[22rem] flex-col gap-2.5 overflow-y-auto pr-1">
|
||||
{horarios.map((hora) => (
|
||||
<button
|
||||
key={hora}
|
||||
type="button"
|
||||
onClick={() => onSeleccionar(hora)}
|
||||
className="w-full rounded-lg border border-azul/40 bg-white py-3 text-center text-[15px] font-semibold text-azul transition-colors hover:border-azul hover:bg-azul hover:text-white"
|
||||
<>
|
||||
<div
|
||||
className="slot-grid"
|
||||
style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 12 }}
|
||||
>
|
||||
{horarios.map((hora) => (
|
||||
<button
|
||||
key={hora}
|
||||
type="button"
|
||||
className={"slot" + (slotElegido === hora ? " slot--sel" : "")}
|
||||
onClick={() => setSlotElegido(hora)}
|
||||
>
|
||||
{hora}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Barra de confirmación */}
|
||||
{slotElegido && (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
gap: 16,
|
||||
background: "rgba(255,255,255,0.05)",
|
||||
border: "1px solid rgba(255,255,255,0.10)",
|
||||
borderRadius: 14,
|
||||
padding: "14px 16px",
|
||||
marginTop: 4,
|
||||
}}
|
||||
>
|
||||
{hora}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 2 }}>
|
||||
<span
|
||||
style={{
|
||||
fontSize: 11,
|
||||
fontWeight: 700,
|
||||
letterSpacing: "0.1em",
|
||||
textTransform: "uppercase",
|
||||
color: "rgba(248,232,240,0.55)",
|
||||
}}
|
||||
>
|
||||
Horario seleccionado
|
||||
</span>
|
||||
<span style={{ fontSize: 16, fontWeight: 700, color: "#FBEFF6" }}>
|
||||
{slotElegido}
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="btn-primary"
|
||||
onClick={() => onSeleccionar(slotElegido)}
|
||||
>
|
||||
{etiquetaConfirmar}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -23,6 +23,16 @@ export function formatearMesAnio(fecha: Date): string {
|
||||
return `${capitalizar(mes)} ${fecha.getFullYear()}`;
|
||||
}
|
||||
|
||||
/** "Lunes 15 de junio" — fecha corta (sin año) para el panel. */
|
||||
export function formatearFechaCorta(fecha: Date): string {
|
||||
const texto = new Intl.DateTimeFormat(LOCALE, {
|
||||
weekday: "long",
|
||||
day: "numeric",
|
||||
month: "long",
|
||||
}).format(fecha);
|
||||
return capitalizar(texto.replace(",", ""));
|
||||
}
|
||||
|
||||
/** "viernes, 6 de junio de 2026" — fecha completa con día de la semana. */
|
||||
export function formatearFechaLarga(fecha: Date): string {
|
||||
const texto = new Intl.DateTimeFormat(LOCALE, {
|
||||
|
||||
Reference in new issue
Block a user