// Era Koleji Ulusal Formu — main app const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ "theme": "dark", "accent": "#d4af37", "title1": "Era Koleji", "title2": "Ulusal", "title3": "Formu", "stat1": "6", "stat1Lbl": "Komite", "stat2": "150+", "stat2Lbl": "Katılımcı", "stat3": "3", "stat3Lbl": "Gün", "anim": "high" }/*EDITMODE-END*/; const ACCENT_PRESETS = [ { val: "#d4af37", name: "Altın" }, { val: "#e63946", name: "Bordo" }, { val: "#06b6d4", name: "Camgöbeği" }, { val: "#a78bfa", name: "Lila" }, { val: "#4ade80", name: "Yeşil" }, { val: "#f97316", name: "Turuncu" }, ]; function hexToRgb(hex) { const h = hex.replace("#", ""); const v = parseInt(h.length === 3 ? h.split("").map(c => c + c).join("") : h, 16); return { r: (v >> 16) & 255, g: (v >> 8) & 255, b: v & 255 }; } function lighten(hex, amt) { const { r, g, b } = hexToRgb(hex); return `rgb(${Math.min(255, r + amt)}, ${Math.min(255, g + amt)}, ${Math.min(255, b + amt)})`; } function darken(hex, amt) { const { r, g, b } = hexToRgb(hex); return `rgb(${Math.max(0, r - amt)}, ${Math.max(0, g - amt)}, ${Math.max(0, b - amt)})`; } const Nav = () => { const [open, setOpen] = React.useState(false); return ( ); }; const TweaksUI = ({ tweaks, setTweak }) => { if (typeof TweaksPanel === "undefined") return null; return ( setTweak("theme", v)} /> setTweak("anim", v)} />
Vurgu Rengi
{ACCENT_PRESETS.map(p => (
setTweak("title1", v)} /> setTweak("title2", v)} /> setTweak("title3", v)} /> setTweak("stat1", v)} /> setTweak("stat1Lbl", v)} /> setTweak("stat2", v)} /> setTweak("stat2Lbl", v)} /> setTweak("stat3", v)} /> setTweak("stat3Lbl", v)} />
); }; const App = () => { const [tweaks, setTweak] = useTweaks(TWEAK_DEFAULTS); // Apply theme + animation level React.useEffect(() => { document.documentElement.setAttribute("data-theme", tweaks.theme); document.documentElement.setAttribute("data-anim", tweaks.anim); }, [tweaks.theme, tweaks.anim]); // Apply accent color React.useEffect(() => { const root = document.documentElement; const accent = tweaks.accent; root.style.setProperty("--gold", accent); root.style.setProperty("--gold-soft", lighten(accent, 30)); root.style.setProperty("--gold-deep", darken(accent, 40)); }, [tweaks.accent]); // Reveal on scroll React.useEffect(() => { const els = document.querySelectorAll(".reveal"); if (tweaks.anim === "low") { els.forEach(el => el.classList.add("in")); return; } const io = new IntersectionObserver( (entries) => { entries.forEach(e => { if (e.isIntersecting) { e.target.classList.add("in"); io.unobserve(e.target); } }); }, { threshold: 0.12, rootMargin: "0px 0px -50px 0px" } ); els.forEach(el => io.observe(el)); return () => io.disconnect(); }, [tweaks.anim]); return ( <>