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 / image-mask / frontend.js

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

32 lines 848 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 reducedMotion() {
5 return window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
6 }
7
8 function init() {
9 if (reducedMotion()) return;
10
11 var imgs = document.querySelectorAll('.bkim-img[data-hover]');
12 imgs.forEach(function (img) {
13 var scale = parseFloat(img.dataset.scale) || 108;
14 var hover = img.dataset.hover;
15
16 // Set CSS custom property so CSS calc() can use the dynamic scale
17 img.style.setProperty('--bkim-scale', scale);
18
19 if (hover === 'none') {
20 img.style.transition = 'none';
21 }
22 });
23 }
24
25 if (document.readyState === 'loading') {
26 document.addEventListener('DOMContentLoaded', init);
27 } else {
28 init();
29 }
30
31 }());
32