# blockenberg/2.0.7/blocks/rating-summary/frontend.js

Blockenberg — 600+ Advanced Gutenberg Blocks &amp; AI Agent for WordPress Block Editor, version 2.0.7. 32 lines.

- Page: https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/rating-summary/frontend.js
- Raw: https://pluginprobe.com/plugins/blockenberg/2.0.7/raw/blocks/rating-summary/frontend.js
- Modified: 2026-03-06T12:32:40+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/blockenberg/2.0.7/code/blocks/rating-summary/frontend.js#L10-L20`.

```javascript
(function () {
    'use strict';

    function animateBars() {
        var fills = document.querySelectorAll('.bkbg-rs-fill');
        if (!fills.length) return;

        var io = new IntersectionObserver(function (entries) {
            entries.forEach(function (entry) {
                if (entry.isIntersecting) {
                    var el = entry.target;
                    var pct = parseFloat(el.getAttribute('data-pct')) || 0;
                    el.style.width = pct + '%';
                    io.unobserve(el);
                }
            });
        }, { threshold: 0.2 });

        fills.forEach(function (fill) {
            fill.style.width = '0%';
            fill.style.transition = 'width 0.9s ease';
            io.observe(fill);
        });
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', animateBars);
    } else {
        animateBars();
    }
}());

```
