Inactive Screen - Shigure

Display Shiguri after "?" seconds of inactivity

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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();
})();