# blockenberg/2.0.7/blocks/gradient-blob/frontend.js

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

- Page: https://pluginprobe.com/plugins/blockenberg/2.0.7/code/blocks/gradient-blob/frontend.js
- Raw: https://pluginprobe.com/plugins/blockenberg/2.0.7/raw/blocks/gradient-blob/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/gradient-blob/frontend.js#L10-L20`.

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

    function reducedMotion() {
        return window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    }

    function initBlob(section) {
        var speed  = parseFloat(section.dataset.speed) || 10;
        var paused = section.dataset.paused === 'true';

        if (reducedMotion()) {
            // CSS handles it via @media, but also set JS flag
            section.setAttribute('data-paused', 'true');
            return;
        }

        // Sync animation speed from data attribute to CSS custom property
        section.style.setProperty('--bkgb-speed', speed + 's');

        if (paused) {
            section.setAttribute('data-paused', 'true');
        }
    }

    function init() {
        document.querySelectorAll('.bkgb-section[data-speed]').forEach(initBlob);
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', init);
    } else {
        init();
    }

}());

```
