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 / location-cards / frontend.js

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

36 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.querySelectorAll('.bkbg-lc-wrapper').forEach(function (wrapper) {
5 /* ── Staggered card entrance animation ───────────────────── */
6 if (!('IntersectionObserver' in window)) return;
7
8 var cards = wrapper.querySelectorAll('.bkbg-lc-card');
9 cards.forEach(function (card, i) {
10 card.style.opacity = '0';
11 card.style.transform = 'translateY(24px)';
12 card.style.transition = 'opacity 0.45s ease ' + (i * 0.08) + 's, transform 0.45s ease ' + (i * 0.08) + 's';
13 });
14
15 var io = new IntersectionObserver(function (entries) {
16 entries.forEach(function (entry) {
17 if (!entry.isIntersecting) return;
18 entry.target.style.opacity = '1';
19 entry.target.style.transform = 'translateY(0)';
20 io.unobserve(entry.target);
21 });
22 }, { threshold: 0.08 });
23
24 cards.forEach(function (card) { io.observe(card); });
25
26 /* ── Directions button → open Google Maps ────────────────── */
27 wrapper.querySelectorAll('.bkbg-lc-btn-directions[data-address]').forEach(function (btn) {
28 btn.addEventListener('click', function () {
29 var addr = btn.getAttribute('data-address');
30 if (!addr) return;
31 window.open('https://www.google.com/maps/search/' + encodeURIComponent(addr), '_blank', 'noopener');
32 });
33 });
34 });
35 })();
36