// iPhone mockup — mirrors the 4 onboarding screens from Figma
const { useState, useEffect, useRef } = React;
// ── System icons ──────────────────────────────────────────
const IconBattery = () =>
;
const IconSignal = () =>
;
const IconWifi = () =>
;
const IconPlus = () =>
;
const IconArrowUp = () =>
;
// ── Slide 1: World Overview ────────────────────────────────
function SlideWorlds({ copy }) {
const c = copy.iphone;
return (
{c.worlds.map((w, i) =>
{w.name}
{w.isNew && NEW}
{w.desc}
{w.tags.map(([e, t], j) =>
{e}{t}
)}
)}
);
}
// ── Slide 2: Customise — region edit ───────────────────────
function SlideCustomise({ copy }) {
const r = copy.iphone.region;
return (
{r.labels.government}
{r.government.icon}
{r.government.value}
{r.labels.population}
{r.population.icon}
{r.population.value}
{r.labels.capital}
{r.capital.icon}
{r.capital.value}
{r.bubble}
);
}
// ── Slide 3: AI find & change ──────────────────────────────
function SlideAIChat({ copy }) {
const a = copy.iphone.ai;
return (
{a.userMsg}
{a.leadPre}
{a.leadChip}
{a.ready}
{a.diff.map((d, i) =>
{d.k}:
{d.v}
)}
);
}
// ── Slide 4: Roleplay simulation ───────────────────────────
function SlideRoleplay({ copy }) {
const r = copy.iphone.rp;
return (
📜
{r.quest.label}
{r.quest.title}
{r.dialogue}
);
}
// ── iPhone wrapper ─────────────────────────────────────────
function IPhone({ lang, slide, onSlide, parallax = 0 }) {
const copy = window.COPY[lang];
const slides = [SlideWorlds, SlideCustomise, SlideAIChat, SlideRoleplay];
const Active = slides[slide];
// Subtle mouse tilt
const stageRef = useRef(null);
const [tilt, setTilt] = useState({ x: 0, y: 0 });
useEffect(() => {
const handler = (e) => {
const rect = stageRef.current?.getBoundingClientRect();
if (!rect) return;
const cx = rect.left + rect.width / 2;
const cy = rect.top + rect.height / 2;
const dx = (e.clientX - cx) / window.innerWidth;
const dy = (e.clientY - cy) / window.innerHeight;
setTilt({ x: dy * -6, y: dx * 6 });
};
window.addEventListener("mousemove", handler);
return () => window.removeEventListener("mousemove", handler);
}, []);
return (
9:41
{slides.map((_, i) =>
onSlide && onSlide(i)}
style={{ cursor: "pointer" }} />
)}
);
}
Object.assign(window, { IPhone });