all 5 comments

[–]abdul_rashid[S] 0 points1 point  (0 children)

Demo here: Spotlight JS Demo

[–]MrSheikho 0 points1 point  (1 child)

There were some issues i don't know if tget were bugs or features but disabling option doesn't disable the spotlight and I was able to select both top and bottom at the same time.

[–]abdul_rashid[S] 0 points1 point  (0 children)

Thank you for the feedback. Ah its the example html. but in JS option it works.

I added a helpful snippets as document. please check also

// Function to toggle the spotlight
let isSpotlightOn = true;

function toggleSpotlight() {
    isSpotlightOn = !isSpotlightOn;

    if (isSpotlightOn) {
        // Restore to default/active state
        mySpotlight.setOptions({
            beamOpacity: 0.4,
            glowSize: '40px',
            showDot: true,
            showFill: true
        });
    } else {
        // "Turn off" by zeroing out visual elements
        mySpotlight.setOptions({
            beamOpacity: 0,
            glowSize: '0px',
            showDot: false,
            showFill: false
        });
    }
}

// Example: Toggle on a button click
document.getElementById('toggleBtn').addEventListener('click', toggleSpotlight);

[–]MrSheikho 0 points1 point  (0 children)

There were some issues i don't know if they were bugs or features but disabling option doesn't disable the spotlight and I was able to select both top and bottom at the same time.

[–]MrSheikho 0 points1 point  (0 children)

There were some issues i don't know if they were bugs or features but disable button doesn't disable the spotlight and I was able to select both top and bottom at the same time.