HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/slfopp7cb1df/www/shaneconrad.me/wp-content/plugins/embedpress/assets/js/gallery-justify.js
(function(){
    function justifyGallery() {
        const justify_scale = screen.height * 0.2;
        let items = document.querySelectorAll('.photos-gallery-justify .photo-item');

        items.forEach(item => {
            let image = item.querySelector('img');
            if (!image) return;

            function adjustItem() {
                let ratio = image.naturalWidth / image.naturalHeight;
                item.style.width = justify_scale * ratio + 'px';
                item.style.flexGrow = ratio;
            }

            if (image.complete) {
                adjustItem();
            } else {
                image.onload = adjustItem;
            }
        });
    }

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


    window.addEventListener('load', justifyGallery);
})();