/* Sections part 2: Experience, Skills, Education, Contact, Footer */
const { useState: uS2, useEffect: uE2, useRef: uR2 } = React;
/* ---------------- EXPERIENCE ---------------- */
function ExpItem({ item }) {
const [ref, shown] = useReveal({ threshold: 0.2 });
return (
{item.company}
{item.current && Now}
{item.role}
{item.sub}
{item.period}
{item.location}
{item.points.map((p, i) => - {p}
)}
{item.tech.map((t, i) => {t})}
);
}
function Experience() {
const S = window.SITE;
const trackRef = uR2(null);
const progRef = uR2(null);
uE2(() => {
const track = trackRef.current;
const prog = progRef.current;
if (!track || !prog) return;
let raf = 0;
const update = () => {
raf = 0;
const rect = track.getBoundingClientRect();
const vh = window.innerHeight;
const start = vh * 0.5;
const total = rect.height + vh * 0.0;
const scrolled = start - rect.top;
const ratio = Math.max(0, Math.min(1, scrolled / Math.max(total - vh * 0.5, 1)));
prog.style.height = `${ratio * (rect.height - 16)}px`;
};
const onScroll = () => { if (!raf) raf = requestAnimationFrame(update); };
update();
window.addEventListener("scroll", onScroll, { passive: true });
window.addEventListener("resize", onScroll);
return () => { window.removeEventListener("scroll", onScroll); window.removeEventListener("resize", onScroll); };
}, []);
return (
{S.experience.map((item, i) =>
)}
);
}
/* ---------------- SKILLS ---------------- */
function SkillCard({ group, items, delay }) {
const IconComp = skillIconFor(group);
return (
{group}
{items.map((s, i) => {s})}
);
}
function Skills() {
const S = window.SITE;
return (
{S.skills.map((s, i) => )}
);
}
/* ---------------- EDUCATION ---------------- */
function Education() {
const S = window.SITE;
return (
{S.education.map((e, i) => {
const IconComp = e.type === "cert" ? Icon.award : Icon.cap;
return (
{e.title}
{e.org}
{e.period}
);
})}
);
}
/* ---------------- CONTACT ---------------- */
function Contact() {
const S = window.SITE;
return (
);
}
/* ---------------- FOOTER ---------------- */
function Footer() {
const S = window.SITE;
return (
);
}
Object.assign(window, { Experience, Skills, Education, Contact, Footer });