Pixmap Void Page

watch the remaining time on the pixmap.fun/void page

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Pixmap Void Page
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  watch the remaining time on the pixmap.fun/void page
// @author       Iranpix
// @match        https://pixmap.fun/void
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var a = 0
    var min = 0
    var titlemin = 0
    var time = new Date()
    var voidtime = new Date(document.body.innerText.slice(18))
    var whenvoid = ""

    function gwhenvoid() {
        time = new Date()
        if ((voidtime.getTime() - time.getTime()) <= 0) {
            whenvoid = "NOW"
            const d = Date.parse(voidtime)-Date.parse(new Date());
            const minutes = Math.floor((d / 1000 / 60) % 60);
            min = minutes
            if (min != titlemin) {
                titlemin = min
                document.title = "Void time"
            }
            if (minutes <= -65)
                location.reload()
        }
        else {
            const total = Date.parse(voidtime) - Date.parse(new Date());
            const seconds = Math.floor((total / 1000) % 60);
            const minutes = Math.floor((total / 1000 / 60) % 60);
            const hours = Math.floor((total / (1000 * 60 * 60)) % 24);
            min = minutes
            whenvoid = `${hours}:${minutes}:${seconds}`
            if (titlemin != min) {
                titlemin = min
                if (hours > 0 && titlemin != min)
                    document.title = "One hour left"
                else if (min == 1)
                    document.title = `One minute left`
                    else
                        document.title = `${min} minutes left`
            }
        }
        if (a != 0)
            document.getElementById("box").innerHTML =
                `
    <span>when void</span>
    <span style="font-size: 150%; margin-bottom: 1rem">${whenvoid}</span>
    <span>Now: ${time.toUTCString()}</span>
    <span>Next void at ${voidtime.toUTCString()}</span>
    `
            a += 1
        setTimeout(() => { gwhenvoid() }, 1000)
    }
    gwhenvoid()
    document.body.innerHTML =
        `
  <div
  style="
      position: aboslute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: grid;
      align-items: center;
      justify-content: center;
      background: black;
      color: white;
      font-family: system-ui
  ">
  <div style="display: grid;text-align:center" id="box">
  <span>when void</span>
  <span style="font-size: 150%; margin-bottom: 1rem">${whenvoid}</span>
  <span>Now: ${time.toUTCString()}</span>
  <span>Next void at ${voidtime.toUTCString()}</span>
  </div>
  </div>
  <a
  style="position: absolute; bottom: 20; color: #007AFF; font-family: system-ui; text-align: center; width: 100%"
  target="blank" href="https://dsc.gg/iranpix">dsc.gg/iranpix</a>
  `
})();