Linux Do Authorize Dark Mode

为 Linux Do 授权页面添加黑暗模式开关

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Autor
black-zero358
Instalări zilnice
0
Total instalări
0
Rating-uri
0 0 0
Versiune
1.1
Creat
19-01-2026
Actualizat
19-01-2026
Size
3,6 KB
Licență
AGPLv3
Se aplică pe

Linux Do Authorize Dark Mode (授权页黑暗模式)

为 Linux Do 的 OAuth2 授权页面添加一个优雅的黑暗模式开关,保护你的眼睛。

📖 简介 | Introduction

在使用 Linux Do 账号登录第三方服务(如导航站、Discourse 论坛等)时,授权页面默认是明亮的白色背景。如果你习惯在夜间通过 Linux Do 进行认证,这个跳转页面的亮度可能会有些刺眼。

这个脚本会在授权页面的右上角添加一个悬浮的“🌓”切换按钮,点击即可一键开启或关闭黑暗模式。

✨ 功能特性 | Features

  • 一键切换:在页面右上角添加悬浮按钮,随时切换日间/夜间模式。
  • 自动记忆:脚本会自动保存你的偏好设置(使用 localStorage)。如果你开启了黑暗模式,下次进入授权页面时会自动应用,无需重复点击。
  • 深度适配:不是简单的颜色反转,而是针对页面的 Tailwind CSS 样式进行了专门的色彩微调:
  • 背景调整为深灰色 (#111827),减少蓝光。
  • 卡片背景调整为稍亮的深灰色,保持层次感。
  • 文字颜色调整为柔和的灰白色,保证可读性。
  • 链接颜色调整为更适合深色背景的亮蓝色。

  • 轻量级:纯原生 JavaScript 编写,无第三方库依赖,加载速度极快。

🛠️ 使用方法 | How to use

  1. 安装 Tampermonkey (油猴) 扩展。
  2. 点击上方的 安装此脚本 按钮。
  3. 访问任何 Linux Do 的 OAuth 授权链接(例如登录 Linux Do 导航站时)。
  4. 点击页面右上角的 🌓 按钮即可切换模式。

⚙️ 技术说明 | Technical Info

  • 匹配域名https://connect.linux.do/oauth2/authorize*
  • 存储方式:使用浏览器的 LocalStorage 存储 linuxdo_dark_mode 字段。
  • 样式注入:使用 GM_addStyle 动态注入 CSS,通过 !important 覆盖原有 Tailwind 类名。