Greasy Fork is available in English.

overlay2078

Turn the hole screen black till hovermouse

이 스크립트는 직접 설치해서 쓰는 게 아닙니다. 다른 스크립트가 메타 명령 // @require https://update.greasyfork.org/scripts/491238/1352698/overlay2078.js(으)로 포함하여 쓰는 라이브러리입니다.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
document.addEventListener('DOMContentLoaded', function () {
    const overlay = document.createElement('div');
    overlay.classList.add('overlay');
    document.body.appendChild(overlay);

    overlay.style.position = 'absolute';
    overlay.style.top = '-10vh';
    overlay.style.left = '-10vw';
    overlay.style.width = '120vw';
    overlay.style.height = '420vh';
    overlay.style.backgroundColor = 'black';
    overlay.style.zIndex = '400';

    document.body.addEventListener('mouseover', function () {
        if (overlay) {
            overlay.style.display = 'none';
        }
    });
    document.addEventListener('touchstart', function () {
        if (overlay) {
            overlay.style.display = 'none';
        }
    });
    document.addEventListener('mouseleave', function () {
        if (overlay) {
            overlay.style.display = 'none';
        }
    });
});