Nonprofit — Education / Youth Landing
A bright, optimistic landing page for an education and youth nonprofit, built with vanilla HTML, CSS and JavaScript. It pairs a hopeful hero and animated impact counters with three program cards, a transparency ledger, a sponsor-a-student giving widget, a campaign progress thermometer, donor recognition, success-story testimonials, and volunteer and donate calls to action. Scroll reveals, a working donation amount picker, an email signup and a mobile nav make the page feel alive without any framework or build step.
MCP
Code
:root {
/* Education / youth palette — sunny yellow + sky blue + white */
--brand: #2f86d8; /* sky blue */
--brand-d: #1f66ac;
--accent: #ffc233; /* sunny yellow */
--accent-d: #f0a90f;
--accent-ink: #5a3d00; /* readable text on yellow */
--ink: #1d2733;
--ink-2: #475467;
--muted: #7c8898;
--bg: #f4f9ff; /* airy sky-tinted white */
--surface: #ffffff;
--surface-2: #eef5ff;
--line: rgba(29,39,51,0.10);
--line-2: rgba(29,39,51,0.18);
--ok: #2f9e6f;
--warn: #e0a020;
--danger: #e0533e;
--r-sm: 8px;
--r-md: 14px;
--r-lg: 22px;
--sh-sm: 0 2px 8px rgba(29,60,110,0.07);
--sh-md: 0 12px 32px rgba(29,60,110,0.12);
--sh-lg: 0 24px 60px rgba(29,60,110,0.18);
--maxw: 1140px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
margin: 0;
font-family: "Inter", system-ui, -apple-system, sans-serif;
color: var(--ink);
background: var(--bg);
line-height: 1.6;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, .brand-name { font-family: "Baloo 2", system-ui, sans-serif; line-height: 1.12; letter-spacing: -0.01em; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.sr-only, .skip {
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip:focus {
position: fixed; top: 12px; left: 12px; width: auto; height: auto; clip: auto;
background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); z-index: 200;
}
/* Buttons */
.btn {
--pad: 11px 18px;
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
padding: var(--pad); border-radius: 999px; font: inherit; font-weight: 700;
text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-lg { --pad: 14px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px rgba(255,194,51,.4); }
.btn-accent:hover { background: var(--accent-d); box-shadow: 0 10px 22px rgba(240,169,15,.45); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-line { background: var(--surface); color: var(--brand-d); border-color: var(--line-2); box-shadow: var(--sh-sm); }
.btn-line:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
/* Nav */
.nav {
position: sticky; top: 0; z-index: 100;
background: rgba(255,255,255,.82); backdrop-filter: blur(12px);
border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; }
.brand-mark {
display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
background: linear-gradient(135deg, var(--brand), #5aa9ee); color: #fff; font-size: 1.1rem;
box-shadow: 0 4px 12px rgba(47,134,216,.4);
}
.brand-name { font-size: 1.28rem; color: var(--ink); }
.brand-name strong { color: var(--brand); font-weight: 800; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links > a:not(.btn) {
padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none;
color: var(--ink-2); font-weight: 600; font-size: .95rem; transition: color .15s, background .15s;
}
.nav-links > a:not(.btn):hover { color: var(--brand); background: var(--surface-2); }
.nav-links .btn { margin-left: 4px; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px;
background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* Hero */
.hero {
background:
radial-gradient(1100px 500px at 88% -10%, rgba(255,194,51,.22), transparent 60%),
radial-gradient(900px 460px at -5% 10%, rgba(47,134,216,.16), transparent 55%),
var(--bg);
padding: 64px 0 72px;
}
.hero-in { display: grid; grid-template-columns: 1.06fr .94fr; gap: 56px; align-items: center; }
.eyebrow {
display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .82rem;
color: var(--brand-d); background: #fff; border: 1px solid var(--line); border-radius: 999px;
padding: 7px 14px; box-shadow: var(--sh-sm);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(255,194,51,.3); }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.7rem); margin: 18px 0 0; font-weight: 800; }
.hero h1 .hl { color: var(--brand); position: relative; }
.hero h1 .hl::after {
content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .28em;
background: var(--accent); opacity: .55; border-radius: 4px; z-index: -1;
}
.lede { font-size: 1.14rem; color: var(--ink-2); margin: 18px 0 26px; max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { list-style: none; display: flex; gap: 30px; margin: 32px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hero-stats b { display: block; font-family: "Baloo 2", sans-serif; font-size: 1.9rem; color: var(--ink); font-weight: 800; }
.hero-stats small { color: var(--muted); font-weight: 600; font-size: .86rem; }
.hero-art { position: relative; min-height: 420px; }
.photo {
position: absolute; margin: 0; border-radius: var(--r-lg); overflow: hidden;
box-shadow: var(--sh-lg); border: 5px solid #fff;
}
.photo figcaption {
position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px 12px;
font-size: .82rem; font-weight: 600; color: #fff;
background: linear-gradient(transparent, rgba(13,30,52,.78));
}
.ph-1 { width: 64%; height: 70%; top: 0; right: 0; background: linear-gradient(150deg, #5aa9ee, #2f86d8 70%); }
.ph-2 { width: 56%; height: 56%; bottom: 0; left: 0; background: linear-gradient(150deg, #ffd166, #f0a90f 75%); }
.badge-float {
position: absolute; top: 56%; right: -6px; transform: translateY(-50%);
background: #fff; border-radius: var(--r-md); padding: 12px 16px; box-shadow: var(--sh-md);
text-align: center; border: 1px solid var(--line);
}
.bf-num { display: block; font-family: "Baloo 2", sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--brand); }
.bf-txt { font-size: .72rem; color: var(--ink-2); font-weight: 600; }
/* Trust bar */
.trustbar { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-in { display: flex; align-items: center; gap: 20px 26px; padding: 18px 0; flex-wrap: wrap; }
.trust-badge { font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.trust-sep { flex: 1 1 30px; height: 1px; background: var(--line); }
.trust-logo { font-family: "Baloo 2", sans-serif; font-weight: 700; color: var(--muted); font-size: 1.02rem; letter-spacing: -.01em; }
/* Sections */
.section { padding: 78px 0; }
.sec-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.kicker {
display: inline-block; font-weight: 800; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
color: var(--brand); background: var(--surface-2); padding: 5px 12px; border-radius: 999px;
}
.kicker.light { color: #fff; background: rgba(255,255,255,.18); }
.sec-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.35rem); margin: 14px 0 10px; font-weight: 800; }
.sec-head p { color: var(--ink-2); font-size: 1.06rem; margin: 0; }
.grid { display: grid; gap: 22px; }
.prog-grid { grid-template-columns: repeat(3, 1fr); }
/* Cards */
.card {
background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
padding: 28px; box-shadow: var(--sh-sm); transition: transform .2s ease, box-shadow .25s ease, border-color .2s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--sh-md); border-color: rgba(47,134,216,.3); }
.prog-ic {
width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
font-size: 1.7rem; margin-bottom: 16px;
}
.ic-a { background: rgba(255,194,51,.22); }
.ic-b { background: rgba(47,134,216,.16); }
.ic-c { background: rgba(47,158,111,.16); }
.prog h3 { font-size: 1.3rem; margin: 0 0 8px; }
.prog p { color: var(--ink-2); margin: 0 0 14px; }
.ticks { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 7px; }
.ticks li { position: relative; padding-left: 26px; font-size: .92rem; color: var(--ink-2); font-weight: 500; }
.ticks li::before {
content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%;
background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 800; display: grid; place-items: center;
}
.link-arrow { font-weight: 700; color: var(--brand-d); text-decoration: none; font-size: .96rem; }
.link-arrow:hover { color: var(--brand); }
/* Impact */
.impact {
background: linear-gradient(135deg, var(--brand-d), var(--brand) 55%, #4a9be8);
color: #fff;
}
.impact-in { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.impact-copy h2 { font-size: clamp(1.7rem, 3.6vw, 2.35rem); margin: 14px 0 10px; }
.impact-copy > p { color: rgba(255,255,255,.85); margin: 0 0 24px; }
.ledger { display: grid; gap: 12px; }
.led-row { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 12px; font-weight: 600; font-size: .92rem; }
.led-row .bar { height: 10px; background: rgba(255,255,255,.2); border-radius: 999px; overflow: hidden; }
.led-row .bar i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 999px; }
.led-row b { text-align: right; }
.fineprint { color: rgba(255,255,255,.7); font-size: .82rem; margin: 14px 0 0; }
.impact-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.istat {
background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
border-radius: var(--r-md); padding: 22px; backdrop-filter: blur(4px);
}
.istat b { display: block; font-family: "Baloo 2", sans-serif; font-size: 2rem; font-weight: 800; }
.istat span { font-size: .9rem; color: rgba(255,255,255,.85); font-weight: 500; }
/* Sponsor */
.sponsor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.give-card, .thermo-card {
background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
padding: 28px; box-shadow: var(--sh-md);
}
.toggle { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 20px; }
.tg { border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--ink-2); padding: 8px 18px; border-radius: 999px; cursor: pointer; transition: all .18s; }
.tg.active { background: var(--surface); color: var(--brand-d); box-shadow: var(--sh-sm); }
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.amt {
border: 1.5px solid var(--line-2); background: var(--surface); border-radius: var(--r-md);
padding: 14px 8px; font: inherit; font-weight: 800; font-size: 1.05rem; color: var(--ink);
cursor: pointer; transition: all .16s;
}
.amt:hover { border-color: var(--brand); }
.amt.active { border-color: var(--accent-d); background: rgba(255,194,51,.16); color: var(--accent-ink); box-shadow: 0 0 0 3px rgba(255,194,51,.25); }
.amt-custom { display: flex; align-items: center; gap: 4px; grid-column: span 3; padding: 12px 14px; }
.amt-custom span { color: var(--muted); font-weight: 800; }
.amt-custom input { border: 0; background: transparent; font: inherit; font-weight: 700; width: 100%; outline: none; }
.give-impact { background: var(--surface-2); border-left: 3px solid var(--brand); padding: 12px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: .92rem; color: var(--ink-2); margin: 0 0 18px; }
.give-secure { text-align: center; font-size: .8rem; color: var(--muted); margin: 12px 0 0; }
.thermo-card h3 { margin: 0 0 18px; font-size: 1.25rem; }
.thermo { position: relative; height: 30px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.thermo-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-d)); border-radius: 999px; transition: width 1.4s cubic-bezier(.22,1,.36,1); }
.thermo-label { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 800; font-size: .9rem; color: var(--accent-ink); }
.thermo-meta { display: flex; justify-content: space-between; margin: 12px 0 18px; font-size: .95rem; }
.thermo-meta b { font-family: "Baloo 2", sans-serif; font-size: 1.2rem; color: var(--ink); }
.thermo-meta .goal { color: var(--muted); font-weight: 600; }
.donors { list-style: none; margin: 0 0 12px; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 11px; }
.donors li { display: flex; align-items: center; gap: 10px; font-size: .92rem; font-weight: 600; color: var(--ink-2); }
.donors .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), #5aa9ee); flex: none; }
.donors li:nth-child(2) .av { background: linear-gradient(135deg, var(--accent-d), #ffd166); color: var(--accent-ink); }
.donors li:nth-child(3) .av { background: linear-gradient(135deg, #2f9e6f, #57c79a); }
.donors em { margin-left: auto; font-style: normal; font-weight: 800; color: var(--ink); }
.donors-foot { font-size: .86rem; color: var(--muted); margin: 0; }
.donors-foot b { color: var(--brand-d); }
/* Stories */
.stories { background: var(--surface); }
.story-grid { grid-template-columns: repeat(3, 1fr); }
.story { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-sm); transition: transform .2s, box-shadow .25s; }
.story:hover { transform: translateY(-5px); box-shadow: var(--sh-md); }
.story-ph { height: 160px; }
.ph-3 { background: linear-gradient(150deg, #5aa9ee, #2f86d8); }
.ph-4 { background: linear-gradient(150deg, #ffd166, #f0a90f); }
.ph-5 { background: linear-gradient(150deg, #57c79a, #2f9e6f); }
.story blockquote { margin: 0; padding: 20px 22px 4px; font-size: 1.02rem; line-height: 1.5; font-weight: 500; color: var(--ink); }
.story figcaption { padding: 6px 22px 22px; font-size: .88rem; color: var(--muted); }
.story figcaption b { color: var(--ink); }
/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--accent), #ffd166); }
.cta-in { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.cta-text h2 { color: var(--accent-ink); margin: 0 0 6px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.cta-text p { color: #6e4d10; margin: 0; font-weight: 500; max-width: 36em; }
.cta-form { display: flex; gap: 10px; flex: 1 1 320px; max-width: 440px; }
.cta-form input {
flex: 1; border: 1.5px solid rgba(90,61,0,.25); background: #fff; border-radius: 999px;
padding: 14px 18px; font: inherit; outline: none; min-width: 0;
}
.cta-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,134,216,.25); }
.cta-form .btn-accent { background: var(--ink); color: #fff; box-shadow: var(--sh-md); }
.cta-form .btn-accent:hover { background: #0f1923; }
/* Footer */
.foot { background: var(--ink); color: #cdd6e2; padding: 56px 0 26px; }
.foot-in { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
.foot .brand-name { color: #fff; }
.foot .brand-name strong { color: #6cb3f0; }
.foot-brand p { color: #9aa6b6; margin: 14px 0 14px; max-width: 30em; font-size: .95rem; }
.foot-badge { display: inline-block; font-size: .78rem; color: #9aa6b6; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-sm); padding: 8px 12px; }
.foot-col h4 { color: #fff; font-size: .92rem; margin: 0 0 14px; letter-spacing: .02em; }
.foot-col a { display: block; color: #9aa6b6; text-decoration: none; padding: 5px 0; font-size: .92rem; transition: color .15s; }
.foot-col a:hover { color: #fff; }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); flex-wrap: wrap; }
.foot-bottom small { color: #7e8a9a; }
.foot-social { display: flex; gap: 8px; }
.foot-social span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); font-size: .82rem; cursor: pointer; transition: background .15s; }
.foot-social span:hover { background: var(--brand); color: #fff; }
/* Toast */
.toast {
position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 140%);
background: var(--ink); color: #fff; padding: 14px 22px; border-radius: var(--r-md);
box-shadow: var(--sh-lg); font-weight: 600; z-index: 300; opacity: 0;
transition: transform .4s cubic-bezier(.22,1,.36,1), opacity .3s; max-width: 90vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
* { scroll-behavior: auto !important; }
.reveal { opacity: 1; transform: none; transition: none; }
.thermo-fill { transition: none; }
}
/* Responsive */
@media (max-width: 920px) {
.hero-in { grid-template-columns: 1fr; gap: 40px; }
.hero-art { min-height: 340px; max-width: 460px; }
.impact-in { grid-template-columns: 1fr; gap: 34px; }
.sponsor-grid { grid-template-columns: 1fr; }
.prog-grid, .story-grid { grid-template-columns: 1fr; }
.foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
.nav-toggle { display: flex; }
.nav-links {
position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch;
background: rgba(255,255,255,.97); backdrop-filter: blur(12px); padding: 14px 20px 22px; gap: 4px;
border-bottom: 1px solid var(--line); box-shadow: var(--sh-md);
transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
.nav-links > a:not(.btn) { padding: 12px; }
.nav-links .btn { margin: 6px 0 0; }
}
@media (max-width: 520px) {
.wrap { padding: 0 18px; }
.section { padding: 56px 0; }
.hero { padding: 44px 0 52px; }
.hero-stats { gap: 20px; }
.hero-stats b { font-size: 1.55rem; }
.impact-stats { grid-template-columns: 1fr; }
.amounts { grid-template-columns: repeat(2, 1fr); }
.amt-custom { grid-column: span 2; }
.led-row { grid-template-columns: 100px 1fr 36px; }
.cta-form { flex-direction: column; }
.cta-form .btn { width: 100%; }
.foot-in { grid-template-columns: 1fr; gap: 26px; }
.hero-art { margin: 0 auto; }
}(function () {
"use strict";
/* ---------- Toast helper ---------- */
var toastEl = document.getElementById("toast");
var toastTimer;
function toast(msg) {
if (!toastEl) return;
toastEl.textContent = msg;
toastEl.classList.add("show");
clearTimeout(toastTimer);
toastTimer = setTimeout(function () {
toastEl.classList.remove("show");
}, 3200);
}
/* ---------- Mobile nav ---------- */
var toggle = document.getElementById("navToggle");
var links = document.getElementById("navLinks");
if (toggle && links) {
toggle.addEventListener("click", function () {
var open = links.classList.toggle("open");
toggle.setAttribute("aria-expanded", String(open));
toggle.setAttribute("aria-label", open ? "Close menu" : "Open menu");
});
links.addEventListener("click", function (e) {
if (e.target.closest("a") && links.classList.contains("open")) {
links.classList.remove("open");
toggle.setAttribute("aria-expanded", "false");
}
});
}
/* ---------- Scroll reveal ---------- */
var reveals = document.querySelectorAll(".reveal");
if ("IntersectionObserver" in window) {
var io = new IntersectionObserver(function (entries) {
entries.forEach(function (en) {
if (en.isIntersecting) {
en.target.classList.add("in");
io.unobserve(en.target);
}
});
}, { threshold: 0.14, rootMargin: "0px 0px -40px 0px" });
reveals.forEach(function (el) { io.observe(el); });
} else {
reveals.forEach(function (el) { el.classList.add("in"); });
}
/* ---------- Animated counters ---------- */
function formatNum(n, prefix, suffix) {
var s = Math.round(n).toLocaleString("en-US");
return (prefix || "") + s + (suffix || "");
}
function animateCount(el) {
var to = parseFloat(el.getAttribute("data-to")) || 0;
var prefix = el.getAttribute("data-prefix") || "";
var suffix = el.getAttribute("data-suffix") || "";
var dur = 1500, start = null;
function step(ts) {
if (start === null) start = ts;
var p = Math.min((ts - start) / dur, 1);
var eased = 1 - Math.pow(1 - p, 3);
el.textContent = formatNum(to * eased, prefix, suffix);
if (p < 1) requestAnimationFrame(step);
else el.textContent = formatNum(to, prefix, suffix);
}
requestAnimationFrame(step);
}
var counters = document.querySelectorAll(".count");
if ("IntersectionObserver" in window) {
var cio = new IntersectionObserver(function (entries) {
entries.forEach(function (en) {
if (en.isIntersecting) {
animateCount(en.target);
cio.unobserve(en.target);
}
});
}, { threshold: 0.6 });
counters.forEach(function (el) { cio.observe(el); });
} else {
counters.forEach(animateCount);
}
/* ---------- Thermometer fill on reveal ---------- */
var thermoFill = document.getElementById("thermoFill");
if (thermoFill) {
var tio = new IntersectionObserver(function (entries) {
entries.forEach(function (en) {
if (en.isIntersecting) {
thermoFill.style.width = "73%";
tio.disconnect();
}
});
}, { threshold: 0.5 });
tio.observe(thermoFill);
}
/* ---------- Donation widget ---------- */
var freq = "mo"; // "mo" | "once"
var amount = 35;
var customAmt = document.getElementById("customAmt");
var amtButtons = document.querySelectorAll(".amt[data-amt]");
var tgButtons = document.querySelectorAll(".tg");
var donateAmt = document.getElementById("donateAmt");
var giveImpact = document.getElementById("giveImpact");
var donateBtn = document.getElementById("donateBtn");
function suffixLabel() { return freq === "mo" ? "/mo" : ""; }
function impactText(a) {
if (a >= 150) return "$" + a + suffixLabel() + " funds a full scholarship term for one student.";
if (a >= 75) return "$" + a + suffixLabel() + " covers a month of mentoring and learning-hub access.";
if (a >= 35) return "$" + a + suffixLabel() + " gives one student tutoring + a hot meal every week.";
if (a >= 15) return "$" + a + suffixLabel() + " supplies books and supplies for a young learner.";
return "$" + a + suffixLabel() + " helps keep our learning hubs open.";
}
function refresh() {
var label = "$" + amount.toLocaleString("en-US") + suffixLabel();
if (donateAmt) donateAmt.textContent = label;
if (giveImpact) giveImpact.textContent = impactText(amount);
}
amtButtons.forEach(function (btn) {
btn.addEventListener("click", function () {
amtButtons.forEach(function (b) { b.classList.remove("active"); });
btn.classList.add("active");
amount = parseInt(btn.getAttribute("data-amt"), 10);
if (customAmt) customAmt.value = "";
refresh();
});
});
if (customAmt) {
customAmt.addEventListener("input", function () {
var v = parseInt(customAmt.value, 10);
if (v && v > 0) {
amtButtons.forEach(function (b) { b.classList.remove("active"); });
amount = v;
refresh();
}
});
customAmt.closest(".amt-custom").addEventListener("click", function () {
customAmt.focus();
});
}
tgButtons.forEach(function (btn) {
btn.addEventListener("click", function () {
tgButtons.forEach(function (b) {
b.classList.remove("active");
b.setAttribute("aria-selected", "false");
});
btn.classList.add("active");
btn.setAttribute("aria-selected", "true");
freq = btn.getAttribute("data-freq");
refresh();
});
});
if (donateBtn) {
donateBtn.addEventListener("click", function () {
toast("Thank you! A $" + amount.toLocaleString("en-US") + suffixLabel() +
" gift would keep a student learning. (Demo only)");
});
}
refresh();
/* ---------- Volunteer form ---------- */
var volForm = document.getElementById("volForm");
if (volForm) {
volForm.addEventListener("submit", function (e) {
e.preventDefault();
var input = document.getElementById("volEmail");
var val = input.value.trim();
if (!val || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val)) {
input.focus();
toast("Please enter a valid email so we can reach you.");
return;
}
input.value = "";
toast("You're on the list! A mentoring coordinator will be in touch. (Demo)");
});
}
})();<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>BrightFutures — Education for Every Child</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<a class="skip" href="#main">Skip to content</a>
<header class="nav" id="top">
<div class="wrap nav-in">
<a class="brand" href="#top" aria-label="BrightFutures home">
<span class="brand-mark" aria-hidden="true">✸</span>
<span class="brand-name">Bright<strong>Futures</strong></span>
</a>
<nav class="nav-links" id="navLinks" aria-label="Primary">
<a href="#programs">Programs</a>
<a href="#impact">Impact</a>
<a href="#sponsor">Sponsor</a>
<a href="#stories">Stories</a>
<a class="btn btn-ghost" href="#volunteer">Volunteer</a>
<a class="btn btn-accent" href="#sponsor">Donate</a>
</nav>
<button class="nav-toggle" id="navToggle" aria-expanded="false" aria-controls="navLinks" aria-label="Open menu">
<span></span><span></span><span></span>
</button>
</div>
</header>
<main id="main">
<!-- HERO -->
<section class="hero">
<div class="wrap hero-in">
<div class="hero-copy reveal">
<span class="eyebrow"><span class="dot" aria-hidden="true"></span> Registered charity · Tax-deductible</span>
<h1>Every child deserves a <span class="hl">bright future</span>.</h1>
<p class="lede">BrightFutures funds scholarships, mentoring and safe learning spaces so young people can finish school and reach their potential — no matter where they start.</p>
<div class="hero-cta">
<a class="btn btn-accent btn-lg" href="#sponsor">Sponsor a student</a>
<a class="btn btn-line btn-lg" href="#volunteer">Become a mentor</a>
</div>
<ul class="hero-stats" aria-label="Key results">
<li><b class="count" data-to="14820">0</b><small>kids reached</small></li>
<li><b class="count" data-to="92" data-suffix="%">0</b><small>graduation rate</small></li>
<li><b class="count" data-to="37">0</b><small>partner schools</small></li>
</ul>
</div>
<div class="hero-art reveal" aria-hidden="true">
<figure class="photo ph-1"><figcaption>After-school coding club, Maple Ridge</figcaption></figure>
<figure class="photo ph-2"><figcaption>Aisha, Class of 2025 scholar</figcaption></figure>
<div class="badge-float">
<span class="bf-num">100%</span>
<span class="bf-txt">of gifts fund students</span>
</div>
</div>
</div>
</section>
<!-- TRUST BAR -->
<section class="trustbar" aria-label="Trust and partners">
<div class="wrap trust-in">
<span class="trust-badge">★ 4.9 charity rating</span>
<span class="trust-badge">✓ Tax-deductible</span>
<span class="trust-badge">🔒 Secure giving</span>
<span class="trust-sep" aria-hidden="true"></span>
<span class="trust-logo">Sunrise Foundation</span>
<span class="trust-logo">Cobalt Bank</span>
<span class="trust-logo">Northwind Co.</span>
</div>
</section>
<!-- PROGRAMS -->
<section class="section" id="programs">
<div class="wrap">
<header class="sec-head reveal">
<span class="kicker">What we do</span>
<h2>Programs that change the math on opportunity</h2>
<p>Three connected pathways move a young person from at-risk to college-ready.</p>
</header>
<div class="grid prog-grid">
<article class="card prog reveal">
<div class="prog-ic ic-a" aria-hidden="true">🎓</div>
<h3>Scholarships</h3>
<p>Full-ride tuition, books and a laptop for students who'd otherwise leave school for work.</p>
<ul class="ticks">
<li>Covers grades 9–12</li>
<li>Renewable each year</li>
<li>1,240 active scholars</li>
</ul>
<a class="link-arrow" href="#sponsor">Fund a scholarship →</a>
</article>
<article class="card prog reveal">
<div class="prog-ic ic-b" aria-hidden="true">🤝</div>
<h3>Mentoring</h3>
<p>Weekly 1:1 sessions pairing students with vetted volunteer mentors who stay all year.</p>
<ul class="ticks">
<li>620 trained mentors</li>
<li>Weekly check-ins</li>
<li>Career & college coaching</li>
</ul>
<a class="link-arrow" href="#volunteer">Become a mentor →</a>
</article>
<article class="card prog reveal">
<div class="prog-ic ic-c" aria-hidden="true">📚</div>
<h3>Learning hubs</h3>
<p>Safe after-school spaces with wifi, tutors and meals in neighborhoods that need them most.</p>
<ul class="ticks">
<li>18 open hubs</li>
<li>Free daily tutoring</li>
<li>STEM & arts labs</li>
</ul>
<a class="link-arrow" href="#sponsor">Support a hub →</a>
</article>
</div>
</div>
</section>
<!-- IMPACT -->
<section class="section impact" id="impact">
<div class="wrap impact-in">
<div class="impact-copy reveal">
<span class="kicker light">Transparency</span>
<h2>The numbers behind the smiles</h2>
<p>We publish our results every quarter. Here's what your support made possible last year.</p>
<div class="ledger">
<div class="led-row"><span>Programs & students</span><span class="bar"><i style="--w:84%"></i></span><b>84¢</b></div>
<div class="led-row"><span>Operations</span><span class="bar"><i style="--w:11%"></i></span><b>11¢</b></div>
<div class="led-row"><span>Fundraising</span><span class="bar"><i style="--w:5%"></i></span><b>5¢</b></div>
</div>
<p class="fineprint">Per dollar donated · audited FY2025</p>
</div>
<div class="impact-stats reveal">
<div class="istat"><b class="count" data-to="14820">0</b><span>students reached</span></div>
<div class="istat"><b class="count" data-to="92" data-suffix="%">0</b><span>graduate on time</span></div>
<div class="istat"><b class="count" data-to="2300000" data-prefix="$">0</b><span>scholarships awarded</span></div>
<div class="istat"><b class="count" data-to="86" data-suffix="%">0</b><span>go on to college</span></div>
</div>
</div>
</section>
<!-- SPONSOR -->
<section class="section" id="sponsor">
<div class="wrap sponsor-in">
<header class="sec-head reveal">
<span class="kicker">Sponsor a student</span>
<h2>Pick a gift that keeps a child in class</h2>
<p>Choose a one-time gift or sponsor monthly. Our spring campaign is almost there.</p>
</header>
<div class="sponsor-grid">
<div class="give-card reveal">
<div class="toggle" role="tablist" aria-label="Donation frequency">
<button class="tg active" id="tgMonthly" role="tab" aria-selected="true" data-freq="mo">Monthly</button>
<button class="tg" id="tgOnce" role="tab" aria-selected="false" data-freq="once">One-time</button>
</div>
<div class="amounts" id="amounts" role="group" aria-label="Choose amount">
<button class="amt" data-amt="15">$15</button>
<button class="amt active" data-amt="35">$35</button>
<button class="amt" data-amt="75">$75</button>
<button class="amt" data-amt="150">$150</button>
<label class="amt amt-custom">
<span aria-hidden="true">$</span>
<input id="customAmt" type="number" min="1" inputmode="numeric" placeholder="Other" aria-label="Custom amount" />
</label>
</div>
<p class="give-impact" id="giveImpact">$35/mo gives one student tutoring + a hot meal every week.</p>
<button class="btn btn-accent btn-lg btn-block" id="donateBtn">Donate <span id="donateAmt">$35/mo</span></button>
<p class="give-secure">🔒 Secure · cancel anytime · 100% tax-deductible</p>
</div>
<div class="thermo-card reveal">
<h3>Spring Scholarship Drive</h3>
<div class="thermo" role="img" aria-label="Campaign progress: 73 percent funded">
<div class="thermo-fill" id="thermoFill"></div>
<span class="thermo-label" id="thermoPct">73%</span>
</div>
<div class="thermo-meta">
<span><b id="raised">$182,400</b> raised</span>
<span class="goal">Goal $250,000</span>
</div>
<ul class="donors" aria-label="Recent donors">
<li><span class="av">MR</span> Maria R. <em>$250</em></li>
<li><span class="av">JT</span> James T. <em>$35/mo</em></li>
<li><span class="av">PC</span> Priya & Co. <em>$5,000</em></li>
<li><span class="av">AN</span> Anonymous <em>$120</em></li>
</ul>
<p class="donors-foot"><b id="donorCount">1,284</b> donors this campaign · join them</p>
</div>
</div>
</div>
</section>
<!-- STORIES -->
<section class="section stories" id="stories">
<div class="wrap">
<header class="sec-head reveal">
<span class="kicker">Success stories</span>
<h2>From our learning hubs to their dreams</h2>
</header>
<div class="grid story-grid">
<figure class="story reveal">
<div class="story-ph ph-3"></div>
<blockquote>"My mentor helped me believe I could study engineering. I just got into State on a full ride."</blockquote>
<figcaption><b>Leah, 18</b> — Scholar, Class of 2025</figcaption>
</figure>
<figure class="story reveal">
<div class="story-ph ph-4"></div>
<blockquote>"The hub kept me on track when home was hard. The tutors never gave up on me."</blockquote>
<figcaption><b>Daniel, 16</b> — Maple Ridge Hub</figcaption>
</figure>
<figure class="story reveal">
<div class="story-ph ph-5"></div>
<blockquote>"Mentoring two students changed my year more than theirs. Watching them grow is everything."</blockquote>
<figcaption><b>Sofia M.</b> — Volunteer mentor, 3 years</figcaption>
</figure>
</div>
</div>
</section>
<!-- VOLUNTEER CTA -->
<section class="section cta-band" id="volunteer">
<div class="wrap cta-in reveal">
<div class="cta-text">
<h2>Give an hour. Change a trajectory.</h2>
<p>Mentors meet one student weekly. We provide the training, the match and the support.</p>
</div>
<form class="cta-form" id="volForm" novalidate>
<label class="sr-only" for="volEmail">Email address</label>
<input id="volEmail" type="email" placeholder="you@email.com" required />
<button class="btn btn-accent" type="submit">Sign me up</button>
</form>
</div>
</section>
</main>
<footer class="foot">
<div class="wrap foot-in">
<div class="foot-brand">
<a class="brand" href="#top">
<span class="brand-mark" aria-hidden="true">✸</span>
<span class="brand-name">Bright<strong>Futures</strong></span>
</a>
<p>Funding education and mentoring so every young person can finish school and thrive.</p>
<span class="foot-badge">Registered charity · EIN 00-0000000 · Gifts are tax-deductible</span>
</div>
<nav class="foot-col" aria-label="Programs">
<h4>Programs</h4>
<a href="#programs">Scholarships</a>
<a href="#programs">Mentoring</a>
<a href="#programs">Learning hubs</a>
</nav>
<nav class="foot-col" aria-label="Get involved">
<h4>Get involved</h4>
<a href="#sponsor">Donate</a>
<a href="#volunteer">Volunteer</a>
<a href="#sponsor">Sponsor a student</a>
</nav>
<nav class="foot-col" aria-label="Organization">
<h4>Organization</h4>
<a href="#impact">Annual report</a>
<a href="#impact">Financials</a>
<a href="#top">Contact</a>
</nav>
</div>
<div class="wrap foot-bottom">
<small>© 2026 BrightFutures Education Fund — a fictional nonprofit for demonstration.</small>
<div class="foot-social" aria-hidden="true"><span>in</span><span>✦</span><span>▶</span></div>
</div>
</footer>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<script src="script.js"></script>
</body>
</html>Education / Youth Landing
A full single-page site for the fictional BrightFutures Education Fund, themed in a sunny yellow and sky-blue palette with a friendly rounded display face. It opens on a hopeful hero — warm photo-placeholder blocks captioned with students, a floating “100% of gifts fund students” trust badge, and headline impact counters (kids reached, graduation rate, partner schools) that count up the first time they scroll into view. Below the hero, a trust bar surfaces charity rating, tax-deductible and secure-giving badges alongside partner logos.
The page then walks through five sections: three program cards (scholarships, mentoring, learning hubs) with check-listed details and hover lift; an impact band with a transparency ledger showing how each donated dollar is split plus four animated stat tiles; a sponsor-a-student block whose donation widget lets you switch between monthly and one-time giving, pick or type a custom amount, and watch the button label and impact sentence update live next to a campaign thermometer, recent-donor list and donor count; and success stories as photo-topped testimonial cards. A yellow volunteer CTA band validates an email signup, everything fades and slides in on scroll, and a sticky header collapses into an animated hamburger menu on small screens. All actions surface feedback through a small toast helper — no frameworks, no build, just three files.
Illustrative UI only — fictional organization, not a real charity or donation system.