# blockspare/5.0.1/build/block/counter/view.js

BlockSpare – Gutenberg Blocks, AI Content Generator &amp; Site Builder for News, Magazine &amp; Blogs, version 5.0.1. 1 lines.

- Page: https://pluginprobe.com/plugins/blockspare/5.0.1/code/build/block/counter/view.js
- Raw: https://pluginprobe.com/plugins/blockspare/5.0.1/raw/build/block/counter/view.js
- Modified: 2026-09-24T12:18:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/blockspare/5.0.1/code/build/block/counter/view.js#L10-L20`.

```javascript
document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll(".blockspare-counter"),t=new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&((e=>{const t=parseInt(e.dataset.count,10),n=performance.now(),o=r=>{const a=Math.min((r-n)/2e3,1),s=1-Math.pow(1-a,3),c=Math.floor(s*t);e.textContent=c,a<1?requestAnimationFrame(o):e.textContent=t};requestAnimationFrame(o)})(e.target),t.unobserve(e.target))})},{threshold:.5});e.forEach(e=>t.observe(e))});
```
