/* global React, Wordmark, Icon, WA_URL, PHONE_FMT, EMAIL, Reveal */
const { useState: useStateHome, useEffect: useEffectHome } = React;
const INDUSTRIAL_URL = 'empresas.html';
const HOGAR_URL = 'SLF Solar - Hogar.html';
/* ===========================================================
Shared minimal header for the welcome / Inicio page
=========================================================== */
function InicioNav({ tone = 'dark' }) {
return (
);
}
/* ===========================================================
World panel content (shared between layouts)
=========================================================== */
const HOGAR = {
href: HOGAR_URL,
eyebrow: 'Hogar & Familia',
title: 'Tu casa, con energía propia',
desc: 'Baja tu cuenta de luz con energía solar, agua caliente y climatización. Energía renovable, asesoría cercana y respaldo de verdad.',
bullets: ['Ahorro mensual concreto', 'Energía 100% renovable', 'Asesoría por WhatsApp'],
cta: 'Soluciones para mi hogar',
photo: 'uploads/sunlightfree_energia_limpia.webp',
phTag: 'FOTO · familia frente a su casa con paneles solares',
};
const INDUSTRIAL = {
href: INDUSTRIAL_URL,
eyebrow: 'Empresas & Industria',
title: 'Energía que no se detiene',
desc: 'Plantas solares industriales, respaldo con baterías, termosolar, cargadores EV y torres de iluminación híbridas. Ingeniería, instalación y O&M.',
bullets: ['Fichas técnicas reales', 'Casos verificables', 'Operación y mantenimiento'],
cta: 'Soluciones industriales',
photo: 'uploads/empresas-hero-fabrica-techo-solar-cdd65be9.webp',
phTag: 'FOTO · planta solar industrial — vista aérea',
};
/* ===========================================================
LAYOUT A — Split screen (two worlds, 50/50)
=========================================================== */
function SplitHome() {
const [hover, setHover] = useStateHome(null); // 'hogar' | 'ind' | null
const flex = (key) => {
if (hover === null) return 1;
return hover === key ? 1.25 : 0.75;
};
return (
{/* HOGAR side */}
setHover('hogar')}
onMouseLeave={() => setHover(null)}
className="split-side"
style={{
flex: flex('hogar'),
position: 'relative', overflow: 'hidden',
transition: 'flex .5s cubic-bezier(.4,0,.2,1)',
display: 'flex', alignItems: 'flex-end',
background: 'linear-gradient(180deg, #FBF8F1 0%, #F4EEE1 100%)',
color: 'var(--warm-ink)',
textAlign: 'left',
}}
>
{/* warm photo */}
{/* readability scrim */}
{/* INDUSTRIAL side */}
setHover('ind')}
onMouseLeave={() => setHover(null)}
className="split-side"
style={{
flex: flex('ind'),
position: 'relative', overflow: 'hidden',
transition: 'flex .5s cubic-bezier(.4,0,.2,1)',
display: 'flex', alignItems: 'flex-end',
background: 'linear-gradient(180deg, #133362 0%, #061328 100%)',
color: '#fff', textAlign: 'left',
}}
>
{/* Center brand medallion */}
Tu Energía, Nuestra Pasión
);
}
function WorldContent({ data, accent, accentInk, muted, onDark }) {
return (
{data.eyebrow}
{data.title}
{data.desc}
{data.bullets.map((b) => (
-
{b}
))}
{data.cta}
);
}
/* ===========================================================
LAYOUT B — Editorial (centered promise + two entry cards)
=========================================================== */
function EditorialHome() {
return (
<>
SLF Solar · operando en Chile desde 2014
Tu Energía, Nuestra Pasión.
Energía solar para tu hogar y para tu industria. Elige tu camino y te acompañamos desde el primer cálculo hasta la operación.
{/* Two entry cards */}
>
);
}
function EntryCard({ data, variant }) {
const warm = variant === 'warm';
const accent = warm ? 'var(--leaf)' : 'var(--solar)';
const accentInk = warm ? '#fff' : '#0B2545';
return (
{/* media */}
{/* body */}
{data.eyebrow}
{data.title}
{data.desc}
{data.bullets.map((b) => (
-
{b}
))}
{data.cta}
);
}
/* ===========================================================
Shared brand-promise strip + footer (used by Editorial)
=========================================================== */
function PromiseStrip() {
const items = [
{ n: '12', s: ' años', l: 'operando en Chile' },
{ n: '+2.500', s: '', l: 'instalaciones realizadas' },
{ n: 'Arica', s: '→ Pta. Montt', l: 'cobertura nacional' },
{ n: '100%', s: '', l: 'energía renovable' },
];
return (
);
}
function InicioFooter() {
return (
);
}
Object.assign(window, { SplitHome, EditorialHome, InicioNav, INDUSTRIAL_URL, HOGAR_URL });