/*
 * Generated JS for @Karl Müller Banzhaf's profile on Hjonker
 * Generated on 2025-10-21 08:04:28
 *
 * Thanks to @captbaritone on GitHub!
 */


$().ready(function() {    
    const webamp = new Webamp({
        initialTracks: [
            {
                metaData: {
                    artist: "Karl Müller Banzhaf",
                    title: "phpqIKrQf"
                },
                url: "https://hjonk.me/cdn/song/Deathcat347?d=1761027543",
            }
        ],
        windowLayout: {
            main: {
            position: { top: 0, left: 0 },
            shadeMode: false,
            closed: false,
            },
            equalizer: {
            position: { top: 0, left: 0 },
            shadeMode: true,
            closed: true,
            },
            playlist: {
            position: { top: 0, left: 0 },
            shadeMode: true,
            // Number of additional sprites by which to expand the window.
            size: { extraHeight: 1, extraHeight: 10 },
            closed: true,
            },
        },
        enableHotkeys: false,        initialSkin: {
            url: "https://hjonk.me/cdn/skin/Deathcat347?d=1761027543",
        },
    });

    function waitForSelector(selector, callback, interval = 100) {
        const checkExist = setInterval(() => {
            if ($(selector).length) {
                clearInterval(checkExist);
                callback($(selector));
            }
        }, interval);
    }

    const app = document.getElementById("app")
    webamp.renderWhenReady(app).then(() => {
        waitForSelector(".selected.draggable", (element) => {
            console.log(element);
            // HACK
            // after allat profile webamp should be first
            $("#webamp").addClass("should-not-remove")
            $(element).removeClass("draggable");
        });
    });
})
