Waze Editor Clock

Display a clock at the bottom center of Waze Editor page

目前為 2024-05-06 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Waze Editor Clock
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Display a clock at the bottom center of Waze Editor page
// @author       Your Name
// @match        https://www.waze.com/*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Create a clock element
    var clock = document.createElement('div');
    clock.style.position = 'fixed';
    clock.style.bottom = '27px'; // Adjust the position as needed
    clock.style.left = '50%';
    clock.style.transform = 'translateX(-50%)';
    clock.style.color = 'white';
    clock.style.fontSize = '40px';
    clock.style.fontFamily = 'Arial, sans-serif';
    clock.style.zIndex = '9999';

    // Function to update the clock
    function updateClock() {
        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();
        var timeString = ('0' + hours).slice(-2) + ':' + ('0' + minutes).slice(-2) + ':' + ('0' + seconds).slice(-2);
        clock.textContent = timeString;
    }

    // Initial update
    updateClock();

    // Update the clock every second
    setInterval(updateClock, 1000);

    // Append the clock to the document body
    document.body.appendChild(clock);
})();