Inactive Screen - Shigure

Display Shiguri after "?" seconds of inactivity

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Inactive Screen - Shigure
// @namespace    inactivescreenshigure
// @version      1.0
// @description  Display Shiguri after "?" seconds of inactivity
// @author       Who cares
// @license      GPLv3
// @match        *://*/*
// @exclude      *://example.com/* // Add url
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    let idleTimer;
    const idleTime = 90000; // Set time, 90000 = 90 seconds

    function startIdleTimer() {
        idleTimer = setTimeout(() => {
            showGif();
        }, idleTime);
    }

    function resetIdleTimer() {
        clearTimeout(idleTimer);
        startIdleTimer();
    }

    function showGif() {
        const gifOverlay = document.createElement('div');
        gifOverlay.id = 'gif-overlay';
        document.body.appendChild(gifOverlay);
    }

    function removeGif() {
        const gifOverlay = document.getElementById('gif-overlay');
        if (gifOverlay) {
            gifOverlay.remove();
            resetIdleTimer();
        }
    }

    GM_addStyle(`
        #gif-overlay {
            position: fixed;
            bottom: 25px;
            right: 25px;
            width: 160px;
            height: 210px;
            background-image: url('https://i.ibb.co/0jZDGqD/shigure.gif');
            background-repeat: no-repeat;
            filter: blur(0px);
            z-index: 9999;
        }
    `);

    document.addEventListener('mousemove', removeGif);
    document.addEventListener('keypress', removeGif);

    startIdleTimer();
})();