bilibili-dark-theme

提供b站黑夜模式。(drak mode with bilibili.)

  1. // ==UserScript==
  2. // @name bilibili-dark-theme
  3. // @namespace Violentmonkey Scripts
  4. // @match https://www.bilibili.com/*
  5. // @match https://t.bilibili.com/*
  6. // @match https://search.bilibili.com/*
  7. // @match https://space.bilibili.com/*
  8. // @match https://live.bilibili.com/*
  9. // @run-at document-idle
  10. // @grant GM_addStyle
  11. // @version 1.2.3
  12. // @author mesimpler
  13. // @license MIT
  14. // @description 提供b站黑夜模式。(drak mode with bilibili.)
  15. // ==/UserScript==
  16.  
  17. GM_addStyle(`
  18. :root {
  19. color-scheme: dark;
  20.  
  21. --Lb5: #0087b7 !important;
  22. --Wh0: #242424 !important;
  23. --Ga0: #333333 !important;
  24. --Ga0_s: #333333 !important;
  25. --Ga1: #242424 !important;
  26. --Ga1_s: #333333 !important;
  27. --Ga2: #484848 !important;
  28. --Ga7: #a4a4a4 !important;
  29. --Ga10: #d1d1d1 !important;
  30. --Ga11: #333333 !important;
  31. --Ga12: #4a4a4a !important;
  32. --Ga13_s: #3d3e3e !important;
  33.  
  34. /* 回复框*/
  35. .reply-box-warp {
  36. border: 1px solid #626262 !important;
  37. }
  38.  
  39. /* 弹幕输入框 */
  40. .bpx-player-video-inputbar-wrap {
  41. background: #333333;
  42. }
  43. /* 标题栏阴影 */
  44. .mini-header {
  45. box-shadow: none;
  46. border-bottom: 1px solid #484848;
  47. }
  48. }
  49. `);
  50.  
  51. /* 动态 */
  52. if (
  53. location.href.startsWith("https://www.bilibili.com/opus/") ||
  54. location.href.startsWith("https://t.bilibili.com/")
  55. ) {
  56. // 移除背景图片
  57. const bg = document.querySelector(".bg");
  58. if (bg) {
  59. bg.remove();
  60. }
  61.  
  62. GM_addStyle(`
  63. :root {
  64. --Wh0: #333333 !important;
  65. --Ga0: #484848 !important;
  66. }
  67. /* 背景遮罩 */
  68. .bgc {
  69. background-color: var(--Ga1) !important;
  70. }
  71. /* 动态UP名字 */
  72. .bili-dyn-up-list__item__name {
  73. color: var(--Ga5) !important;
  74. }
  75.  
  76. /* 直播预约卡片 */
  77. .bili-dyn-card-reserve__card {
  78. background-color: var(--Ga0) !important;
  79. }
  80. /* 推荐视频商品卡片 */
  81. .bili-dyn-card-ugc__wrap,
  82. .bili-dyn-card-goods__wrap {
  83. background-color: var(--Ga1) !important;
  84. }
  85. `);
  86. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址