您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在网页右上角显示当前时间和日期
当前为
// ==UserScript== // @name 网页小时钟 // @namespace https://weirick.github.io // @version 1.2.0.0 // @description 在网页右上角显示当前时间和日期 // @author RCWei // @license GPL-3.0 // @match *://*/* // @run-at document-end // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @grant GM_registerMenuCommand // ==/UserScript== const now = new Date(); let clockHTML = '<div id="clock" style="position:fixed;top:1vw;right:8vh;display:flex;justify-content:center;font-weight:bold;align-items:center;-webkit-text-stroke:1px rgba(255,255,255,.8);font-size:4vh;color:rgba(70,130,180,.7);pointer-events:none;z-index:999999999"></div>'; let timeBox = document.createElement('div'); timeBox.innerHTML = clockHTML; $('html').append(timeBox); let dateHtml = '<div id="date" style="position:fixed;top:3vw;right:8vh;display:flex;justify-content:center;align-items:center;font-size:2vh;color:rgba(40,55,71,.6);pointer-events:none;z-index:999999999"></div>'; let dateBox = document.createElement('div'); dateBox.innerHTML = dateHtml; timeBox.appendChild(dateBox); setInterval(() => { let hour = now.getHours(), minute = now.getMinutes(); if (hour < 10) hour = '0' + hour; if (minute < 10) minute = '0' + minute; $('#clock').text(hour + ":" + minute) ; let year = now.getFullYear(), month = now.getMonth(), date = now.getDate(); if (month < 10) month = '0' + month; if (date < 10) date = '0' + date; $('#date').text(month + '.' + date + '.' + year); }, 1000); // 选项菜单 GM_registerMenuCommand("设置选项", () => { alert('该功能正在开发中,欢迎提出建议及意见!'); });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址