Google Classroom - Moonlight

Custom theme for Google Classroom

目前为 2021-05-13 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Google Classroom - Moonlight
  3. // @namespace Violentmonkey Scripts
  4. // @match https://classroom.google.com/*
  5. // @grant none
  6. // @version 1.0
  7. // @author Risuleia
  8. // @require https://code.jquery.com/jquery-3.6.0.min.js
  9. // @description Custom theme for Google Classroom
  10. // ==/UserScript==
  11.  
  12. // ============ START ============ //
  13. (function() {
  14. 'use strict';
  15.  
  16. var style = `
  17. /* custom fonts */
  18. @import url('https://fonts.googleapis.com/css2?family=Caveat&display=swap');
  19.  
  20. /* background (change the URL inside quotes to add your own background*/
  21. body {
  22. background: rgba(21,31,46,0.8) url("https://i.imgur.com/LHj4Gil.jpg") center/100% fixed;
  23. background-repeat: no-repeat;
  24. background-size: cover;
  25. }
  26.  
  27. /* global setting */
  28. * {
  29. font-family: Caveat;
  30. color: #fff !important;
  31. }
  32. * {
  33. border-color: rgba(21,31,46,0.8);
  34. }
  35. * {
  36. box-shadow: none !important;
  37. }
  38. /* scrollbar */
  39. ::-webkit-scrollbar {
  40. background: transparent;
  41. width: 5px;
  42. }
  43. ::-webkit-scrollbar-corner {
  44. background: transparent;
  45. }
  46. ::-webkit-scrollbar-track {
  47. background: transparent;
  48. }
  49. ::-webkit-scrollbar-thumb {
  50. background: linear-gradient(180deg, rgba(6,171,255,1) 5%, rgba(102,0,204,1) 97%);
  51. -webkit-border-radius: 1ex;
  52. }
  53.  
  54. /* Annoucement box */
  55. .hgjBDc {
  56. background: rgba(21,31,46,0.8);
  57. }
  58. .vnnr5e .I9OJHe, .vnnr5e .CIy9F {
  59. background: rgba(21,31,46,0.8);
  60. }
  61. .vnnr5e:not(.RDPZE):hover .I9OJHe, .vnnr5e:not(.RDPZE):hover .CIy9F {
  62. background: rgba(21,31,46,0.8);
  63. }
  64. .qk0lee:focus {
  65. background: rgba(21,31,46,0.8);
  66. color: #fff;
  67. }
  68. .Erb9le:not(.RDPZE) .qmMNRc:hover {
  69. color: #fff;
  70. }
  71. .rxO3db {
  72. background: rgba(21,31,46,0.8);
  73. }
  74. .e19J0b, .Y5sE8d:not(.RDPZE) {
  75. background: rgba(21,31,46,0.8);
  76. }
  77. .l4V7wb {
  78. color: #fff;
  79. background: rgba(21,31,46,0.8);
  80. border: 1px solid #4c4c4c;
  81. border-radius: 4px;
  82. }
  83. .T2Ybvb.KRoqRc.editable {
  84. font-size: 1.5rem;
  85. }
  86. .Erb9le:not(.RDPZE) .qmMNRc.y7OZL .DPvwYc {
  87. background-image: linear-gradient(to right, #06abff 5%, #6600CC 97%) !important;
  88. -webkit-background-clip: text !important;
  89. -webkit-text-fill-color: transparent !important;
  90. }
  91. .Y5sE8d:not(.RDPZE) .snByac {
  92. font-size: 1.05rem;
  93. background-image: linear-gradient(to right, #06abff 5%, #6600CC 97%) !important;
  94. -webkit-background-clip: text !important;
  95. -webkit-text-fill-color: transparent !important;
  96. }
  97. .Erb9le:not(.RDPZE) .qmMNRc.y7OZL {
  98. background: rgba(21,31,46,0.8) !important;
  99. }
  100. .Y5sE8d:not(.RDPZE) {
  101. background: rgba(21,31,46,0.8) !important;
  102. }
  103. .hVNH5c .K0NPx {
  104. background: rgba(21,31,46,0.8) !important;
  105. }
  106. .FtBNWb {
  107. background: rgba(21,31,46,0.8) !important;
  108. }
  109. .I7OXgf.ZEeHrd {
  110. background: rgba(21,31,46,0.8) !important;
  111. }
  112. .picker-dialog.XKSfm-Sx9Kwc {
  113. background: rgba(21,31,46,0.8) !important;
  114. }
  115. .jfvobd {
  116. color: #ffffff !important;
  117. }
  118. .GWh4Ge .kx3Hed {
  119. color: #ffffff !important;
  120. }
  121.  
  122. /* top navbar */
  123. .Hwv4mb, .xHPsid .hN1OOc {
  124. font-family: Caveat;
  125. font-size: 2rem;
  126. }
  127. .DShyMc-MTA5NzA3NjA1MzQy .eumXzf:after {
  128. -webkit-border-image: linear-gradient(to right, #06abff 5%, #6600CC 97%);
  129. border-image-slice: 9;
  130. }
  131. .DShyMc-MTA5NzA3NjA1MzQy .VnOHwf-Tvm9db {
  132. background-image: linear-gradient(to right, #06abff 5%, #6600CC 97%);
  133. -webkit-background-clip: text;
  134. -webkit-text-fill-color: transparent;
  135. }
  136. .VnOHwf-Tvm9db {
  137. background-image: linear-gradient(to right, #06abff 5%, #6600CC 97%);
  138. -webkit-background-clip: text;
  139. -webkit-text-fill-color: transparent;
  140. }
  141. .VnOHwf-Tvm9db {
  142. background-image: linear-gradient(to right, #06abff 5%, #6600CC 97%);
  143. -webkit-background-clip: text;
  144. -webkit-text-fill-color: transparent;
  145. }
  146. .VnOHwf-Tvm9db {
  147. background-image: linear-gradient(to right, #06abff 5%, #6600CC 97%);
  148. -webkit-background-clip: text;
  149. -webkit-text-fill-color: transparent;
  150. }
  151. .eumXzf:after {
  152. -webkit-border-image: linear-gradient(to right, #06abff 5%, #6600CC 97%);
  153. border-image-slice: 9;
  154. }
  155.  
  156. /* loading gradient */
  157. .DShyMc-AaTFfe .bFjUmb-Ysl7Fe.kRqvHe {
  158. background: linear-gradient(to right, #06abff 5%, #6600CC 97%) !important;
  159. }
  160. .aP3ZPb.kRqvHe.bFjUmb-Ysl7Fe {
  161. background: linear-gradient(to right, #06abff 5%, #6600CC 97%) !important;
  162. }
  163. .bFjUmb-Wvd9Cc:not(.O1l69):not(.J1HJOd):not(.TIunU) {
  164. background: linear-gradient(to right, #06abff 5%, #6600CC 97%) !important;
  165. }
  166. .aP3ZPb {
  167. background: linear-gradient(to right, #06abff 5%, #6600CC 97%) !important;
  168. }
  169.  
  170. /* font fix */
  171. /* class details */
  172. .uTUgB, .csjh4b {
  173. font-family: Caveat;
  174. }
  175. .csjh4b {
  176. font-size: 1.78rem;
  177. }
  178. / "upcoming" /
  179. .EZrbnd .sxa9Pc {
  180. font-family: Caveat;
  181. }
  182. /* member names */
  183. .asQXV {
  184. font-family: Caveat;
  185. font-size: 1.2rem;
  186. }
  187. /* attachments */
  188. .QDKOcc {
  189. font-family: Caveat;
  190. font-size: 1.1rem;
  191. }
  192. /* due work alert */
  193. .sdDCme {
  194. font-size: 1.12rem;
  195. }
  196. .VBEdtc-Wvd9Cc:hover {
  197. color: #fff;
  198. font-size: 1rem;
  199. }
  200. /* default announement text */
  201. .K6Ovqd {
  202. font-size: 1.5rem:
  203. }
  204. /* semi-global text */
  205. .EZrbnd {
  206. font-family: Caveat;
  207. }
  208. /* announement content */
  209. .obylVb:not(:empty) {
  210. font-size: 1.2rem;
  211. }
  212. /* comments content */
  213. .tLDEHd {
  214. font-size: 1.2rem
  215. }
  216. /* topic names */
  217. .PazDv {
  218. font-family: Caveat;
  219. font-size: 2.5rem;
  220. }
  221. /* people list */
  222. .XjYjO {
  223. font-family: Caveat;
  224. font-size: 2.5rem;
  225. }
  226. /* class name */
  227. .YVvGBb {
  228. font-family: Caveat;
  229. }
  230. .A6dC2c {
  231. font-size: 1.15rem;
  232. }
  233. .dDKhVc {
  234. font-size: 1rem;
  235. }
  236. .tLDEHd {
  237. font-family: Caveat;
  238. }
  239. /* materials, questions, assignments, etc */
  240. .tL9Q4c {
  241. font-family: Caveat;
  242. font-size: 1.5rem;
  243. }
  244. .NE9bBb {
  245. color: #fff !important;
  246. }
  247. /* gradebook */
  248. .VnOHwf-Tvm9db {
  249. font-family: Caveat;
  250. }
  251. .EhRlC {
  252. font-size: 1.5rem !important;
  253. color: #1e8e3e !important;
  254. }
  255. .lYU7F {
  256. font-size: 1.5rem !important;
  257. color: #c5221f !important;
  258. }
  259. .ppMo6b {
  260. font-size: 1.3rem;
  261. color: #b3d3ec !important;
  262. }
  263. /* account panel */
  264. .gb_1b {
  265. color: #fff;
  266. }
  267. .gb_wb.gb_wb {
  268. color: #fff;
  269. }
  270. .gb_l .gb_mb {
  271. color: #fff;
  272. }
  273. .gb_sb.gb_sb {
  274. color: #fff;
  275. }
  276. .gb_wb.gb_wb {
  277. color: #fff;
  278. }
  279. /* Logo */
  280. .s7ovNb {
  281. visibility: hidden;
  282. overflow: visible;
  283. }
  284. .s7ovNb::after {
  285. line-height: 3rem;
  286. overflow: visible;
  287. visibility: visible;
  288. position: absolute;
  289. top: 7px;
  290. left: 1.2em;
  291. content: 'Google Classroom';
  292. font-family: Caveat;
  293. font-size: 2.8rem;
  294. background-image: linear-gradient(to right, #06abff 5%, #6600CC 97%);
  295. -webkit-background-clip: text;
  296. -webkit-text-fill-color: transparent;
  297. }
  298. .XIpEib {
  299. overflow: visible;
  300. }
  301.  
  302. /* scheduled */
  303. .VBEdtc-Wvd9Cc:hover {
  304. font-size: 1.5rem !important;
  305. }
  306. .IMvYId, .IMvYId:visited {
  307. font-size: 1.05rem;
  308. }
  309. .DShyMc-MzI2OTAxNzI5NjYw .tUJKGd:not(.xp2dJ):not(.rZXyy):hover.idtp4e {
  310. background: rgba(21,31,46,0.8);
  311. }
  312. .p0oLxb>.bnqxkd {
  313. background: rgba(21,31,46,0.8);
  314. }
  315. .QkA63b .GJYBjd {
  316. background: rgba(21,31,46,0.8);
  317. }
  318. .DShyMc-MzI2OTAxNzI5NjYw.bFjUmb-Ysl7Fe, .DShyMc-MzI2OTAxNzI5NjYw .bFjUmb-Ysl7Fe, .DShyMc-MzI2OTAxNzI5NjYw .VUoKZ {
  319. background: rgba(21,31,46,0.8) !important;
  320. }
  321. .y2d25 {
  322. background: rgba(21,31,46,0.9);
  323. }
  324. .dKKcxf, .RPt7lf.miHM0e>.NE9bBb {
  325. background: rgba(21,31,46,0.8);
  326. }
  327. .GJYBjd:not(.CeoRYc) {
  328. background: rgba(21,31,46,0.9) !important;
  329. }
  330. .p0oLxb {
  331. background: rgba(21,31,46,0.9) !important;
  332. }
  333. /* transitions */
  334. .qk0lee:hover, .GWZ7yf:hover, .Aopndd:hover, .d4Fe0d:hover, .v9TZ3c:hover {
  335. transform: scale(1.05) !important;
  336. transition: transform 0.2s linear !important;
  337. }
  338. .ZoT1D:hover.idtp4e {
  339. background: rgba(21,31,46,0.8) !important;
  340. }
  341. .tUJKGd:hover .SFCE1b, .UISY8d-Ysl7Fe:not(.S6Vdac):hover, .OlXwxf.OlXwxf:hover {
  342. background: rgba(21,31,46,0.8) !important;
  343. transform: scale(1.05) !important;
  344. transition: transform 0.2s linear !important;
  345. }
  346. .GWZ7yf:focus-within {
  347. transform: scale(1.05) !important;
  348. tansition: transform: 0.2s linear !important;
  349. }
  350. .OlXwxf .SFCE1b:hover {
  351. background: rgba(21,31,46,0.8) !important;
  352. }
  353. .EmVfjc.qs41qe .xq3j6.ERcjC .X6jHbb {
  354. animation: spinner-left-spin 1333ms cubic-bezier(0.4,0.0,0.2,1) infinite both, loadingAnim 0.5s linear infinite both;
  355. }
  356. @keyframes loadingAnim{
  357. 0% {border-color: #06abff}
  358. 100% {border-color: #6600CC 97%}
  359. }
  360.  
  361. /* transition fix */
  362. .Sgw65b {
  363. overflow: visible;
  364. }
  365.  
  366. /* transparency */
  367. .gHz6xd {
  368. background: rgba(21,31,46,0.8);
  369. }
  370. .Aopndd {
  371. background: rgba(21,31,46,0.8);
  372. }
  373. .d4Fe0d {
  374. background: rgba(21,31,46,0.8);
  375. }
  376. .qk0lee {
  377. background: rgba(21,31,46,0.8);
  378. }
  379. .joJglb {
  380. background: rgba(21,31,46,0.8);
  381. }
  382. .GWZ7yf {
  383. background: rgba(21,31,46,0.8);
  384. }
  385. .IzVHde {
  386. background: rgba(21,31,46,0.8);
  387. }
  388. .OX4Vcb {
  389. background: rgba(21,31,46,0.8);
  390. opacity: 0.7;
  391. }
  392. .ETRkCe {
  393. background: rgba(21,31,46,0.8);
  394. }
  395. .Xzp3fc {
  396. background: rgba(21,31,46,0.8);
  397. border-radius: 8px;
  398. }
  399. .FpfvHe {
  400. background: rgba(21,31,46,0.8);
  401. border-radius: 8px;
  402. }
  403. .CJXzee {
  404. background: rgba(21,31,46,0.8);
  405. border-radius: 8px;
  406. }
  407. .CJXzee a.rUnD6d {
  408. background: rgba(21,31,46,0.8);
  409. border-radius: 8px;
  410. background-clip: padding-box;
  411. }
  412. .l3F1ye:not(.RDPZE) {
  413. background: rgba(21,31,46,0);
  414. border-radius: 8px;
  415. }
  416. .pEwOBc {
  417. background: rgba(21,31,46,0.8);
  418. border-radius: 8px;
  419. }
  420. .feojCc {
  421. background: rgba(21,31,46,0.8);
  422. }
  423. .Xi8cpb, a.Xi8cpb {
  424. background: rgba(21,31,46,0.8);
  425. }
  426. .tUJKGd:not(.xp2dJ).ndcsBf .idtp4e {
  427. background: rgba(21,31,46,0.8);
  428. }
  429. .DShyMc-MTA5NzA3NjA1MzQy .tUJKGd:not(.xp2dJ).ndcsBf .idtp4e {
  430. background: rgba(21,31,46,0.8);
  431. }
  432. .SS7JKe .qRUolc {
  433. background: rgba(21,31,46,0.8) !important;
  434. }
  435. .Shk6y {
  436. font-size: 1.5rem;
  437. background-image: linear-gradient(to right, #06abff 5%, #6600CC 97%);
  438. -webkit-background-clip: text;
  439. -webkit-text-fill-color: transparent;
  440. }
  441. .pn5mce .MQL3Ob, .a4Vkrf, .ybOdnf:not(.RDPZE).iWO5td, .jBmls {
  442. background: rgba(21,31,46,0.8) !important;
  443. }
  444. .ry3kXd {
  445. background: rgba(21,31,46,0.8) !important;
  446. }
  447. .e19J0b .CeoRYc {
  448. background: rgba(21,31,46,0.8) !important;
  449. }
  450. .CDELXb {
  451. background: rgba(21,31,46,0.8) !important;
  452. }
  453. .I5Bhjd {
  454. background: rgba(21,31,46,0.8) !important;
  455. }
  456. .cLpBac {
  457. background: rgba(21,31,46,0.8) !important;
  458. background-clip: padding-box !important;
  459. }
  460. .l4V7wb:not(.Fxmcue) {
  461. border: none !important;
  462. }
  463. .dKKcxf, .STMvPe {
  464. background: rgba(21,31,46,0.8) !important;
  465. }
  466. .ncFHed .MocG8c.KKjvXb, .OA0qNb .LMgvRb[aria-selected="true"], .tWfTvb [role="option"][aria-selected="true"] {
  467. background: rgba(21,31,46,0.8) !important;
  468. }
  469. .gb_l.gb_1a.gb_2a {
  470. background: rgba(21,31,46,0.8);
  471. }
  472. .x7zFFe table {
  473. background: rgba(21,31,46,0.8) !important;
  474. }
  475. .HMUCnd {
  476. background: rgba(21,31,46,0.8) !important;
  477. }
  478. .jgvuAb.iWO5td .ncFHed {
  479. background: rgba(21,31,46,0.8) !important;
  480. }
  481. .vUBwW .DPvwYc, .TGnLfc {
  482. color: white !important;
  483. }
  484. .DShyMc-MzI2ODk3OTk4MjE5 .mxmXhf {
  485. fill: #fff !important;
  486. }
  487. .tWfTvb, .XaepId, .NE9bBb, .aVeDNe .MQL3Ob {
  488. background: rgba(21,31,46,0.8) !important;
  489. }
  490. .JPdR6b.qjTEB {
  491. background: rgba(21,31,46,0.8) !important;
  492. }
  493. .fWf7qe .Yalane {
  494. background: rgba(21,31,46,0.8) !important;
  495. background-clip: padding-box !important;
  496. }
  497. .z80M1.FwR7Pc .jO7h3c {
  498. background-image: linear-gradient(to right, #06abff 5%, #6600CC 97%);
  499. -webkit-background-clip: text;
  500. -webkit-text-fill-color: transparent;
  501. }
  502. .z80M1.qs41qe .jO7h3c {
  503. background-image: linear-gradient(to right, #06abff 5%, #6600CC 97%);
  504. -webkit-background-clip: text;
  505. -webkit-text-fill-color: transparent;
  506. }
  507. .z80M1.FwR7Pc {
  508. background: rgba(21,31,46,0.8);
  509. }
  510. .FeRvI .oJeWuf {
  511. background: rgba(21,31,46,0.8);
  512. }
  513. .z80M1.qs41qe {
  514. background: rgba(21,31,46,0.8);
  515. }
  516. .xdKj9c, .Je07k, tbody .qwFLJb {
  517. background: rgba(21,31,46,0.5);
  518. }
  519. .YEeyed, .VUfVLb, thead .qwFLJb {
  520. background: rgba(21,31,46,0.8);
  521. }
  522. .xdKj9c.kTKNNc, .Je07k.kTKNNc, tbody .qwFLJb.kTKNNc {
  523. background: rgba(21,31,46,0.8);
  524. }
  525. .tUJKGd:not(.xp2dJ).ndcsBf .idtp4e {
  526. background: rgba(21,31,46,0.8);
  527. }
  528. .ypv4re {
  529. background: rgba(21,31,46,0.8);
  530. border-top-right-radius: 5px;
  531. border-top-left-radius: 5px;
  532. }
  533. .ypv4re::after {
  534. position: absolute;
  535. content: '';
  536. background: rgba(21,31,46,0.8);
  537. top: 80px;
  538. height: 15px;
  539. width: 758px;
  540. border: 1px solid transparent;
  541. }
  542. .j70YMc {
  543. background: rgba(21,31,46,0.8);
  544. border-bottom-left-radius: 5px;
  545. border-bottom-right-radius: 5px;
  546. }
  547. .gb_wb.gb_wb {
  548. background: rgba(21,31,46,0.8);
  549. }
  550. .gb_sb.gb_sb {
  551. background: rgba(21,31,46,0.8);
  552. }
  553. .gb_wb.gb_wb {
  554. background: rgba(21,31,46,0.8);
  555. }
  556. .gb_Db.gb_Db {
  557. background: rgba(21,31,46,0.8);
  558. }
  559. .gb_Nb>.gb_Mb:hover {
  560. background: rgba(21,31,46,0.4);
  561. }
  562.  
  563. /* borders fix */
  564. .joJglb, .BdCNc, .d4Fe0d .Aopndd {
  565. border-color: transparent !important;
  566. }
  567. .u73Apc, .uO32ac, .gQZxn, .ycbm1d, .s2g3Xd, .n4xnA, .d6CWTd, .tfGBod.tfGBod:not(.xp2dJ), .tfGBod.xp2dJ .jWCzBe, .tfGBod.xp2dJ .iobNdf, .PeGHgb.Q8U8uc .Ono85c+.oh9CFb, * {
  568. border-color: #4c4c4c !important;
  569. }
  570. .QkA63b .GJYBjd {
  571. border: 1px solid #4c4c4c !important;
  572. }
  573. `;
  574.  
  575. var elem = document.createElement('style');
  576. elem.type = 'text/css';
  577. elem.innerText = style;
  578. document.head.appendChild(elem);
  579. })();
  580.  
  581. // ============ END ============ //