您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Awesome/Summer Games Done Quick schedule in 24-hour time format with current game highlighting
当前为
// ==UserScript== // @name Games Done 24/7 // @version 2.0.20220112 // @description Awesome/Summer Games Done Quick schedule in 24-hour time format with current game highlighting // @namespace raina // @match https://gamesdonequick.com/schedule // @grant none // @license GPLv3 // ==/UserScript== $(document).ready(function() { $('.start-time').each(function() { let time = $(this).html(); if (/PM$/.test(time)) { time = time.replace(/^\d+/, function(match) { match = parseInt(match, 10); return match < 12 ? match + 12 : 12; }); } time = time.replace(/^12(?=\:\d\d AM)/, "0"); $(this).html(time.slice(0, -3)); }); const currentDate = new Date(); const months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ]; let daySplits = document.querySelectorAll(`tr.day-split`); days = [].filter.call(daySplits, el => { if (1 < el.children.length) return false; let month = months.findIndex(mo => new RegExp(mo).test(el.children[0].textContent)); if (0 > month) return false; let day; if (!(day = el.children[0].textContent.match(/\d+/))) return false; month = ("0" + month).slice(-2); day = ("0" + day[0]).slice(-2); dateStr = `${month}-${day}`; el.dataset.date = dateStr; return true; }); const gdqDaySelector = `tr.day-split[data-date="${("0" + currentDate.getMonth()).slice(-2)}-${("0" + currentDate.getDate()).slice(-2)}"]`; const gdqDay = document.querySelector(gdqDaySelector); if (!gdqDay) return console.log(`Games Done Quick doesn't seem to be running currently.`); let current; let upcoming = document.querySelectorAll(`${gdqDaySelector} ~ tr .start-time`); days = [].find.call(upcoming, el => { if ("undefined" == typeof current) current = el; startTime = new Date(); try { startHour = el.textContent.match(/\d\d?(?=:)/)[0]; startMinute = el.textContent.match(/(?<=:)\d\d/)[0]; startTime.setHours(startHour, startMinute, 0); } catch (ex) { return false; } el.dataset.start = startTime; // hit a start time in the future, stop iterating if (startTime >= currentDate) return true; // set current game, continue iterating current = el; return false; }); if (current) { current = current.parentElement; current.style.backgroundColor = "#cf8"; current.nextElementSibling.style.backgroundColor = "#cf8"; current.style.scrollMarginTop = "128px"; current.id = "current"; location.hash = "current"; } });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址