您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
07.02.2025, 11:21:16
当前为
// ==UserScript== // @name ВРЕМЯ // @namespace Violentmonkey Scripts // @match *://*/* // @grant none // @version 1.2 // @author DELFION // @license MIT // @description 07.02.2025, 11:21:16 // ==/UserScript== (function () { "use strict"; // Модуль времени const timeModule = (() => { const timeElement = document.createElement("div"); timeElement.classList.add("time-element"); const hoursSpan = document.createElement("span"); const minutesSpan = document.createElement("span"); const dayOfWeekSpan = document.createElement("span"); timeElement.append(hoursSpan, minutesSpan, dayOfWeekSpan); const style = document.createElement("style"); style.textContent = ` .time-element { position: fixed; bottom: 3px; left: 77px; padding: 3px; font-size: 34px; font-weight: bold; z-index: 1000; color: black; text-shadow: 1px 1px 2px white; } .time-element span { transition: color 1s ease; } `; document.head.appendChild(style); function updateDisplayTime() { const now = new Date(); const hours = now.getHours().toString().padStart(2, "0"); const minutes = now.getMinutes().toString().padStart(2, "0"); const dayOfWeek = new Intl.DateTimeFormat("ru-RU", { weekday: "short" }).format(now); const color = getRandomColor(); // ВАЖНО: Теперь обновляем цвет *после* создания элементов hoursSpan.textContent = `${hours}:`; minutesSpan.textContent = minutes; dayOfWeekSpan.textContent = dayOfWeek; hoursSpan.style.color = color; minutesSpan.style.color = color; } function getRandomColor() { return `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, '0')}`; } function init() { document.body.appendChild(timeElement); console.log("Time module initialized:", timeElement); updateDisplayTime(); setInterval(updateDisplayTime, 3000); } return { init }; })(); timeModule.init(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址