Build an Animated Nonprofit Impact Stats Counter Section in One HTML File
Get a polished nonprofit impact section where six key figures count up with easing on scroll, with formatted thousands, percentages and currency plus believable captions.
You getone complete HTML file in a single code block, then 3 short ideas to extend it.
The prompt
Act as a senior front-end developer and designer who builds accessible, motion-aware marketing pages.
Build a single-page "2024 Impact" section for Riverbend Water Trust, a fictional clean-water nonprofit. The core feature is a grid of six statistic cards whose numbers count up from zero with an ease-out curve the first time each card scrolls into view.
Rules:
1. Use IntersectionObserver to trigger each card once, staggered by about 120 ms; animate with requestAnimationFrame over roughly 2 seconds using an ease-out cubic curve. Add a visible Replay button and the R key to run every counter again.
2. Format values properly: thousands separators for counts (186,240), one-decimal percentages (94.6%), and currency in millions ($3.2M). Use tabular numerals so digits do not jitter.
3. Pair each figure with a short, believable impact caption (people served, wells built, repair rate, mechanics trained, illness reduction, funds raised) and a small label. Percentage cards get a thin progress bar that fills with the count.
4. Layout: hero with eyebrow, headline, intro and a one-line hint, then a responsive auto-fit grid that works from 360 to 1280 px. Palette: deep navy, teal, warm sand background, amber accent.
5. Accessibility: hide the animating digits from screen readers and expose the final value as visually hidden text; with prefers-reduced-motion, show final values instantly.
6. No external fonts, libraries or images; all CSS and JavaScript inline.
Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.Example output
Tips and common edits
Why this works
- IntersectionObserver plus a played flag means each number animates once on view, with a Replay button so the effect is always demonstrable.
- toLocaleString with fixed decimals and tabular numerals gives clean 186,240 and 94.6% formatting with no digit jitter mid-count.
- Visually hidden final values and a reduced-motion path keep the section accessible without losing the animation for everyone else.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as impact.html and open it in any browser, or view it in the chat's preview or canvas panel. Scroll or press Replay to watch the counts.
Common edits
- Swap the nonprofit, figures and captions for your own organization, product metrics or annual report numbers.
- Change the duration, easing curve or stagger delay, or add a count-up for decimals like average response time.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Build a Gallery of Ten Looping Pure-CSS Loading Spinners in One HTML File
You get a single HTML page showing ten original pure-CSS loading animations in a tidy grid, each with a reveal-and-copy code snippet.
Build a Gallery of 12 Pure-CSS Loading Spinners with Copyable Code
You get a single HTML page showing 12 live CSS-only loaders, each with its own isolated CSS, a copy button, and a reduced-motion fallback that pulses gently instead of spinning.
Build a Page Transition Demo with Wipe, Curtain and Morph Effects in One HTML File
A single HTML file that simulates a four-page website and animates every page change with wipe, curtain or morph transitions, plus an adjustable duration and a reduced-motion crossfade.
Build an Animated Number Counter and Progress Ring Stats Dashboard in HTML
You get a single HTML stats section where numbers ease up to their targets and SVG progress rings fill on scroll, with an editor panel and screen-reader announcements.
Build a Beat-Synced Kinetic Typography Quote Animation in One HTML File
A prompt that produces Beatline, a single HTML page animating a short quote word by word on a tempo grid, with varied entrances, replay and a clean recording mode.
Build a Click-to-Launch Fireworks Celebration Animation in One HTML File
A prompt that produces a single HTML page where clicks, taps or keys launch fireworks with gravity, fading trails, soft synthesized pops and a mute toggle.