Nonprofit — Humanitarian Landing
A full humanitarian relief NGO landing page built in vanilla HTML, CSS and JavaScript. It opens with an urgent crisis hero, a live fundraising thermometer and a prominent donate call to action, then moves through where-we-work region cards, animated impact statistics, an emergency appeal with selectable gift amounts and live impact copy, ways-to-help options, a transparency breakdown with trust badges and donor recognition, and a matched-giving donate form. Includes a mobile nav, scroll reveal and animated counters.
MCP
Code
:root {
/* Palette override — humanitarian / relief NGO */
--brand: #1d4e89; /* deep relief blue */
--brand-d: #143a68;
--accent: #d4503e; /* urgent red */
--accent-d: #b23a2a;
--ink: #2a2722;
--ink-2: #524d44;
--muted: #7a7368;
--bg: #f6efe4; /* warm sand */
--surface: #ffffff;
--line: rgba(42, 39, 34, 0.1);
--line-2: rgba(42, 39, 34, 0.18);
--ok: #2f9e6f;
--warn: #d98a2b;
--danger: #d4503e;
--r-sm: 8px;
--r-md: 14px;
--r-lg: 22px;
--shadow-sm: 0 1px 2px rgba(20, 58, 104, 0.06), 0 2px 8px rgba(20, 58, 104, 0.05);
--shadow-md: 0 6px 22px rgba(20, 58, 104, 0.1);
--shadow-lg: 0 18px 50px rgba(20, 58, 104, 0.16);
--serif: "Fraunces", Georgia, "Times New Roman", serif;
--sans: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
margin: 0;
font-family: var(--sans);
color: var(--ink);
background: var(--bg);
line-height: 1.6;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.12; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.skip-link {
position: absolute; left: -999px; top: 0; z-index: 200;
background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* ---------- Buttons ---------- */
.btn {
display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
font-family: var(--sans); font-weight: 600; font-size: .95rem;
padding: .7rem 1.25rem; border-radius: 999px; border: 1px solid transparent;
cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
white-space: nowrap;
}
.btn--lg { padding: .95rem 1.7rem; font-size: 1.02rem; }
.btn--donate { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(212, 80, 62, 0.32); }
.btn--donate:hover { background: var(--accent-d); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(212, 80, 62, 0.4); }
.btn--donate:active { transform: translateY(0); }
.btn--ghost { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.4); backdrop-filter: blur(4px); }
.btn--ghost:hover { background: rgba(255,255,255,0.24); transform: translateY(-2px); }
/* ---------- Alert bar ---------- */
.alert-bar {
background: var(--accent-d); color: #fff; text-align: center;
font-size: .9rem; padding: .55rem 1rem; display: flex; gap: .55rem;
align-items: center; justify-content: center; flex-wrap: wrap;
}
.alert-bar a { text-decoration: underline; font-weight: 600; }
.alert-bar a:hover { color: #ffe2db; }
.pulse {
width: 9px; height: 9px; border-radius: 50%; background: #ffd2c9;
box-shadow: 0 0 0 0 rgba(255,210,201,0.7); animation: pulse 1.8s infinite;
}
@keyframes pulse {
0% { box-shadow: 0 0 0 0 rgba(255,210,201,0.7); }
70% { box-shadow: 0 0 0 8px rgba(255,210,201,0); }
100% { box-shadow: 0 0 0 0 rgba(255,210,201,0); }
}
/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(246,239,228,0.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav__inner { max-width: 1180px; margin: 0 auto; padding: .8rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; }
.brand__mark { color: var(--accent); font-size: 1.15rem; }
.brand__name { font-family: var(--serif); font-size: 1.2rem; color: var(--brand); font-weight: 600; }
.nav__links { display: flex; gap: 1.4rem; margin-left: auto; }
.nav__links a { font-size: .92rem; font-weight: 500; color: var(--ink-2); position: relative; padding: .25rem 0; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; background: var(--accent); transition: width .2s ease; }
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
.nav__cta { display: flex; align-items: center; gap: .6rem; margin-left: 1rem; }
.nav__toggle { display: none; flex-direction: column; gap: 4px; width: 42px; height: 38px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); cursor: pointer; align-items: center; justify-content: center; }
.nav__toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
/* ---------- Shared ---------- */
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: .65rem; }
.eyebrow--urgent { color: var(--accent); }
.eyebrow--light { color: #cfe0f5; }
.section { max-width: 1180px; margin: 0 auto; padding: clamp(3.5rem, 7vw, 6rem) 1.25rem; }
.section__head { max-width: 640px; margin-bottom: 2.5rem; }
.section__head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--ink); }
.section__head p { color: var(--ink-2); margin-top: .85rem; font-size: 1.05rem; }
.section__head--light h2 { color: #fff; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .22rem .6rem; border-radius: 999px; background: rgba(29,78,137,0.1); color: var(--brand); margin-bottom: .6rem; }
.tag--urgent { background: rgba(212,80,62,0.12); color: var(--accent-d); }
/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; min-height: 600px; }
.hero__media { position: relative; background:
radial-gradient(120% 100% at 30% 20%, rgba(255,255,255,0.18), transparent 60%),
linear-gradient(150deg, #2a5da3 0%, #1d4e89 45%, #143a68 100%); }
.hero__media::after { content: ""; position: absolute; inset: 0; background:
repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 22px),
linear-gradient(to top, rgba(20,58,104,0.55), transparent 55%); }
.hero__photo-cap { position: absolute; left: 1.4rem; bottom: 1.4rem; z-index: 1; color: #eaf1fb; font-size: .82rem; background: rgba(20,58,104,0.45); border: 1px solid rgba(255,255,255,0.18); padding: .4rem .75rem; border-radius: var(--r-sm); backdrop-filter: blur(2px); }
.hero__panel { background: var(--surface); padding: clamp(2rem, 4vw, 3.4rem); display: flex; flex-direction: column; justify-content: center; }
.hero__panel h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); color: var(--ink); }
.eyebrow--urgent.eyebrow { margin-bottom: .5rem; }
.hero__lead { color: var(--ink-2); font-size: 1.1rem; margin-top: 1rem; max-width: 38ch; }
.thermo { margin-top: 1.6rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.1rem 1.2rem; }
.thermo__head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.thermo__raised { font-family: var(--serif); font-weight: 700; font-size: 1.6rem; color: var(--brand); }
.thermo__goal { font-size: .9rem; color: var(--muted); }
.thermo__track { margin: .7rem 0 .6rem; height: 14px; background: rgba(29,78,137,0.1); border-radius: 999px; overflow: hidden; }
.thermo__fill { height: 100%; width: var(--pct); background: linear-gradient(90deg, var(--accent), var(--accent-d)); border-radius: 999px; transition: width 1.6s cubic-bezier(.22,1,.36,1); box-shadow: 0 0 12px rgba(212,80,62,0.45); }
.thermo__meta { display: flex; justify-content: space-between; font-size: .88rem; color: var(--ink-2); }
.thermo__meta strong { color: var(--ink); }
.hero__actions { display: flex; gap: .75rem; margin-top: 1.6rem; flex-wrap: wrap; }
.hero__actions .btn--ghost { color: var(--brand); border-color: var(--line-2); background: transparent; }
.hero__actions .btn--ghost:hover { background: rgba(29,78,137,0.06); }
.hero__badges { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; padding: 0; margin: 1.5rem 0 0; font-size: .85rem; color: var(--ink-2); }
.hero__badges li { font-weight: 500; }
/* ---------- Regions ---------- */
.region-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.region { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease; }
.region:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.region__media { height: 160px; position: relative; background: linear-gradient(150deg, #2a5da3, #1d4e89); display: flex; align-items: flex-end; padding: .9rem; }
.region__media--2 { background: linear-gradient(150deg, #c87b3b, #a85f28); }
.region__media--3 { background: linear-gradient(150deg, #3f8f6f, #2f6f54); }
.region__media span { color: #fff; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; text-shadow: 0 1px 6px rgba(0,0,0,0.3); }
.region__body { padding: 1.1rem 1.2rem 1.4rem; }
.region__body h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.region__body p { color: var(--ink-2); font-size: .94rem; }
.region__stat { display: block; margin-top: .9rem; font-size: .92rem; color: var(--brand); }
.region__stat strong { font-family: var(--serif); font-size: 1.15rem; }
/* ---------- Impact ---------- */
.impact { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-d) 100%); color: #fff; }
.impact { padding: clamp(3.5rem, 7vw, 5.5rem) 1.25rem; }
.impact .section__head { max-width: 1180px; margin: 0 auto 2.6rem; }
.stat-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.stat { text-align: center; padding: 1.6rem 1rem; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); border-radius: var(--r-md); }
.stat__num { display: block; font-family: var(--serif); font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.7rem); color: #fff; }
.stat__label { font-size: .92rem; color: #cfe0f5; }
/* ---------- Appeal ---------- */
.appeal { padding-top: clamp(3.5rem, 7vw, 6rem); }
.appeal__grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 2.5rem; align-items: center; }
.appeal__media { position: relative; min-height: 420px; border-radius: var(--r-lg); background:
radial-gradient(110% 90% at 70% 20%, rgba(255,255,255,0.12), transparent 55%),
linear-gradient(150deg, #b23a2a 0%, #8f2c1e 100%); box-shadow: var(--shadow-md); overflow: hidden; }
.appeal__media::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,0.05) 0 3px, transparent 3px 26px); }
.appeal__cap { position: absolute; left: 1.3rem; bottom: 1.3rem; z-index: 1; color: #ffe9e4; font-size: .85rem; background: rgba(143,44,30,0.5); border: 1px solid rgba(255,255,255,0.2); padding: .45rem .8rem; border-radius: var(--r-sm); }
.appeal__body h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: .3rem 0 .8rem; }
.appeal__body > p { color: var(--ink-2); font-size: 1.05rem; }
.appeal__amounts { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.3rem 0 1rem; }
.chip { font-family: var(--sans); font-weight: 600; font-size: 1rem; padding: .65rem 1.15rem; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; transition: .18s; }
.chip:hover { border-color: var(--accent); color: var(--accent-d); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(212,80,62,0.3); }
.chip--custom { display: inline-flex; align-items: center; gap: .25rem; padding: .65rem .9rem; }
.chip--custom input { width: 72px; border: none; background: transparent; font: inherit; color: var(--ink); }
.chip--custom input:focus { outline: none; }
.chip--custom:focus-within { border-color: var(--accent); }
.appeal__impact { color: var(--brand); font-weight: 600; font-size: .98rem; background: rgba(29,78,137,0.07); border-left: 3px solid var(--brand); padding: .6rem .85rem; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.appeal__actions { display: flex; align-items: center; gap: 1.2rem; margin-top: 1.3rem; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: .5rem; font-size: .92rem; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
/* ---------- Ways to help ---------- */
.help-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.help-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.6rem 1.4rem; box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease; }
.help-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.help-card__icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: rgba(29,78,137,0.1); color: var(--brand); font-size: 1.4rem; margin-bottom: .9rem; }
.help-card h3 { font-size: 1.18rem; margin-bottom: .4rem; }
.help-card p { color: var(--ink-2); font-size: .93rem; margin-bottom: .9rem; }
.help-card a { color: var(--accent-d); font-weight: 600; font-size: .92rem; }
.help-card a:hover { color: var(--accent); }
/* ---------- Trust ---------- */
.trust { max-width: 1180px; margin: 0 auto; padding: clamp(3.5rem, 7vw, 6rem) 1.25rem; }
.trust__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.2rem; align-items: start; }
.allocation { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.6rem; box-shadow: var(--shadow-sm); }
.alloc-row { display: grid; grid-template-columns: 1fr auto; gap: .3rem .8rem; margin-bottom: 1.1rem; font-size: .95rem; }
.alloc-row:last-child { margin-bottom: 0; }
.alloc-row span:nth-child(2) { font-weight: 700; color: var(--ink); }
.alloc-bar { grid-column: 1 / -1; height: 10px; background: rgba(29,78,137,0.08); border-radius: 999px; overflow: hidden; }
.alloc-bar i { display: block; height: 100%; width: 0; background: var(--c, var(--brand)); border-radius: 999px; transition: width 1.3s cubic-bezier(.22,1,.36,1); }
.allocation.is-in i { width: var(--w); }
.badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.badges li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: .9rem 1rem; font-size: .9rem; font-weight: 600; color: var(--ink-2); display: flex; gap: .5rem; align-items: center; box-shadow: var(--shadow-sm); }
.badges li strong { color: var(--accent); font-size: 1.05rem; }
.donors { margin: 2.4rem 0 0; padding: 1.5rem 1.6rem; background: rgba(29,78,137,0.05); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.donors figcaption { font-family: var(--serif); font-weight: 600; color: var(--brand); margin-bottom: .8rem; }
.donors ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem .8rem; }
.donors li { font-size: .9rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: .4rem .85rem; border-radius: 999px; }
/* ---------- Donate CTA ---------- */
.donate { background:
radial-gradient(120% 120% at 80% 0%, rgba(212,80,62,0.18), transparent 50%),
linear-gradient(160deg, var(--brand-d) 0%, #0f2c50 100%); color: #fff; }
.donate__inner { max-width: 760px; margin: 0 auto; padding: clamp(3.5rem, 7vw, 5.5rem) 1.25rem; text-align: center; }
.donate__inner h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
.donate__inner > p { color: #d6e3f4; margin-top: .8rem; font-size: 1.08rem; }
.donate__form { margin-top: 1.8rem; display: flex; flex-direction: column; gap: .8rem; align-items: center; }
.donate__amounts { display: flex; gap: .6rem; }
.donate__amounts .chip { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); color: #fff; }
.donate__amounts .chip:hover { border-color: #fff; color: #fff; }
.donate__amounts .chip.is-active { background: var(--accent); border-color: var(--accent); }
.donate__email { width: 100%; max-width: 340px; padding: .85rem 1.1rem; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.1); color: #fff; font: inherit; }
.donate__email::placeholder { color: #c3d3e8; }
.donate__email:focus { outline: none; border-color: #fff; background: rgba(255,255,255,0.16); }
.donate__form .btn--donate { width: 100%; max-width: 340px; }
.donate__fine { margin-top: 1.1rem; font-size: .85rem; color: #b8cae2; }
/* ---------- Footer ---------- */
.footer { background: #102842; color: #cdd9ea; }
.footer__inner { max-width: 1180px; margin: 0 auto; padding: 3rem 1.25rem 2rem; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer__brand .brand__name { color: #fff; }
.footer__brand p { margin-top: .7rem; font-size: .9rem; color: #9fb2cd; max-width: 30ch; }
.footer h4 { font-family: var(--sans); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: #7e93b2; margin-bottom: .8rem; }
.footer nav a { display: block; font-size: .92rem; color: #cdd9ea; padding: .25rem 0; }
.footer nav a:hover { color: #fff; }
.footer__bar { border-top: 1px solid rgba(255,255,255,0.1); }
.footer__bar span { display: block; max-width: 1180px; margin: 0 auto; padding: 1.1rem 1.25rem; font-size: .82rem; color: #8095b3; }
/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(140%); background: var(--ink); color: #fff; padding: .85rem 1.3rem; border-radius: 999px; font-size: .92rem; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 300; opacity: 0; transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .35s; max-width: 92vw; }
.toast.is-show { transform: translateX(-50%) translateY(0); opacity: 1; }
/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.22,1,.36,1); }
.reveal.is-in { opacity: 1; transform: none; }
/* ---------- Responsive ---------- */
@media (max-width: 940px) {
.hero { grid-template-columns: 1fr; }
.hero__media { min-height: 240px; }
.region-grid, .help-grid { grid-template-columns: repeat(2, 1fr); }
.stat-grid { grid-template-columns: repeat(2, 1fr); }
.appeal__grid, .trust__grid { grid-template-columns: 1fr; }
.appeal__media { min-height: 280px; }
.footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
.nav__links {
position: absolute; top: 100%; left: 0; right: 0;
flex-direction: column; gap: 0; background: var(--surface);
border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
padding: .5rem 1.25rem; transform-origin: top; display: none;
}
.nav__links.is-open { display: flex; }
.nav__links a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.nav__links a:last-child { border-bottom: none; }
.nav__toggle { display: flex; }
}
@media (max-width: 520px) {
.region-grid, .help-grid, .footer__inner { grid-template-columns: 1fr; }
.stat-grid { grid-template-columns: 1fr 1fr; }
.nav__cta .btn--donate { padding: .55rem 1rem; font-size: .88rem; }
.hero__panel { padding: 1.8rem 1.3rem; }
.donate__amounts { flex-wrap: wrap; justify-content: center; }
.alert-bar { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
* { animation: none !important; scroll-behavior: auto; }
.reveal { opacity: 1; transform: none; transition: none; }
.thermo__fill, .alloc-bar i { transition: none; }
}(function () {
"use strict";
/* ---------- Toast helper ---------- */
var toastEl = document.getElementById("toast");
var toastTimer;
function toast(msg) {
if (!toastEl) return;
toastEl.textContent = msg;
toastEl.classList.add("is-show");
clearTimeout(toastTimer);
toastTimer = setTimeout(function () {
toastEl.classList.remove("is-show");
}, 3200);
}
/* ---------- Mobile nav ---------- */
var navToggle = document.getElementById("navToggle");
var navLinks = document.getElementById("navlinks");
if (navToggle && navLinks) {
navToggle.addEventListener("click", function () {
var open = navLinks.classList.toggle("is-open");
navToggle.setAttribute("aria-expanded", String(open));
navToggle.setAttribute("aria-label", open ? "Close menu" : "Open menu");
});
navLinks.addEventListener("click", function (e) {
if (e.target.tagName === "A") {
navLinks.classList.remove("is-open");
navToggle.setAttribute("aria-expanded", "false");
}
});
}
/* ---------- Animated counters ---------- */
var reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
function formatNumber(n, prefix, suffix) {
var s;
if (n >= 1000000) {
s = (n / 1000000).toFixed(n % 1000000 === 0 ? 0 : 1) + "M";
} else {
s = Math.round(n).toLocaleString("en-US");
}
return (prefix || "") + s + (suffix || "");
}
function animateCount(el) {
var target = parseFloat(el.getAttribute("data-count")) || 0;
var prefix = el.getAttribute("data-prefix") || "";
var suffix = el.getAttribute("data-suffix") || "";
if (reduceMotion) {
el.textContent = formatNumber(target, prefix, suffix);
return;
}
var start = performance.now();
var dur = 1700;
function tick(now) {
var p = Math.min((now - start) / dur, 1);
var eased = 1 - Math.pow(1 - p, 3);
el.textContent = formatNumber(target * eased, prefix, suffix);
if (p < 1) requestAnimationFrame(tick);
else el.textContent = formatNumber(target, prefix, suffix);
}
requestAnimationFrame(tick);
}
/* ---------- Thermometer fill ---------- */
var raised = 1284500;
var goal = 2000000;
function fillThermo() {
var fill = document.getElementById("thermoFill");
if (fill) {
var pct = Math.min((raised / goal) * 100, 100);
fill.style.setProperty("--pct", pct.toFixed(1) + "%");
}
}
/* ---------- Intersection-driven reveal + counters ---------- */
var counted = new WeakSet();
var io;
if ("IntersectionObserver" in window) {
io = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
if (!entry.isIntersecting) return;
var t = entry.target;
t.classList.add("is-in");
if (t.classList.contains("thermo")) fillThermo();
t.querySelectorAll("[data-count]").forEach(function (c) {
if (!counted.has(c)) { counted.add(c); animateCount(c); }
});
if (t.hasAttribute("data-count") && !counted.has(t)) {
counted.add(t); animateCount(t);
}
io.unobserve(t);
});
}, { threshold: 0.25, rootMargin: "0px 0px -40px 0px" });
document.querySelectorAll(".reveal, .thermo, .stat, .allocation, [data-count]").forEach(function (el) {
io.observe(el);
});
} else {
// Fallback
document.querySelectorAll(".reveal, .allocation").forEach(function (el) { el.classList.add("is-in"); });
document.querySelectorAll("[data-count]").forEach(animateCount);
fillThermo();
}
/* ---------- Days-left countdown ---------- */
var daysLeftEl = document.getElementById("daysLeft");
if (daysLeftEl) {
var deadline = new Date();
deadline.setDate(deadline.getDate() + 11);
var diff = Math.max(0, Math.ceil((deadline - new Date()) / 86400000));
daysLeftEl.textContent = diff;
}
/* ---------- Appeal amount selection ---------- */
var amounts = document.getElementById("amounts");
var customInput = document.getElementById("customAmount");
var appealImpact = document.getElementById("appealImpact");
var appealGive = document.getElementById("appealGive");
var monthly = document.getElementById("monthly");
var selectedAmount = 75;
function impactText(amt, isMonthly) {
var kits = Math.max(1, Math.round(amt / 35));
var per = isMonthly ? " every month" : "";
if (amt >= 500) return "$" + amt + per + " funds an emergency water station for a whole village.";
if (amt >= 150) return "$" + amt + per + " delivers " + kits + " water kits + food for " + kits + " families.";
return "$" + amt + per + " delivers " + kits + " water kit" + (kits > 1 ? "s" : "") + " + a week of food for one family.";
}
function updateAppeal() {
var m = monthly && monthly.checked;
if (appealImpact) appealImpact.textContent = impactText(selectedAmount, m);
if (appealGive) appealGive.textContent = "Give $" + selectedAmount + (m ? "/mo" : "") + " now";
}
if (amounts) {
amounts.addEventListener("click", function (e) {
var btn = e.target.closest(".chip[data-amount]");
if (!btn) return;
amounts.querySelectorAll(".chip").forEach(function (c) { c.classList.remove("is-active"); });
btn.classList.add("is-active");
if (customInput) customInput.value = "";
selectedAmount = parseInt(btn.getAttribute("data-amount"), 10);
updateAppeal();
});
}
if (customInput) {
customInput.addEventListener("input", function () {
var v = parseInt(customInput.value, 10);
if (v > 0) {
amounts.querySelectorAll(".chip[data-amount]").forEach(function (c) { c.classList.remove("is-active"); });
customInput.closest(".chip").classList.add("is-active");
selectedAmount = v;
updateAppeal();
}
});
}
if (monthly) monthly.addEventListener("change", updateAppeal);
updateAppeal();
/* ---------- Donate CTA form ---------- */
var donateAmounts = document.getElementById("donateAmounts");
var donateLabel = document.getElementById("donateLabel");
var donateForm = document.getElementById("donateForm");
var donorEmail = document.getElementById("donorEmail");
var donateAmount = 100;
if (donateAmounts) {
donateAmounts.addEventListener("click", function (e) {
var btn = e.target.closest(".chip[data-amount]");
if (!btn) return;
donateAmounts.querySelectorAll(".chip").forEach(function (c) { c.classList.remove("is-active"); });
btn.classList.add("is-active");
donateAmount = parseInt(btn.getAttribute("data-amount"), 10);
if (donateLabel) donateLabel.textContent = "$" + donateAmount;
});
}
if (donateForm) {
donateForm.addEventListener("submit", function (e) {
e.preventDefault();
var email = donorEmail ? donorEmail.value.trim() : "";
if (!email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
toast("Please enter a valid email for your receipt.");
if (donorEmail) donorEmail.focus();
return;
}
// Matched 2x this week
var matched = donateAmount * 2;
toast("Thank you! Your $" + donateAmount + " becomes $" + matched + " with matching. (Demo only)");
donateForm.reset();
donateAmounts.querySelectorAll(".chip").forEach(function (c) { c.classList.remove("is-active"); });
var def = donateAmounts.querySelector('[data-amount="100"]');
if (def) def.classList.add("is-active");
donateAmount = 100;
if (donateLabel) donateLabel.textContent = "$100";
});
}
/* ---------- Donate buttons that scroll (links) feedback ---------- */
document.querySelectorAll('a[href="#donate"]').forEach(function (a) {
if (a.classList.contains("btn--donate") && a.id !== "appealGive") {
a.addEventListener("click", function () {
setTimeout(function () {
var input = document.getElementById("donorEmail");
if (input) input.focus({ preventScroll: true });
}, 700);
});
}
});
if (appealGive) {
appealGive.addEventListener("click", function () {
setTimeout(function () {
var input = document.getElementById("donorEmail");
if (input) input.focus({ preventScroll: true });
}, 700);
});
}
})();<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>ReliefBridge — Emergency Humanitarian Aid</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=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<a class="skip-link" href="#main">Skip to content</a>
<!-- Top urgent banner -->
<div class="alert-bar" role="region" aria-label="Emergency appeal">
<span class="pulse" aria-hidden="true"></span>
<strong>Emergency:</strong> Flooding in the Lower Delta has displaced 240,000 people.
<a href="#appeal">Respond now →</a>
</div>
<!-- Navigation -->
<header class="nav" id="top">
<div class="nav__inner">
<a class="brand" href="#top" aria-label="ReliefBridge home">
<span class="brand__mark" aria-hidden="true">◆</span>
<span class="brand__name">ReliefBridge</span>
</a>
<nav class="nav__links" id="navlinks" aria-label="Primary">
<a href="#work">Where We Work</a>
<a href="#impact">Impact</a>
<a href="#appeal">Appeals</a>
<a href="#help">Ways to Help</a>
<a href="#trust">Transparency</a>
</nav>
<div class="nav__cta">
<a class="btn btn--donate" href="#donate">Donate</a>
<button class="nav__toggle" id="navToggle" aria-expanded="false" aria-controls="navlinks" aria-label="Open menu">
<span></span><span></span><span></span>
</button>
</div>
</div>
</header>
<main id="main">
<!-- HERO -->
<section class="hero" aria-labelledby="hero-title">
<div class="hero__media" role="img" aria-label="Aid workers distributing water and supplies to families at a relief camp at dawn">
<span class="hero__photo-cap">Dawn distribution — Lower Delta relief camp</span>
</div>
<div class="hero__panel">
<span class="eyebrow eyebrow--urgent">Crisis Response · Active Now</span>
<h1 id="hero-title">When the water rose, so did we.</h1>
<p class="hero__lead">
Families in the Lower Delta lost everything in 72 hours. Your gift delivers clean
water, shelter and emergency food — within days, not months.
</p>
<div class="thermo" id="thermo" aria-label="Fundraising progress">
<div class="thermo__head">
<span class="thermo__raised" data-count="1284500" data-prefix="$">$0</span>
<span class="thermo__goal">raised of $2,000,000 goal</span>
</div>
<div class="thermo__track">
<div class="thermo__fill" id="thermoFill" style="--pct:0%"></div>
</div>
<div class="thermo__meta">
<span><strong data-count="9120">0</strong> donors</span>
<span><strong id="daysLeft">11</strong> days left</span>
</div>
</div>
<div class="hero__actions">
<a class="btn btn--donate btn--lg" href="#donate">Give emergency aid</a>
<a class="btn btn--ghost btn--lg" href="#work">See where it goes</a>
</div>
<ul class="hero__badges" aria-label="Trust signals">
<li>✓ Registered charity #84-2210</li>
<li>✓ Tax-deductible</li>
<li>✓ 89¢ of every $1 to programs</li>
</ul>
</div>
</section>
<!-- WHERE WE WORK -->
<section class="section" id="work" aria-labelledby="work-title">
<div class="section__head reveal">
<span class="eyebrow">Where we work</span>
<h2 id="work-title">Aid that reaches the last mile</h2>
<p>We operate in 23 countries through local partners — the people already there, already trusted.</p>
</div>
<div class="region-grid">
<article class="region reveal">
<div class="region__media" role="img" aria-label="Tents across a hillside relief settlement"><span>Lower Delta</span></div>
<div class="region__body">
<span class="tag tag--urgent">Active emergency</span>
<h3>Lower Delta Floods</h3>
<p>240,000 displaced. Teams delivering water purification and shelter kits.</p>
<span class="region__stat"><strong data-count="61000">0</strong> people reached</span>
</div>
</article>
<article class="region reveal">
<div class="region__media region__media--2" role="img" aria-label="Children collecting clean water at a tap stand"><span>Sahel</span></div>
<div class="region__body">
<span class="tag">Ongoing</span>
<h3>Sahel Drought Response</h3>
<p>Nutrition centers and water trucking across four provinces facing failed harvests.</p>
<span class="region__stat"><strong data-count="318000">0</strong> people reached</span>
</div>
</article>
<article class="region reveal">
<div class="region__media region__media--3" role="img" aria-label="Volunteers unloading medical supplies from a truck"><span>Eastern Highlands</span></div>
<div class="region__body">
<span class="tag">Recovery</span>
<h3>Highlands Earthquake</h3>
<p>Rebuilding clinics and schools with cash-for-work programs for local families.</p>
<span class="region__stat"><strong data-count="94500">0</strong> people reached</span>
</div>
</article>
</div>
</section>
<!-- IMPACT STATS -->
<section class="impact" id="impact" aria-labelledby="impact-title">
<div class="section__head section__head--light reveal">
<span class="eyebrow eyebrow--light">Our impact in 2025</span>
<h2 id="impact-title">Transparency you can count</h2>
</div>
<div class="stat-grid">
<div class="stat reveal"><span class="stat__num" data-count="4200000">0</span><span class="stat__label">meals served</span></div>
<div class="stat reveal"><span class="stat__num" data-count="1900000" data-suffix="L">0</span><span class="stat__label">litres of clean water</span></div>
<div class="stat reveal"><span class="stat__num" data-count="78000">0</span><span class="stat__label">emergency shelters</span></div>
<div class="stat reveal"><span class="stat__num" data-count="23">0</span><span class="stat__label">countries reached</span></div>
</div>
</section>
<!-- EMERGENCY APPEAL -->
<section class="section appeal" id="appeal" aria-labelledby="appeal-title">
<div class="appeal__grid">
<div class="appeal__media" role="img" aria-label="A mother carries her child through floodwater toward a rescue boat">
<span class="appeal__cap">Amina and her daughter, reaching the boat at last</span>
</div>
<div class="appeal__body reveal">
<span class="eyebrow eyebrow--urgent">Emergency appeal · Lower Delta</span>
<h2 id="appeal-title">A clean-water kit costs $35. A family survives the week.</h2>
<p>The flood took the wells. Without safe water, cholera follows within days. Your gift is the fastest line between a family and survival.</p>
<div class="appeal__amounts" id="amounts" role="group" aria-label="Choose a donation amount">
<button class="chip" data-amount="35">$35</button>
<button class="chip is-active" data-amount="75">$75</button>
<button class="chip" data-amount="150">$150</button>
<button class="chip" data-amount="500">$500</button>
<label class="chip chip--custom">
<span aria-hidden="true">$</span>
<input id="customAmount" type="number" min="1" inputmode="numeric" placeholder="Other" aria-label="Custom amount in dollars" />
</label>
</div>
<p class="appeal__impact" id="appealImpact">$75 delivers 2 water kits + a week of food for one family.</p>
<div class="appeal__actions">
<a class="btn btn--donate btn--lg" href="#donate" id="appealGive">Give $75 now</a>
<label class="toggle">
<input type="checkbox" id="monthly" />
<span>Make it monthly</span>
</label>
</div>
</div>
</div>
</section>
<!-- WAYS TO HELP -->
<section class="section" id="help" aria-labelledby="help-title">
<div class="section__head reveal">
<span class="eyebrow">Ways to help</span>
<h2 id="help-title">More than one way to stand up</h2>
</div>
<div class="help-grid">
<article class="help-card reveal">
<div class="help-card__icon" aria-hidden="true">♥</div>
<h3>Give monthly</h3>
<p>Recurring gifts let us pre-position supplies before the next disaster strikes.</p>
<a href="#donate">Become a Bridge Builder →</a>
</article>
<article class="help-card reveal">
<div class="help-card__icon" aria-hidden="true">⛺</div>
<h3>Fundraise</h3>
<p>Run a campaign for your birthday, team or community. We give you everything you need.</p>
<a href="#donate">Start a fundraiser →</a>
</article>
<article class="help-card reveal">
<div class="help-card__icon" aria-hidden="true">🏢</div>
<h3>Corporate match</h3>
<p>Double your impact — most employers match gifts dollar for dollar.</p>
<a href="#donate">Check matching →</a>
</article>
<article class="help-card reveal">
<div class="help-card__icon" aria-hidden="true">📣</div>
<h3>Spread the word</h3>
<p>Awareness moves resources. Share an appeal and tag three friends.</p>
<a href="#donate">Share now →</a>
</article>
</div>
</section>
<!-- TRUST / TRANSPARENCY -->
<section class="trust" id="trust" aria-labelledby="trust-title">
<div class="section__head reveal">
<span class="eyebrow">Transparency</span>
<h2 id="trust-title">Where your dollar goes</h2>
<p>Independently audited. Published every quarter. No surprises.</p>
</div>
<div class="trust__grid">
<div class="allocation reveal" aria-label="Spending allocation">
<div class="alloc-row">
<span>Direct programs</span><span>89%</span>
<div class="alloc-bar"><i style="--w:89%"></i></div>
</div>
<div class="alloc-row">
<span>Fundraising</span><span>7%</span>
<div class="alloc-bar"><i style="--w:7%;--c:var(--accent)"></i></div>
</div>
<div class="alloc-row">
<span>Administration</span><span>4%</span>
<div class="alloc-bar"><i style="--w:4%;--c:var(--muted)"></i></div>
</div>
</div>
<ul class="badges reveal" aria-label="Accreditations">
<li><strong>★★★★</strong> Charity Navigator</li>
<li><strong>✓</strong> GuideStar Platinum</li>
<li><strong>§</strong> 501(c)(3) registered</li>
<li><strong>↧</strong> Annual report (PDF)</li>
</ul>
</div>
<figure class="donors reveal">
<figcaption>Thank you to our recent supporters</figcaption>
<ul>
<li>The Okafor Family Foundation</li>
<li>Marisol V.</li>
<li>Northbridge School PTA</li>
<li>Anonymous · $10,000</li>
<li>Daniel & Priya R.</li>
<li>Harbor Light Co-op</li>
</ul>
</figure>
</section>
<!-- DONATE CTA -->
<section class="donate" id="donate" aria-labelledby="donate-title">
<div class="donate__inner reveal">
<h2 id="donate-title">Be the bridge a family crosses today.</h2>
<p>Every gift is matched 2× this week, up to $500,000, by the Okafor Foundation.</p>
<form class="donate__form" id="donateForm" novalidate>
<div class="donate__amounts" id="donateAmounts" role="group" aria-label="Donation amount">
<button type="button" class="chip" data-amount="50">$50</button>
<button type="button" class="chip is-active" data-amount="100">$100</button>
<button type="button" class="chip" data-amount="250">$250</button>
</div>
<input class="donate__email" id="donorEmail" type="email" placeholder="you@email.com" aria-label="Your email" required />
<button class="btn btn--donate btn--lg" type="submit">Donate <span id="donateLabel">$100</span></button>
</form>
<p class="donate__fine">Secure & encrypted · Cancel anytime · Receipt emailed instantly</p>
</div>
</section>
</main>
<footer class="footer">
<div class="footer__inner">
<div class="footer__brand">
<span class="brand__mark" aria-hidden="true">◆</span>
<span class="brand__name">ReliefBridge</span>
<p>Fast, dignified humanitarian aid through local partners in 23 countries.</p>
</div>
<nav aria-label="Footer">
<h4>Our work</h4>
<a href="#work">Where we work</a>
<a href="#impact">Impact</a>
<a href="#appeal">Appeals</a>
</nav>
<nav aria-label="Get involved">
<h4>Get involved</h4>
<a href="#donate">Donate</a>
<a href="#help">Fundraise</a>
<a href="#help">Corporate match</a>
</nav>
<nav aria-label="About">
<h4>Accountability</h4>
<a href="#trust">Annual report</a>
<a href="#trust">Financials</a>
<a href="#top">Contact</a>
</nav>
</div>
<div class="footer__bar">
<span>© 2026 ReliefBridge Relief Fund · Registered charity #84-2210 · A fictional organization.</span>
</div>
</footer>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<script src="script.js"></script>
</body>
</html>Humanitarian Landing
A complete landing page for the fictional relief organization ReliefBridge, built to feel urgent, hopeful and dignified. A warm sand background pairs with a deep relief blue and an urgent red accent reserved for the donate calls to action. The hero leads with a live fundraising thermometer whose fill animates into place, animated donor and amount-raised counters, and trust signals (registered charity number, tax-deductible, cents-on-the-dollar to programs).
Below the hero, region cards show where aid is flowing, an impact band counts up real-feeling totals (meals, litres of water, shelters, countries), and an emergency appeal lets visitors pick a gift amount — preset chips or a custom value — with the impact sentence and donate button updating live, including a make-it-monthly toggle. A transparency section animates a spending allocation breakdown, shows accreditation badges and recognizes recent donors, and the closing donate form validates the email and reports the 2× matched total via a toast.
All interactions are vanilla JavaScript: an IntersectionObserver drives scroll reveal, counter
animations and the thermometer fill, with a mobile hamburger nav and a reusable toast(msg) helper.
Everything respects prefers-reduced-motion and is keyboard-usable and responsive down to ~360px.
Illustrative UI only — fictional organization, not a real charity or donation system.