// home-about.jsx: "Hi, I'm Lamia" sticky board (lens on portrait, polaroids), word-by-word paragraphs, // counting stats, film ribbon bridge into Work. const ABOUT_HL = ['high-end visuals,', 'creative editing,', 'organic storytelling.', 'golden hour,', 'remember.']; const ABOUT_STAT_STYLE = [{ bg: 'var(--sun)', r: -3, tr: -5 }, { bg: 'var(--pop)', r: 2, tr: 4 }, { bg: 'var(--blue-soft)', r: -1.5, tr: -3 }]; // "5+yrs" -> { n: 3, suf: '+yrs' }; "300+" -> { n: 300, suf: '+' } function parseStat(v) { const m = String(v).match(/^(\d+)(.*)$/); return m ? { n: +m[1], suf: m[2] } : { n: 0, suf: '' }; } function aboutWords(p) { const arr = p.split(' '); const isHl = (k) => { if (k < 0 || k >= arr.length) return 0; const two = arr[k] + ' ' + (arr[k + 1] || ''), prev = (arr[k - 1] || '') + ' ' + arr[k]; return ABOUT_HL.some((x) => x === two || x === prev || x === arr[k]) ? 1 : 0; }; return arr.map((t, k) => { const hl = isHl(k); return { t, hl, shl: hl && isHl(k + 1) && !/[,.]$/.test(t) ? 1 : 0 }; }); } function About() { const A = (window.SITE_CONTENT && window.SITE_CONTENT.about) || {}; const paras = A.paragraphs || [], stats = A.stats || [], ann = A.annotations || ["that's me!", 'iPhone 18 Pro, always'], pcap = A.polaroids || []; const { W, H, mobile: mob } = useViewport(); const secRef = React.useRef(null), stageRef = React.useRef(null), photoRef = React.useRef(null), lensRef = React.useRef(null), ringRef = React.useRef(null), statsRef = React.useRef(null), ribbonRef = React.useRef(null); const [step, setStep] = React.useState(0); const S = React.useRef({ ptr: { in: false }, step: 0, mob }).current; S.mob = mob; React.useEffect(() => { const s = secRef.current; Engine.invalidate(s); LL.decorate(s); }, [mob]); React.useEffect(() => { const w = Engine.w, qa = Engine.qa, red = LL.REDUCED; return Engine.add((dt, now) => { const sec = secRef.current, ph = photoRef.current; if (!sec || !ph || !Engine.vis(sec)) return; const vh = innerHeight, mobile = S.mob; const sr = sec.getBoundingClientRect(); if (!S.intro && sr.top < vh * 0.7) { S.intro = true; const draw = (p, d, dur) => { if (red) { w(p, 'strokeDashoffset', '0'); return; } p.animate([{ strokeDashoffset: 1 }, { strokeDashoffset: 0 }], { duration: dur || 800, delay: d, easing: 'cubic-bezier(.65,0,.35,1)', fill: 'forwards' }); }; qa(sec, '[data-aw]').forEach((el, i) => !red && el.animate([{ opacity: 0, transform: 'translateY(.5em) rotate(4deg)' }, { opacity: 1, transform: 'none' }], { duration: 900, delay: i * 110, easing: LL.EASE.spring, fill: 'backwards' })); const sc = sec.querySelector('[data-ascrib] path'); sc && draw(sc, 600, 1100); qa(sec, '[data-ann]').forEach((el, i) => { const base = el.style.transform; if (!red) el.animate([{ opacity: 0, transform: base + ' translateY(10px)' }, { opacity: 1, transform: base }], { duration: 600, delay: 900 + i * 500, easing: LL.EASE.out, fill: 'forwards' }); else w(el, 'opacity', '1'); const p = el.querySelector('path'); p && draw(p, 1050 + i * 500, 700); }); qa(sec, '[data-adood] path').forEach((p, i) => draw(p, 1400 + i * 200, 900)); } // words light up as each paragraph crosses the reading line let st = 0; qa(sec, '[data-para]').forEach((p) => { const b = p.getBoundingClientRect(); const t = red ? 1 : LL.clamp((vh * 0.8 - b.top) / (vh * 0.32 + b.height), 0, 1); const words = p._w || (p._w = [...p.querySelectorAll('[data-w]')]); const lit = Math.floor(t * words.length + 0.0001); if (p._lit !== lit) { p._lit = lit; words.forEach((el, i) => { const on = i < lit; if (el.getAttribute('data-lit') !== '0') w(el, 'color', on ? 'var(--ink)' : 'var(--ink-20)'); if (el.getAttribute('data-hl') === '1') w(el, 'backgroundSize', on ? '100% .4em' : '0% .4em'); }); } if (t > 0.3) st++; }); if (mobile) { const b = stageRef.current.getBoundingClientRect(); st = b.top < vh * 0.7 ? 4 : 0; } else if (st >= 3) st = 4; if (red) st = 4; if (st !== S.step) { S.step = st; setStep(st); } // stats count up const stt = statsRef.current; if (stt) { const b = stt.getBoundingClientRect(); if (S.countAt == null && b.top < vh * 0.88) S.countAt = now; if (b.top > vh) S.countAt = null; const t = red ? 1 : (S.countAt == null ? 0 : LL.range(now - S.countAt, 150, 1750)); const k = 1 - Math.pow(1 - t, 4); qa(stt, '[data-statv]').forEach((el, i) => { const s = parseStat((stats[i] || {}).value); w(el, '@text', Math.round(s.n * k) + s.suf); }); } // lens on the portrait const pw = ph.offsetWidth, phh = ph.offsetHeight; if (!S.pos) { S.pos = { x: new LL.Spring(pw * 0.5, 120, 17), y: new LL.Spring(phh * 0.2, 120, 17) }; S.rad = new LL.Spring(0, 160, 16); } const P = S.ptr; const tx = P.in ? P.x : pw * (0.5 + Math.sin(now / 2300) * 0.2), ty = P.in ? P.y : phh * (0.3 + Math.sin(now / 1700 + 1) * 0.16); S.pos.x.t = tx; S.pos.y.t = ty; S.rad.t = S.intro ? Math.min(pw * 0.27, 92) * (P.in ? 1.15 : 1) : 0; if (red) { S.pos.x.x = pw * 0.5; S.pos.y.x = phh * 0.22; S.rad.x = S.rad.t; } else { S.pos.x.step(dt); S.pos.y.step(dt); S.rad.step(dt); } const x = S.pos.x.x, y = S.pos.y.x, rr = Math.max(0, S.rad.x); w(lensRef.current, 'clipPath', `circle(${rr.toFixed(1)}px at ${x.toFixed(1)}px ${y.toFixed(1)}px)`); w(ringRef.current, 'opacity', rr > 3 ? '1' : '0'); w(ringRef.current, 'transform', `translate(${x.toFixed(1)}px,${y.toFixed(1)}px) scale(${(rr / 100).toFixed(4)})`); // film ribbon drifts with scroll const rb = ribbonRef.current; if (rb) { if (!red) S.drift = (S.drift || 0) + dt * 30; const half = rb.scrollWidth / 2 || 1; w(rb, 'transform', `translate3d(${(-(((scrollY * 0.6 + (S.drift || 0)) % half))).toFixed(1)}px,0,0)`); } }); }, []); const local = (e) => { const r = photoRef.current.getBoundingClientRect(); const x = e.clientX - r.left, y = e.clientY - r.top; return { x, y, inside: x >= 0 && y >= 0 && x <= r.width && y <= r.height }; }; const onMove = (e) => { if (e.pointerType === 'touch' && !S.ptr.drag) return; const q = local(e); S.ptr = { x: q.x, y: q.y, in: q.inside || S.ptr.drag, drag: S.ptr.drag }; }; const onDown = (e) => { const q = local(e); if (!q.inside) return; S.ptr = { x: q.x, y: q.y, in: true, drag: e.pointerType === 'touch' }; clearTimeout(S.dragT); if (e.pointerType === 'touch') S.dragT = setTimeout(() => { S.ptr = { in: false }; }, 3500); }; const cardW = Math.round(mob ? Math.min(W * 0.5, 220) : Math.min(W * 0.24, H * 0.46, 380)); const colW = mob ? W - 40 : (Math.min(W, 1320) - 2 * Math.max(20, Math.min(64, W * 0.04)) - Math.max(40, Math.min(110, W * 0.06))) * 1.05 / 2.05; const k = mob ? 1 : LL.clamp(colW / 620, 0.62, 1); const POL = (mob ? [ { src: '/images/IMG_6107.jpg', alt: 'A grid of skincare UGC stills', x: '17%', y: '11%', w: 104, r: -7, k: 1, from: 'translate(-60px,-40px)' }, { src: '/images/posters/sculpted.jpg', alt: 'Close-up of a serum bottle', x: '14%', y: '86%', w: 104, r: -9, k: 2, from: 'translate(-60px,40px)' }, { src: '/images/lamia-trip.jpg', alt: 'Lamia in a white crochet dress in front of bougainvillea and palm trees', x: '88%', y: '80%', w: 100, r: 6, k: 3, from: 'translate(60px,40px)' }, ] : [ { src: '/images/IMG_6107.jpg', alt: 'A grid of skincare UGC stills', x: '90%', y: '44%', w: 164, r: 7, k: 1, from: 'translate(120px,-80px)', pos: '50% 50%' }, { src: '/images/posters/sculpted.jpg', alt: 'Close-up of a serum bottle held to a mirror', x: '14%', y: '84%', w: 156, r: -8, k: 2, from: 'translate(-120px,80px)', pos: '50% 40%' }, { src: '/images/lamia-trip.jpg', alt: 'Lamia in a white crochet dress in front of bougainvillea and palm trees', x: '84%', y: '82%', w: 150, r: 5, k: 3, from: 'translate(120px,80px)', pos: '50% 35%' }, { src: '/images/posters/whoop-meridien.jpg', alt: 'Sunlit shot of a hand holding a coffee cup, golden hour light on skin', x: '14%', y: '16%', w: 136, r: -5, k: 3, from: 'translate(-120px,-80px)', pos: '50% 40%' }, ]); const ribbon = [...LL.CLIPS, ...LL.CLIPS]; const ribH = mob ? 96 : 150; return (
); } Object.assign(window, { About });