/* global React, CONTENT */
const { useState, useEffect, useRef } = React;
// ============= EXTERNAL LINKS =============
const URL_DISTRIBUTOR = 'https://enrollment.unicity.com/c/POLSKI';
const URL_SHOP = 'https://unicity.link/ad1e21faba';
const URL_CALL = 'https://calendar.google.com/calendar/u/0/appointments/schedules/AcZssZ0YH-YrMm8ViaATKiQ_LglFrD1AGpDCkxSofrMYPECks6qxHOPE70QCtOJduxlTT-judrBppnzq';
const extProps = { target: '_blank', rel: 'noopener noreferrer' };
// ============= ICONS (brand style: circular line icons) =============
function BIcon({ name, size = 56, color }) {
const paths = {
flask: <>>,
globe: <>>,
shield: ,
people: <>>,
};
return (
);
}
// Original circular infinity-style mark (NOT Unicity logo)
function BrandMark({ size = 28, color }) {
return (
);
}
// ============= LANG BAR (floating) =============
function LangBar({ lang, setLang }) {
return (
);
}
// ============= NAV =============
function Nav({ lang, setLang }) {
const [scrolled, setScrolled] = useState(false);
const t = CONTENT[lang];
useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 40);
window.addEventListener('scroll', onScroll); onScroll();
return () => window.removeEventListener('scroll', onScroll);
}, []);
return (
);
}
// ============= HERO =============
function Hero({ lang }) {
const t = CONTENT[lang].hero;
return (
{t.badge}
{t.h1Main}
{t.h1Sub}
{t.lede}
{t.stats.map((s, i) => (
{s.num}
{s.label}
))}
);
}
// ============= WHO WE ARE =============
function Who({ lang }) {
const t = CONTENT[lang].who;
return (
{t.eyebrow}
{t.h2}
{t.h2Italic}
{t.p1}
{t.facts.map((f, i) => (
))}
);
}
// ============= PROBLEM =============
function Problem({ lang }) {
const t = CONTENT[lang].problem;
return (
{t.eyebrow}
{t.h2}
{t.h2Italic}
{t.p1}
{t.p2}
{t.stats.map((s, i) => (
))}
);
}
// ============= PRODUCTS =============
function Products({ lang }) {
const t = CONTENT[lang].products;
return (
{t.eyebrow}
{t.h2}
{t.h2Italic}
{t.p}
);
}
function ProductCard({ data, image, href, reveal, coral }) {
return (
{data.tag}
{data.list.map((item, i) => (
-
0{i + 1}
{item}
))}
{data.flavorsLabel}:
{data.flavors.map(f => {f})}
);
}
// ============= DAILY RHYTHM =============
function Rhythm({ lang }) {
const t = CONTENT[lang].rhythm;
const [active, setActive] = useState(0);
const sectionRef = useRef(null);
const timerRef = useRef(null);
useEffect(() => {
const section = sectionRef.current;
if (!section) return;
const io = new IntersectionObserver((entries) => {
entries.forEach(e => {
if (e.isIntersecting) {
if (!timerRef.current) {
timerRef.current = setInterval(() => {
setActive(a => (a + 1) % t.steps.length);
}, 2600);
}
} else {
if (timerRef.current) { clearInterval(timerRef.current); timerRef.current = null; }
}
});
}, { threshold: 0.3 });
io.observe(section);
return () => { io.disconnect(); if (timerRef.current) clearInterval(timerRef.current); };
}, [t.steps.length]);
const progressPct = (active / (t.steps.length - 1)) * 100;
const certs = ['Halal', 'Kosher', 'Gluten Free', 'GMP Certified', 'LGC Informed Choice', 'Clean Label', '3rd Party Tested'];
return (
{t.steps.map((s, i) => (
{ if (timerRef.current) { clearInterval(timerRef.current); timerRef.current = null; } setActive(i); }}
>
{s.time}
{s.title}
{s.desc}
))}
{certs.map(c => {c})}
);
}
// ============= VIDEOS (Instagram embeds) =============
const YT_PLAYLIST_ID = 'PLGXYTCmhclCt59z6ohURiZ8JZN178IuIq';
const YT_FIRST_VIDEO = 'Dq-076yCRDE';
function VideoCard({ v, i }) {
const [playing, setPlaying] = useState(false);
// Each card opens the playlist, each starting at its own index
const embedSrc = `https://www.youtube.com/embed/${YT_FIRST_VIDEO}?list=${YT_PLAYLIST_ID}&index=${i + 1}&autoplay=1&rel=0&modestbranding=1`;
const thumbSrc = `https://i.ytimg.com/vi/${YT_FIRST_VIDEO}/hqdefault.jpg`;
return (
{playing ? (
) : (
<>
>
)}
EP · {v.num}
{v.title}
);
}
function Videos({ lang }) {
const t = CONTENT[lang].videos;
return (
{t.items.map((v, i) => (
))}
);
}
// ============= WAYS =============
function Ways({ lang }) {
const t = CONTENT[lang].ways;
const [tab, setTab] = useState(0);
return (
{t.tabs.map((label, i) => (
))}
);
}
function WaysPanel({ data, active, image }) {
return (
{data.benefits.map(([num, text], i) => (
- {num}{text}
))}
);
}
// ============= EVENT =============
function Event({ lang }) {
const t = CONTENT[lang].event;
return (
Nice
{t.eyebrow}
{t.h2}
{t.h2Italic}
{t.where}
{t.whereValue}
{t.when}
{t.whenValue}
{t.desc}
{t.cta} →
Unicity Europe · Inaugural
2026
26
sep.
);
}
// ============= TESTIMONIALS =============
function Testimonials({ lang }) {
const t = CONTENT[lang].testimonials;
return (
{t.items.map((item, i) => (
★★★★★
"{item.quote}"
{item.name.charAt(0)}
{item.name}
{item.loc}
))}
);
}
// ============= FAQ =============
function FAQ({ lang }) {
const t = CONTENT[lang].faq;
const [open, setOpen] = useState(0);
return (
{t.items.map((item, i) => (
))}
);
}
// ============= FINAL =============
function Final({ lang }) {
const t = CONTENT[lang].final;
return (
);
}
// ============= FOOTER =============
function Footer({ lang }) {
const t = CONTENT[lang].footer;
return (
);
}
Object.assign(window, {
Nav, LangBar, Hero, Who, Problem, Products, Rhythm, Videos, Ways, Event, Testimonials, FAQ, Final, Footer
});