您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Changes website theme to a dark
// ==UserScript== // @name Dark Theme for Aboard // @namespace https://alexandrosmagos.com/ // @version 1.1 // @description Changes website theme to a dark // @author Alexandros Magos // @match https://aboard.iee.ihu.gr/* // @grant GM_getResourceURL // @resource discordStyle https://raw.githubusercontent.com/alexandrosmagos/Aboard-Darkmode-Script/main/styles/discord.css // @resource bubblegumStyle https://raw.githubusercontent.com/alexandrosmagos/Aboard-Darkmode-Script/main/styles/bubblegum.css // ==/UserScript== (function () { var style = document.createElement("link"); style.rel = "stylesheet"; style.type = "text/css"; var savedTheme = localStorage.getItem("theme"); var themeDropdownMenu = document.createElement("div"); themeDropdownMenu.classList.add("navbar-dropdown"); themeDropdownMenu.addEventListener("click", function (event) { if (event.target.tagName === "A") { var selectedTheme = event.target.innerText; switch (selectedTheme) { case "Discord": localStorage.setItem("theme", "discord"); style.href = GM_getResourceURL("discordStyle"); break; case "Bubblegum": localStorage.setItem("theme", "bubblegum"); style.href = GM_getResourceURL("bubblegumStyle"); break; default: localStorage.removeItem("theme"); style.href = ""; break; } //location.reload(); } }); addTheme("Discord"); addTheme("Bubblegum"); addTheme("Original"); var themeDropdown = document.createElement("div"); themeDropdown.classList.add("navbar-item", "has-dropdown", "is-hoverable"); var themeDropdownTrigger = document.createElement("a"); themeDropdownTrigger.classList.add("navbar-link"); themeDropdownTrigger.innerHTML = `<span class="icon"><i class="fas fa-solid fa-palette"></i></span>`; themeDropdown.appendChild(themeDropdownTrigger); themeDropdown.appendChild(themeDropdownMenu); var navbarEnd = document.querySelector(".navbar-end"); navbarEnd.appendChild(themeDropdown); if (savedTheme) { switch (savedTheme) { case "discord": style.href = GM_getResourceURL("discordStyle");; break; case "bubblegum": style.href = GM_getResourceURL("bubblegumStyle"); break; default: localStorage.removeItem("theme"); style.href = ""; break; } } document.head.appendChild(style); function addTheme(name) { var newOption = document.createElement("a"); newOption.classList.add("navbar-item"); newOption.innerText = name; themeDropdownMenu.appendChild(newOption); } })();