PluginProbe
Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor / 2.0.11
Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor v2.0.11
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 / gradient-section / frontend.js

frontend.js in Blockenberg — 600+ Advanced Gutenberg Blocks & AI Agent for WordPress Block Editor 2.0.11, at blocks/gradient-section/frontend.js

33 lines 1.2 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 /* Gradient section – IntersectionObserver content entrance */
5 document.querySelectorAll('.bkbg-gs-wrapper').forEach(function (wrapper) {
6 var inner = wrapper.querySelector('.bkbg-gs-inner');
7 if (!inner || !('IntersectionObserver' in window)) return;
8
9 /* Animate content in when section enters viewport */
10 var children = inner.children;
11 Array.prototype.forEach.call(children, function (child) {
12 child.style.opacity = '0';
13 child.style.transform = 'translateY(22px)';
14 child.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
15 });
16
17 var io = new IntersectionObserver(function (entries) {
18 entries.forEach(function (entry) {
19 if (!entry.isIntersecting) return;
20 Array.prototype.forEach.call(children, function (child, i) {
21 setTimeout(function () {
22 child.style.opacity = '1';
23 child.style.transform = 'translateY(0)';
24 }, i * 100);
25 });
26 io.unobserve(wrapper);
27 });
28 }, { threshold: 0.15 });
29
30 io.observe(wrapper);
31 });
32 })();
33