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

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

    document.querySelectorAll('.bkbg-tc-wrapper').forEach(function (wrapper) {
        if (!('IntersectionObserver' in window)) return;

        var leftCol  = wrapper.querySelector('.bkbg-tc-col--left');
        var rightCol = wrapper.querySelector('.bkbg-tc-col--right');

        if (leftCol) {
            leftCol.style.opacity  = '0';
            leftCol.style.transform = 'translateX(-28px)';
            leftCol.style.transition = 'opacity 0.55s ease, transform 0.55s ease';
        }
        if (rightCol) {
            rightCol.style.opacity  = '0';
            rightCol.style.transform = 'translateX(28px)';
            rightCol.style.transition = 'opacity 0.55s ease 0.1s, transform 0.55s ease 0.1s';
        }

        var observed = false;
        var io = new IntersectionObserver(function (entries) {
            entries.forEach(function (entry) {
                if (!entry.isIntersecting || observed) return;
                observed = true;
                if (leftCol)  { leftCol.style.opacity = '1'; leftCol.style.transform = 'translateX(0)'; }
                if (rightCol) { rightCol.style.opacity = '1'; rightCol.style.transform = 'translateX(0)'; }
                io.disconnect();
            });
        }, { threshold: 0.1 });

        if (leftCol)  io.observe(leftCol);
        if (rightCol) io.observe(rightCol);
    });
})();

```
