real time

Muestra la hora en la esquina superior derecha y la fecha abajo en Sploop.io con sombra

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         real time
// @namespace    http://tampermonkey.net/
// @version      1.4
// @license MIT 
// @description  Muestra la hora en la esquina superior derecha y la fecha abajo en Sploop.io con sombra
// @author       Tú
// @match        *://sploop.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Crea un elemento div para mostrar la hora
    var clockDiv = document.createElement('div');
    clockDiv.style.position = 'fixed';
    clockDiv.style.top = '249px'; // Ajusta la distancia desde arriba
    clockDiv.style.left = '5px'; // Ajusta la distancia desde la derecha
    clockDiv.style.color = 'white';
    clockDiv.style.fontSize = '31px'; // Tamaño grande de la fuente
    clockDiv.style.textShadow = '2px 2px 4px #000000'; // Añade sombra al texto
    clockDiv.style.zIndex = 1000;
    document.body.appendChild(clockDiv);

    // Crea un elemento div para mostrar la fecha
    var dateDiv = document.createElement('div');
    dateDiv.style.position = 'fixed';
    dateDiv.style.top = '699px'; // Ajusta la distancia desde arriba para el día
    dateDiv.style.left = '5px'; // Ajusta la distancia desde la derecha
    dateDiv.style.color = 'grey';
    dateDiv.style.fontSize = '24px'; // Tamaño de la fuente
    dateDiv.style.textShadow = '2px 2px 4px #000000'; // Añade sombra al texto
    dateDiv.style.zIndex = 1000;
    document.body.appendChild(dateDiv);

    // Función para actualizar la hora y la fecha
    function updateClock() {
        var now = new Date();
        var hours = now.getHours().toString().padStart(2, '0');
        var minutes = now.getMinutes().toString().padStart(2, '0');
        var seconds = now.getSeconds().toString().padStart(2, '0');
        clockDiv.textContent = `${hours}:${minutes}:${seconds}`;

        var options = { month: 'long' };
        var monthString = now.toLocaleDateString('es-ES', options);
        var day = now.getDate().toString().padStart(2, '0');
        var year = now.getFullYear().toString();

        dateDiv.innerHTML = `${monthString}<br>${day}<br>${year}`;
    }

    // Actualiza la hora y la fecha cada segundo
    setInterval(updateClock, 1000);
    updateClock();
})();