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

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

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

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

    /* Gradient section – IntersectionObserver content entrance */
    document.querySelectorAll('.bkbg-gs-wrapper').forEach(function (wrapper) {
        var inner = wrapper.querySelector('.bkbg-gs-inner');
        if (!inner || !('IntersectionObserver' in window)) return;

        /* Animate content in when section enters viewport */
        var children = inner.children;
        Array.prototype.forEach.call(children, function (child) {
            child.style.opacity = '0';
            child.style.transform = 'translateY(22px)';
            child.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
        });

        var io = new IntersectionObserver(function (entries) {
            entries.forEach(function (entry) {
                if (!entry.isIntersecting) return;
                Array.prototype.forEach.call(children, function (child, i) {
                    setTimeout(function () {
                        child.style.opacity = '1';
                        child.style.transform = 'translateY(0)';
                    }, i * 100);
                });
                io.unobserve(wrapper);
            });
        }, { threshold: 0.15 });

        io.observe(wrapper);
    });
})();

```
