您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
every 10 secs it tells you, visually
当前为
// ==UserScript== // @name magic firefly event time thing // @namespace http://tampermonkey.net/ // @version 2.0.5 // @description every 10 secs it tells you, visually // @author Kosuken // @match https://florr.io/* // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; // Add a draggable timer display to the screen const timerBox = document.createElement('div'); timerBox.id = 'mff-timer'; timerBox.style.position = 'fixed'; timerBox.style.top = '20px'; timerBox.style.left = '20px'; timerBox.style.padding = '10px'; timerBox.style.backgroundColor = 'rgba(30, 30, 30, 0.8)'; timerBox.style.color = 'white'; timerBox.style.fontFamily = '"Ubuntu", sans-serif'; timerBox.style.fontWeight = 'bold'; timerBox.style.border = '5px solid rgba(40, 40, 40, 0.8)'; timerBox.style.borderRadius = '8px'; timerBox.style.zIndex = '10000'; timerBox.style.cursor = 'move'; document.body.appendChild(timerBox); function updateTimer() { const intv = 4732; const startT = 1733449900; // next const Tnow = Math.floor(Date.now() / 1000); const nextT = startT + (Math.floor((Tnow - startT) / intv) + 1) * intv; // left const secsLeft = nextT - Tnow; const hours = Math.floor(secsLeft / 3600); const minutes = Math.floor((secsLeft % 3600) / 60); const seconds = secsLeft % 60; // text timerBox.innerHTML = ` <div>next magic fireflies: <br><strong>${new Date(nextT * 1000).toLocaleTimeString()}</strong></div> <div>time left: <br><strong>${hours}h ${minutes}m ${seconds}s</strong></div> `; } // update every sex setInterval(updateTimer, 1000); updateTimer(); // init // drag coz no drag gay timerBox.onmousedown = function (event) { event.preventDefault(); let shiftX = event.clientX - timerBox.getBoundingClientRect().left; let shiftY = event.clientY - timerBox.getBoundingClientRect().top; function moveAt(pageX, pageY) { timerBox.style.left = pageX - shiftX + 'px'; timerBox.style.top = pageY - shiftY + 'px'; } function onMouseMove(event) { moveAt(event.pageX, event.pageY); } document.addEventListener('mousemove', onMouseMove); timerBox.onmouseup = function () { document.removeEventListener('mousemove', onMouseMove); timerBox.onmouseup = null; }; }; timerBox.ondragstart = function () { return false; }; })();