NXU储存库

用于储存“更好用的NXU”所需要的HTML、CSS等信息

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/469717/1215934/NXU%E5%82%A8%E5%AD%98%E5%BA%93.js

  1. const css_content = `
  2. :root {
  3. --dark: #34495e;
  4. --light: #fff;
  5. --success: #0abf30;
  6. --error: #e24d4c;
  7. --warning: #e9bd0c;
  8. --info: #3498db
  9. }
  10. #plugin-settings-main {
  11. display: flex;
  12. flex-direction: column;
  13. justify-content: center
  14. }
  15. #plugin-settings-main>div {
  16. border: 1px solid #e7e9eb;
  17. border-radius: 4px;
  18. width: 100%;
  19. display: flex;
  20. flex-direction: column;
  21. padding: 1em 2em;
  22. margin-bottom: 0.5em
  23. }
  24. #plugin-settings-main>div>div {
  25. width: 100%;
  26. display: flex;
  27. align-items: center
  28. }
  29. #plugin-settings-main .hr {
  30. width: 100%;
  31. background-color: #69c0ff;
  32. height: 2px
  33. }
  34. #plugin-settings-main .hr- {
  35. width: 100%;
  36. background-color: #e7e9eb;
  37. height: 1px
  38. }
  39. #plugin-settings-main h2 {
  40. font-size: 18px
  41. }
  42. #plugin-settings-main p {
  43. margin: 0;
  44. font-size: 16px
  45. }
  46. #plugin-settings-main input {
  47. margin: 0.5em 0.5em;
  48. padding: 0.5em 0.5em;
  49. border-radius: 4px;
  50. border: 1px solid black;
  51. background-color: none
  52. }
  53. #plugin-settings-main input:-webkit-autofill,
  54. textarea:-webkit-autofill,
  55. select:-webkit-autofill {
  56. -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
  57. background-color: transparent;
  58. background-image: none;
  59. transition: background-color 50000s ease-in-out 0s
  60. }
  61. #plugin-settings-main button {
  62. padding: 0.3em 1em;
  63. border: 2px solid #2881ff;
  64. background-color: #3a97fe;
  65. color: white;
  66. border-radius: 5px;
  67. width: max-content
  68. }
  69. #plugin-settings-main button:disabled {
  70. border: 2px solid #c5c7c8;
  71. background-color: #e7e9eb;
  72. color: black
  73. }
  74. #plugin-settings-main .button {
  75. justify-content: end
  76. }
  77. #plugin-settings-main .switch {
  78. display: flex
  79. }
  80. #plugin-settings-main .switch>p {
  81. flex-grow: 1
  82. }
  83. #plugin-settings-main .note {
  84. font-size: 14px;
  85. color: #8f8f8f;
  86. margin: 0
  87. }
  88. #plugin-settings-main .warning {
  89. font-size: 14px;
  90. color: red
  91. }
  92. #plugin-settings-main .flex-c {
  93. display: flex;
  94. flex-direction: column
  95. }
  96. #plugin-settings-main .flex {
  97. display: flex
  98. }
  99. #plugin-settings-main .flex-1 {
  100. flex-grow: 1
  101. }
  102. #plugin-settings-main div.switch {
  103. padding: 0.5em 0
  104. }
  105. #plugin-settings-main .switch {
  106. --button-width: 2.625em;
  107. --button-height: 1.5em;
  108. --toggle-diameter: 1.2em;
  109. --button-toggle-offset: calc((var(--button-height) - var(--toggle-diameter)) / 2);
  110. --toggle-shadow-offset: 10px;
  111. --toggle-wider: 2.4em;
  112. --color-grey: #cccccc;
  113. --color-green: #3a97fe
  114. }
  115. #plugin-settings-main .slider {
  116. display: inline-block;
  117. width: var(--button-width);
  118. height: var(--button-height);
  119. background-color: var(--color-grey);
  120. border-radius: calc(var(--button-height) / 2);
  121. position: relative;
  122. transition: 0.3s all ease-in-out
  123. }
  124. #plugin-settings-main .slider::after {
  125. content: "";
  126. display: inline-block;
  127. width: var(--toggle-diameter);
  128. height: var(--toggle-diameter);
  129. background-color: #fff;
  130. border-radius: calc(var(--toggle-diameter) / 2);
  131. position: absolute;
  132. top: var(--button-toggle-offset);
  133. transform: translateX(var(--button-toggle-offset));
  134. box-shadow: var(--toggle-shadow-offset) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, 0.1);
  135. transition: 0.3s all ease-in-out
  136. }
  137. #plugin-settings-main .switch input[type="checkbox"]:checked+.slider {
  138. background-color: var(--color-green)
  139. }
  140. #plugin-settings-main .switch input[type="checkbox"]:checked+.slider::after {
  141. transform: translateX(calc(var(--button-width) - var(--toggle-diameter) - var(--button-toggle-offset)));
  142. box-shadow: calc(var(--toggle-shadow-offset) * -1) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, 0.1)
  143. }
  144. #plugin-settings-main .switch input[type="checkbox"] {
  145. display: none
  146. }
  147. #plugin-settings-main .switch input[type="checkbox"]:active+.slider::after {
  148. width: var(--toggle-wider)
  149. }
  150. #plugin-settings-main .switch input[type="checkbox"]:checked:active+.slider::after {
  151. transform: translateX(calc(var(--button-width) - var(--toggle-wider) - var(--button-toggle-offset)))
  152. }
  153. .notifications:where(.toast, .column) {
  154. display: flex;
  155. align-items: center
  156. }
  157. .notifications .column {
  158. display: flex;
  159. align-items: center
  160. }
  161. .notifications {
  162. position: fixed;
  163. top: 30px;
  164. right: 20px;
  165. z-index: 9999
  166. }
  167. .notifications .toast {
  168. width: 350px;
  169. list-style: none;
  170. display: flex;
  171. align-items: center;
  172. position: relative;
  173. overflow: hidden;
  174. border-radius: 8px;
  175. border: 1px solid rgb(220, 218, 215);
  176. padding: 16px 17px;
  177. margin-bottom: 10px;
  178. background-color: var(--light);
  179. justify-content: space-between;
  180. animation: show_toast 0.3s forwards
  181. }
  182. @keyframes show_toast {
  183. 0% {
  184. transform: translateX(100%)
  185. }
  186. 40% {
  187. transform: translateX(-5%)
  188. }
  189. 80% {
  190. transform: translateX(0)
  191. }
  192. 100% {
  193. transform: translateX(-10px)
  194. }
  195. }
  196. .toast .column i {
  197. font-size: 1.75rem
  198. }
  199. .toast.hide {
  200. animation: hide_toast 0.3s forwards
  201. }
  202. @keyframes hide_toast {
  203. 0% {
  204. transform: translateX(-10%)
  205. }
  206. 40% {
  207. transform: translateX(0%)
  208. }
  209. 80% {
  210. transform: translateX(-5%)
  211. }
  212. 100% {
  213. transform: translateX(calc(100% + 20px))
  214. }
  215. }
  216. .toast .column span {
  217. font-size: 1.07rem;
  218. margin-left: 12px
  219. }
  220. .toast i:last-child {
  221. color: #aeb0d7;
  222. cursor: pointer
  223. }
  224. .toast i:last-child:hover {
  225. color: var(--dark)
  226. }
  227. .toast::after {
  228. content: attr(time time)''
  229. }
  230. .toast::before {
  231. content: '';
  232. position: absolute;
  233. left: 0;
  234. bottom: 0;
  235. width: 100%;
  236. height: 3px;
  237. animation: progress 5s linear forwards
  238. }
  239. @keyframes progress {
  240. 100% {
  241. width: 0
  242. }
  243. }
  244. .toast.success::before,
  245. .btn#success {
  246. background-color: var(--success)
  247. }
  248. .toast.error::before,
  249. .btn#error {
  250. background-color: var(--error)
  251. }
  252. .toast.warning::before,
  253. .btn#warning {
  254. background-color: var(--warning)
  255. }
  256. .toast.info::before,
  257. .btn#info {
  258. background-color: var(--info)
  259. }
  260. .toast.success .column i {
  261. color: var(--success)
  262. }
  263. .toast.error .column i {
  264. color: var(--error)
  265. }
  266. .toast.warning .column i {
  267. color: var(--warning)
  268. }
  269. .toast.info .column i {
  270. color: var(--info)
  271. }
  272. @media screen and (max-width:530px) {
  273. .notifications {
  274. width: 95%
  275. }
  276. .notifications .toast {
  277. width: 100%;
  278. font-size: 1rem;
  279. margin-left: 20px
  280. }
  281. .buttons .btn {
  282. margin: 0 1px;
  283. font-size: 1.1rem;
  284. padding: 8px 15px
  285. }
  286. }
  287. `;
  288. const jwgl_error = `
  289. <h2 style="color:white;margin: 0;display: block;font-size: 1.5em;font-weight: bold;">似乎来到了错误的网站.^.</h2>
  290. <p style="color:white;margin: 0.5em 0;text-align: center;">愿意现在跳转至教务系统登录(不可用)网站吗?<br>(jwgl.nxu.edu.cn)</p>
  291. <div id="control-button" style="display: flex;">
  292. <button onclick="this.parentNode.parentNode.remove()" style="height: auto;margin: 0.5em 1em;padding: 0.5em 1em;border: 1px white solid;border-radius: 4px;font-weight: bold;color: white;background:#2193b0;background: -webkit-linear-gradient(to right bottom, #6dd5ed, #2193b0);background: linear-gradient(to right bottom, #6dd5ed, #2193b0);">不用了<br>我再看看</button>
  293. <button onclick="window.close()" style="height: auto;margin: 0.5em 1em;padding: 0.5em 1em;border: 1px white solid;border-radius: 4px;font-weight: bold;color: white;background:#2193b0;background: -webkit-linear-gradient(to right bottom, #6dd5ed, #2193b0);background: linear-gradient(to right bottom, #6dd5ed, #2193b0);">不用了<br>关闭当前窗口</button>
  294. </div>
  295. `;
  296. const settings_div = `
  297. <div data-id="plugin-settings" class="block-group">
  298. <h1 class="block-group__title">插件设置</h1>
  299. <div id="plugin-settings-main">
  300. <div class="block-group__item">
  301. <h2>账号设置</h2>
  302. <div class="hr"></div>
  303. <div>
  304. <p>学号:</p>
  305. <input type="text" id="username" />
  306. </div>
  307. <p class="warning" id="username-empty" style="display: none;">学号不能为空!</p>
  308. <p class="warning" id="username-error" style="display: none;">学号格式错误!</p>
  309. <div>
  310. <p>密码:</p>
  311. <input type="password" id="password" />
  312. </div>
  313. <p class="warning" id="password-empty" style="display: none;">密码不能为空!</p>
  314. <div class="button">
  315. <button id="reflash-user-info">提交</button>
  316. </div>
  317. <p class="note">注:用于系统自动登录(不可用),可留空。<span style="color:orange">请确保学号密码输入正确!</span></p>
  318. </div>
  319. <div class="block-group__item">
  320. <h2>功能设置</h2>
  321. <div class="hr"></div>
  322. <div class="switch">
  323. <p>自动登录(不可用)</p>
  324. <label class="switch">
  325. <input type="checkbox" id="auto-login">
  326. <span class="slider"></span>
  327. </label>
  328. </div>
  329. <div class="hr-"></div>
  330. <div class="switch">
  331. <div class="flex-c flex-1">
  332. <p>自动关闭错误网站</p>
  333. <p class="note">(包括404、服务器错误等)</p>
  334. </div>
  335. <label class="switch">
  336. <input type="checkbox" id="auto-close">
  337. <span class="slider"></span>
  338. </label>
  339. </div>
  340. </div>
  341. <div class="block-group__item">
  342. <h2>功能预览</h2>
  343. <div class="hr"></div>
  344. <div class="block-group__content" style="margin-top: 1em;">
  345. <div class="block-group__item__wrap" style="width: 33%;">
  346. <a href="javascript:void(0)" class="block-group__item">
  347. <div class="block-group__item__logo__wrap">
  348. <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAgtJREFUWEftVz1PG0EQfbO2QVaaNCmgcpUCIus+Fmr7R1AgISUIQRwpTX5BQEqVBqEUkWmgoqOlxY0b69Z2A5Go6CKlQqK+nWgdnxXguF3HJ2JLrHSN9+3Mm7fPox2Cw/I8r1IoFM4BtJRSm1lHpJRftda1YrG40el0rmzhyQYw+1LKGjMnBOpZZ8IwNLgaEdWjKGrZ4k8HAd/3Xwkh1gCYL229BOABuAHQt1RlcAZvcAaftg7iOG71+/2bgQJSyo/M/M0mV577zLzX7XZ3BwSSe2PmTSHEdUoij5n3TVVE9CmLyBDnDXFpai0w8wmAC6XUm4QAm6BKqVRP5G3CMAxH+WaDQLVafVEqlRpE9COKojNLH1jXWs+Xy+XTdrt9m4YdW4E8zTf03MMrYB78tpd3srR4RPQ58dzAA0EQMJFTT8qVnzH9yIT/VYG/TZFriY8Em04TZjWivFWZHQW871wpApV/VSAm/Oo16PL+eWcFwuaf5jDJIo169IHuPEycCQRN3oHG4gQErstzOG1v0Z2W7ExggsSZR2eHQHjIR7CZUOMShC/qPf10VcxZgaDJHQJWbIFZQHa3Sdlwyb4zgdVDfq3jbBM+9lfLIuNMwLWicXHPBKZXAa31cq/Xe9C7x73jLLzv+0tCiIv7T7Ld5J2WZzJLrGMzaSejmZl+3wJ49xQEzFgmhGiZ6fk37NF2MC4ilNUAAAAASUVORK5CYII=">
  349. </div>
  350. <div class="block-group__item__content">
  351. <h2 title="智慧党建" class="block-group__item__name">智慧党建</h2>
  352. <div title="zhdj.nxu.edu.cn" class="block-group__item__desc">zhdj.nxu.edu.cn</div>
  353. <svg aria-hidden="true" title="收藏" class="wrdvpn-icon">
  354. <use xlink:href="#wrdvpn-collect"></use>
  355. </svg>
  356. </div>
  357. </a>
  358. </div>
  359. <div class="block-group__item__wrap" style="width: 33%;">
  360. <a href="javascript:void(0)" class="block-group__item">
  361. <div class="block-group__item__logo__wrap">
  362. <div class="block-group__item__logo" style="background-color: rgb(71, 179, 71);">智</div>
  363. </div>
  364. <div class="block-group__item__content">
  365. <h2 title="智慧党建" class="block-group__item__name">智慧党建</h2>
  366. <div title="zhdj.nxu.edu.cn" class="block-group__item__desc">zhdj.nxu.edu.cn</div>
  367. <svg aria-hidden="true" title="收藏" class="wrdvpn-icon">
  368. <use xlink:href="#wrdvpn-collect"></use>
  369. </svg>
  370. </div>
  371. </a>
  372. </div>
  373. <div class="block-group__item__wrap" style="width: 33%;">
  374. <a href="javascript:void(0)" class="block-group__item">
  375. <div class="block-group__item__logo__wrap">
  376. <div class="block-group__item__logo" style="background-color: rgb(71, 179, 71);">智</div>
  377. </div>
  378. <div class="block-group__item__content">
  379. <h2 title="智慧党建" class="block-group__item__name">智慧党建</h2>
  380. <div title="zhdj.nxu.edu.cn" class="block-group__item__desc">zhdj.nxu.edu.cn</div>
  381. <svg aria-hidden="true" title="收藏" class="wrdvpn-icon">
  382. <use xlink:href="#wrdvpn-collect"></use>
  383. </svg>
  384. </div>
  385. </a>
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. </div>
  391. `;
  392. const jwgl_table_title = (message, id1, id2 = "") => {
  393. return `
  394. <table id="${id1}" border="0" cellspacing="0" cellpadding="0" style="display: block;">
  395. <tr>
  396. <td>
  397. <a href="javascript:0;" style="display:block;width:24px;height:22px">
  398. <img src="static/images/tree/minus.gif" width="24" height="22" border="0">
  399. </a>
  400. <a class="MenuTocItemFolderLinkStyle" href="javascript:0;" target="">
  401. <img src="static/images/tree/entityfolder.gif" width="0" height="0" border="0">
  402. </a>
  403. </td>
  404. <td valign="middle" nowrap="">
  405. <a ${(id2!="") ? (`id="${id2}"`) : ("")} class="MenuTocItemFolderLinkStyle" href="javascript:0;" target="">${message}</a>
  406. </td>
  407. </tr>
  408. </table>
  409. `
  410. };
  411. const jwgl_table_content = (message, id) => {
  412. return `
  413. <table border="0" cellspacing="0" cellpadding="0" style="display: block;">
  414. <tbody>
  415. <tr>
  416. <td valign="top" nowrap="">
  417. <img src="static/images/tree/line.gif" width="24" height="22">
  418. </td>
  419. <td valign="middle" nowrap="">
  420. <img src="static/images/tree/sanjiao.gif" border="0">
  421. <a id="${id}" class="MenuTocItemLinkStyle" target="main">${message}</a>
  422. </td>
  423. </tr>
  424. </tbody>
  425. </table>
  426. `;
  427. };
  428. const jwgl_class = (content_array, mode = -1) => {
  429. if (mode == 0) {
  430. return `
  431. <div class="class_main" style="display:flex;flex-direction:column;align-items:center;margin-bottom:1em">
  432. <style>
  433. .class_main > div {
  434. width: 100%;
  435. display: flex;
  436. flex-direction: column;
  437. align-items: center;
  438. margin: 0;
  439. }
  440. .teacher {
  441. font-size: 10px;
  442. padding: 0;
  443. }
  444. .classroom {
  445. font-size: 10px;
  446. padding: 0;
  447. /* color: #eff0ea; */
  448. }
  449. .subject {
  450. font-size: 16px;
  451. font-weight: bold;
  452. padding: 0.5em 0;
  453. }
  454. </style>
  455. <div class="classroom">${content_array[3]}</div>
  456. <div class="subject">${content_array[1]}</div>
  457. <div class="teacher">${content_array[2]}<br>${content_array[0]}</div>
  458. </div>
  459. `;} else if (mode > 0) {
  460. return `
  461. <div class="class_main" style="display:flex;flex-direction:column;align-items:center;margin-bottom:1em">
  462. <style>
  463. .class_main > div {
  464. width: 100%;
  465. display: flex;
  466. flex-direction: column;
  467. align-items: center;
  468. margin: 0;
  469. }
  470. .teacher {
  471. font-size: 10px;
  472. padding: 0;
  473. }
  474. .classroom {
  475. font-size: 10px;
  476. padding: 0;
  477. /* color: #eff0ea; */
  478. }
  479. .subject {
  480. font-size: 16px;
  481. font-weight: bold;
  482. padding: 0.5em 0;
  483. }
  484. </style>
  485. <div class="teacher">${content_array[2]}<br>${content_array[0]}</div>
  486. </div>
  487. `;} else {
  488. return `
  489. <div class="class_main" style="display:flex;flex-direction:column;align-items:center;margin-bottom:1em">
  490. <style>
  491. .class_main > div {
  492. width: 100%;
  493. display: flex;
  494. flex-direction: column;
  495. align-items: center;
  496. margin: 0;
  497. }
  498. .teacher {
  499. font-size: 10px;
  500. padding: 0;
  501. }
  502. .classroom {
  503. font-size: 10px;
  504. padding: 0;
  505. /* color: #eff0ea; */
  506. }
  507. .subject {
  508. font-size: 16px;
  509. font-weight: bold;
  510. padding: 0.5em 0;
  511. }
  512. </style>
  513. <div class="classroom">${content_array[3]}</div>
  514. <div class="subject">${content_array[0]}</div>
  515. <div class="teacher">${content_array[2]}<br>${content_array[1]}</div>
  516. </div>
  517. `;}
  518. };

QingJ © 2025

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