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

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

One HTML file. Save it and open it in any browser.Open full screen

Example: Riverbend Water Trust, an animated 2024 impact section.

Six stat cards count up from zero with a smooth ease-out as they scroll into view: 186,240 people served, 412 wells, 94.6% still working, and more. Percentage cards fill a progress bar as they count. Click Replay count or press R to run the animation again. Resize the window to see the grid reflow, and try reduced-motion mode to see final values appear instantly.

Written by AI from this prompt. Your results will vary.

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 in Animations & Effects