# blockenberg/2.0.7/blocks/location-cards/frontend.js

Blockenberg — 600+ Advanced Gutenberg Blocks &amp; AI Agent for WordPress Block Editor, version 2.0.7. 36 lines.

- Page: https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/location-cards/frontend.js
- Raw: https://pluginprobe.com/plugins/blockenberg/2.0.7/raw/blocks/location-cards/frontend.js
- Modified: 2026-03-06T12:32:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/location-cards/frontend.js#L10-L20`.

```javascript
(function () {
    'use strict';

    document.querySelectorAll('.bkbg-lc-wrapper').forEach(function (wrapper) {
        /* ── Staggered card entrance animation ───────────────────── */
        if (!('IntersectionObserver' in window)) return;

        var cards = wrapper.querySelectorAll('.bkbg-lc-card');
        cards.forEach(function (card, i) {
            card.style.opacity  = '0';
            card.style.transform = 'translateY(24px)';
            card.style.transition = 'opacity 0.45s ease ' + (i * 0.08) + 's, transform 0.45s ease ' + (i * 0.08) + 's';
        });

        var io = new IntersectionObserver(function (entries) {
            entries.forEach(function (entry) {
                if (!entry.isIntersecting) return;
                entry.target.style.opacity  = '1';
                entry.target.style.transform = 'translateY(0)';
                io.unobserve(entry.target);
            });
        }, { threshold: 0.08 });

        cards.forEach(function (card) { io.observe(card); });

        /* ── Directions button → open Google Maps ────────────────── */
        wrapper.querySelectorAll('.bkbg-lc-btn-directions[data-address]').forEach(function (btn) {
            btn.addEventListener('click', function () {
                var addr = btn.getAttribute('data-address');
                if (!addr) return;
                window.open('https://www.google.com/maps/search/' + encodeURIComponent(addr), '_blank', 'noopener');
            });
        });
    });
})();

```
