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 / howto-schema / frontend.js

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

34 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function () {
2 'use strict';
3
4 // Staggered entrance animation for HowTo steps
5 if (!('IntersectionObserver' in window)) return;
6
7 document.querySelectorAll('.bkbg-hs-steps').forEach(function (ol) {
8 var steps = ol.querySelectorAll('.bkbg-hs-step');
9 if (!steps.length) return;
10
11 // Mark each step for animation
12 steps.forEach(function (step) {
13 step.setAttribute('data-animate', '');
14 });
15
16 var io = new IntersectionObserver(function (entries) {
17 entries.forEach(function (entry) {
18 if (!entry.isIntersecting) return;
19 var step = entry.target;
20 // Get the index to stagger
21 var idx = Array.prototype.indexOf.call(steps, step);
22 setTimeout(function () {
23 step.setAttribute('data-animate', 'in');
24 }, idx * 100);
25 io.unobserve(step);
26 });
27 }, { threshold: 0.15, rootMargin: '0px 0px -40px 0px' });
28
29 steps.forEach(function (step) {
30 io.observe(step);
31 });
32 });
33 })();
34