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 / split-cta / frontend.js

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

37 lines 1.5 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 document.addEventListener('DOMContentLoaded', function () {
5 /* Animate panels in when they scroll into view */
6 if (!('IntersectionObserver' in window)) return;
7
8 document.querySelectorAll('.bkbg-sct-section').forEach(function (section) {
9 var panels = section.querySelectorAll('.bkbg-sct-panel');
10 if (!panels.length) return;
11
12 var observed = false;
13 var observer = new IntersectionObserver(function (entries) {
14 entries.forEach(function (entry) {
15 if (entry.isIntersecting && !observed) {
16 observed = true;
17 panels.forEach(function (panel, i) {
18 panel.style.opacity = '0';
19 panel.style.transform = 'translateY(18px)';
20 panel.style.transition = 'opacity 0.45s ease ' + (i * 0.12) + 's, transform 0.45s ease ' + (i * 0.12) + 's';
21 requestAnimationFrame(function () {
22 requestAnimationFrame(function () {
23 panel.style.opacity = '1';
24 panel.style.transform = 'translateY(0)';
25 });
26 });
27 });
28 observer.disconnect();
29 }
30 });
31 }, { threshold: 0.15 });
32
33 observer.observe(section);
34 });
35 });
36 })();
37