Current Local Date

Shows current date in a slim overlay

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Current Local Date
// @version      1.5
// @description  Shows current date in a slim overlay
// @author       You
// @match        *://deadshot.io/*
// @grant        none
// @license MIT
// @namespace https://greasyfork.org/users/1527574
// ==/UserScript==

(function() {
    'use strict';


    const overlayStyle = `
    #metricOverlay {
        position: fixed;
        top: 7px;  /* 7 pixels from top */
        left: 7px; /* 7 pixels from left */
        background: rgba(0, 0, 0, 0.6);
        padding: 7px 12px;
        border-radius: 6px;
        color: #fff;
        border: 2px solid #fff;  /* White border */
        z-index: 100000;
        font-size: 15px;
        white-space: nowrap;
        display: flex;
        flex-direction: column;
        visibility: hidden; /* Start hidden */
    }`;

    const styleElement = document.createElement("style");
    styleElement.type = "text/css";
    styleElement.innerText = overlayStyle;
    document.head.appendChild(styleElement);

    const metricOverlay = document.createElement('div');
    metricOverlay.id = 'metricOverlay';
    metricOverlay.innerText = 'Initializing metrics...';
    document.body.appendChild(metricOverlay);


    setInterval(() => {
        const currentDate = new Date().toLocaleDateString();
        metricOverlay.innerHTML = `Date: ${currentDate}`;

        // Make the overlay visible after the first update
        metricOverlay.style.visibility = 'visible';
    }, 1800000);

    // Run the update immediately on load
    const initialDate = new Date().toLocaleDateString();
    metricOverlay.innerHTML = `Date: ${initialDate}`;
    metricOverlay.style.visibility = 'visible';

})();