Skip to content

[FEATURE] - Animated Counter To Stats section #405

@shrvtiprasad

Description

@shrvtiprasad

✨ Feature Description

Add an animated counter component to stats section, that smoothly counts numbers from a starting value to a target value when it comes into view. This will be used to showcase stats like researchers, paper organised, etc. in a more engaging way.


🎯 Why is this Needed?

-Makes important stats stand out instead of looking static.
-Creates a more dynamic and polished user experience.
-Helps highlight achievements or growth in a way that draws attention.


📋 Possible Implementation

  1. Add data-target, data-suffix, and data-decimals to each .stat-number.

  2. Style numbers bold and labels muted so stats stand out.

  3. Use IntersectionObserver to trigger counting only when stats scroll into view.

  4. Animate numbers from 0 → target with requestAnimationFrame and easing.

  5. Format values with toLocaleString() for commas/decimals.

  6. Use suffixes like + / % from data-* attributes.

  7. Run once per element, add a .done class when finished.

  8. Respect reduced motion (show final instantly).

  9. Fallback: show final number if JS is disabled.


📸 Mockups / Examples (if any)

https://pin.it/5iUbJjkQ7

✅ Additional Notes

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions