PluginProbe
Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor / 2.0.7
Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor v2.0.7
2.0.13 2.0.12 2.0.11 2.0.10 2.0.9 trunk 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8
blockenberg / blocks / rating-summary / frontend.js

frontend.js in Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor 2.0.7, at blocks/rating-summary/frontend.js

32 lines 931 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function () {
2 'use strict';
3
4 function animateBars() {
5 var fills = document.querySelectorAll('.bkbg-rs-fill');
6 if (!fills.length) return;
7
8 var io = new IntersectionObserver(function (entries) {
9 entries.forEach(function (entry) {
10 if (entry.isIntersecting) {
11 var el = entry.target;
12 var pct = parseFloat(el.getAttribute('data-pct')) || 0;
13 el.style.width = pct + '%';
14 io.unobserve(el);
15 }
16 });
17 }, { threshold: 0.2 });
18
19 fills.forEach(function (fill) {
20 fill.style.width = '0%';
21 fill.style.transition = 'width 0.9s ease';
22 io.observe(fill);
23 });
24 }
25
26 if (document.readyState === 'loading') {
27 document.addEventListener('DOMContentLoaded', animateBars);
28 } else {
29 animateBars();
30 }
31 }());
32