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 / feature-grid / frontend.js

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

32 lines 868 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 initFeatureGrid(wrapper) {
5 var cards = wrapper.querySelectorAll('.bkbg-fg-card.bkbg-fg-anim');
6 if (!cards.length) return;
7
8 var io = new IntersectionObserver(function (entries) {
9 entries.forEach(function (entry) {
10 if (entry.isIntersecting) {
11 entry.target.classList.add('bkbg-fg-visible');
12 io.unobserve(entry.target);
13 }
14 });
15 }, { threshold: 0.12 });
16
17 cards.forEach(function (card) {
18 io.observe(card);
19 });
20 }
21
22 function init() {
23 document.querySelectorAll('.bkbg-fg-wrapper').forEach(initFeatureGrid);
24 }
25
26 if (document.readyState === 'loading') {
27 document.addEventListener('DOMContentLoaded', init);
28 } else {
29 init();
30 }
31 })();
32