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 / spotlight-card / frontend.js

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

29 lines 983 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* Spotlight Card — mouse-tracking spotlight frontend */
2 (function () {
3 function init() {
4 document.querySelectorAll('.bkspot-card').forEach(function (card) {
5 if (card._bkspotInit) return;
6 card._bkspotInit = true;
7
8 card.addEventListener('mousemove', function (e) {
9 var rect = card.getBoundingClientRect();
10 var x = e.clientX - rect.left;
11 var y = e.clientY - rect.top;
12 card.style.setProperty('--bkspot-x', x + 'px');
13 card.style.setProperty('--bkspot-y', y + 'px');
14 });
15
16 card.addEventListener('mouseleave', function () {
17 card.style.setProperty('--bkspot-x', '-9999px');
18 card.style.setProperty('--bkspot-y', '-9999px');
19 });
20 });
21 }
22
23 if (document.readyState === 'loading') {
24 document.addEventListener('DOMContentLoaded', init);
25 } else {
26 init();
27 }
28 }());
29