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 / styled-list / frontend.js

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

35 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 /**
5 * Styled List — frontend script
6 *
7 * The block is primarily CSS-driven. This script handles:
8 * 1. Hover background colour — we read the CSS var and apply it so
9 * browsers that don't support CSS colour-mix still get the effect.
10 * 2. A small entrance animation (optional — only when the wrap has
11 * data-animate="1", reserved for future use via the editor toggle).
12 */
13
14 function toArray(nl) {
15 return Array.prototype.slice.call(nl || []);
16 }
17
18 function initStyledList(wrap) {
19 // Nothing interactive is required right now.
20 // The hover state and dividers are handled entirely via CSS.
21 // This function is intentionally kept for future extension points
22 // (e.g. animate-on-scroll, click-to-expand description, etc.).
23 }
24
25 function init() {
26 toArray(document.querySelectorAll('.bkbg-sl-wrap')).forEach(initStyledList);
27 }
28
29 if (document.readyState === 'loading') {
30 document.addEventListener('DOMContentLoaded', init);
31 } else {
32 init();
33 }
34 })();
35