氦luogu

Amazing style in luogu

  1. // ==UserScript==
  2. // @name 氦luogu
  3. // @namespace http://tampermonkey.net/
  4. // @version 2025-03-05
  5. // @description Amazing style in luogu
  6. // @author abs20187
  7. // @match *://www.luogu.com.cn/*
  8. // @license MIT
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. // Your code here...
  15. let style=document.createElement('style');
  16. function setcookie(name,value,days,path,domain,secure)
  17. {
  18. let cookieString=`${name}=${value}`;
  19. if(days)
  20. {
  21. const date=new Date();
  22. date.setTime(date.getTime()+(days*24*60*60*1000));
  23. cookieString+=`;expires=${date.toUTCString()}`;
  24. }
  25. if(path)
  26. {
  27. cookieString+=`;path=${path}`;
  28. }
  29. else
  30. {
  31. cookieString+=`;path=/`;
  32. }
  33. if(domain)
  34. {
  35. cookieString+=`;domain=${domain}`;
  36. }
  37. if(secure&&window.location.protocol=="https:")
  38. {
  39. cookieString+=`;secure`;
  40. }
  41. document.cookie=cookieString;
  42. }
  43. function getcookie(name)
  44. {
  45. const cookiestring=document.cookie;
  46. const cookie3=decodeURIComponent(cookiestring);
  47. const cookie2=cookie3.split('; ');
  48. for(let i of cookie2)
  49. {
  50. const [cname,cvalue]=i.split('=');
  51. if(cname==name)
  52. {
  53. return cvalue;
  54. }
  55. }
  56. if(name=='backimg')
  57. {
  58. setcookie('backimg',`https://s21.ax1x.com/2025/04/17/pEhJvD0.jpg`,114514,'/','luogu.com.cn',true);
  59. return `https://s21.ax1x.com/2025/04/17/pEhJvD0.jpg`;
  60. }
  61. if(name=='blr')
  62. {
  63. setcookie('blr',0,114514,'/','luogu.com.cn',true);
  64. return 0;
  65. }
  66. if(name=='bblr')
  67. {
  68. setcookie('bblr',0,114514,'/','luogu.com.cn',true);
  69. return 0;
  70. }
  71. if(name=='logo-color')
  72. {
  73. setcookie('logo-color',"#3498DB",114514,'/','luogu.com.cn',true);
  74. return "#3498DB";
  75. }
  76. if(name=='lfe-color')
  77. {
  78. setcookie('lfe-color',"#34495E",114514,'/','luogu.com.cn',true);
  79. return "#34495E";
  80. }
  81. if(name=='opt')
  82. {
  83. setcookie('opt',1,114514,'/','luogu.com.cn',true);
  84. return 1;
  85. }
  86. return null;
  87. }
  88. function deleteCookie(name)
  89. {
  90. document.cookie=name+'=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/';
  91. }
  92. let Img=getcookie("backimg");
  93. let blr=getcookie("blr");
  94. let blr2=blr*3;
  95. let bblr=getcookie("bblr");
  96. let logocl=getcookie("logo-color");
  97. let lfecl=getcookie("lfe-color");
  98. let opt=getcookie("opt");
  99. let opt_1=(opt+0.08<=1?opt+0.08:1);
  100. let opt_2=(opt+0.1<=1?opt+0.1:1);
  101. style.textContent = `
  102. /*背景*/
  103. html>body
  104. {
  105. background-image: url(${Img}) !important;
  106. background-repeat: no-repeat;
  107. background-size: cover;
  108. background-position: center;
  109. background-attachment: fixed;
  110. background-color: rgb(239, 239, 239)!important;
  111. }
  112. .wrapper.wrapped.lfe-body.header-layout.tiny
  113. {
  114. z-index:9999;
  115. /*background:linear-gradient(to right,rgba(255,0,0,40%),rgba(255,97,0,40%),rgba(255,255,0,40%),rgba(0,255,0,40%),rgba(0,255,255,40%),rgba(0,0,255,40%),rgba(255,0,255,40%))!important;彩虹*/
  116. background-color:rgba(255,255,255,${opt})!important;
  117. backdrop-filter:blur(20px);
  118. font-weight:600!important;
  119. }
  120. .user-nav
  121. {
  122. z-index:9999;
  123. }
  124. a
  125. {
  126. transition:all 0.5s ease!important;
  127. }
  128. ::selection
  129. {
  130. background-color:DarkMode_check(#264f78, #d6d6d6);
  131. }
  132.  
  133. /*去除掩盖物*/
  134. main
  135. {
  136. background:rgba(255,255,255,0)!important;
  137. }
  138. div[data-v-fc349d1c]
  139. {
  140. background:rgba(255,255,255,0)!important;
  141. }
  142. /*专栏卡片*/
  143. .article-content[data-v-f0d12dd0]
  144. {
  145. animation:beginup 0.5s;
  146. background:rgba(252,252,252,${opt})!important;
  147. border-radius:10px!important;
  148. transition:all 0.3s!important;
  149. box-shadow: 3px 3px 15px rgba(0, 0,0, 0.5);
  150. }
  151. .article-content[data-v-f0d12dd0]::before
  152. {
  153. content: '';
  154. position: absolute;
  155. top: 0; left: 0; right: 0; bottom: 0;
  156. backdrop-filter:blur(${blr}px)!important;
  157. z-index: -1;
  158. }
  159. .article-content[data-v-f0d12dd0]:hover
  160. {
  161. box-shadow: 3px 3px 20px rgba(0, 0,0, 0.5);
  162. background:rgba(252,252,252,${opt_1})!important;
  163. }
  164. .article-banner[data-v-076e399a]
  165. {
  166. animation:beginup 0.5s;
  167. background:rgba(252,252,252,${opt})!important;
  168. border-radius:8px!important;
  169. padding:0.1rem 1.1rem;
  170. margin-bottom:1rem;
  171. margin-top:1rem;
  172. transition:all 0.3s!important;
  173. box-shadow: 3px 3px 15px rgba(0, 0,0, 0.5);
  174. position: relative;
  175. }
  176. .article-banner[data-v-076e399a]::after
  177. {
  178. content: '';
  179. position: absolute;
  180. height:100%!important;
  181. width:100%!important;
  182. top: 0; left: 0; right: 0; bottom: 0;
  183. backdrop-filter:blur(${blr}px)!important;
  184. z-index: -1;
  185. }
  186. .article-banner[data-v-076e399a]:hover
  187. {
  188. box-shadow: 3px 3px 20px rgba(0, 0,0, 0.5);
  189. background:rgba(252,252,252,${opt_1})!important;
  190. }
  191. .toc
  192. {
  193. margin-left:30px!important;
  194. padding:10px!important;
  195. border-radius:8px!important;
  196. box-shadow: 3px 3px 10px rgba(0, 0,0, 0.5);
  197. background:rgba(252,252,252,${opt})!important;
  198. position: relative;
  199. }
  200. .toc::before
  201. {
  202. content: '';
  203. position: absolute;
  204. top: 0; left: 0; right: 0; bottom: 0;
  205. backdrop-filter:blur(${blr}px)!important;
  206. z-index: -1;
  207. }
  208. .toc:hover
  209. {
  210. box-shadow: 3px 3px 16px rgba(0, 0,0, 0.5);
  211. background:rgba(252,252,252,${opt_1})!important;
  212. }
  213. /*主站卡片*/
  214. .lg-article
  215. {
  216. animation:beginup 0.5s;
  217. border-radius:15px!important;
  218. background:rgba(252,252,252,${opt});
  219. box-shadow: 3px 3px 15px rgba(0, 0,0, 0.5);
  220. transition:all 0.5s ease;
  221. }
  222. .lg-article::before
  223. {
  224. content: '';
  225. position: absolute;
  226. top: 0; left: 0; right: 0; bottom: 0;
  227. backdrop-filter:blur(${blr}px)!important;
  228. z-index: -1;
  229. }
  230. .lg-article:hover
  231. {
  232. box-shadow: 3px 3px 20px rgba(0, 0,0, 0.5);
  233. background:rgba(252,252,252,${opt_1})!important;
  234. }
  235. /*底栏*/
  236. .background
  237. {
  238. background: #fff0!important;
  239. }
  240. .theme-bg
  241. {
  242. background: rgba(255,255,255,0)!important;
  243. }
  244. /*犇犇边框*/
  245. .am-comment-main
  246. {
  247. border-radius:8px!important;
  248. border-color:gold!important;
  249. background:rgba(255,255,255,0)!important;
  250. box-shadow: 3px 3px 10px rgba(0, 0,0, 0.5);
  251. }
  252. .am-comment-main::before
  253. {
  254. border-right-color:gold!important;
  255. }
  256. .lg-left img
  257. {
  258. border-color:gold!important;
  259. }
  260. /*犇犇*/
  261. .am-comment-hd
  262. {
  263. background:rgba(247,247,247,${opt});
  264. border-top-right-radius:8px!important;
  265. border-top-left-radius:8px!important;
  266. transition:all 0.3s ease;
  267. }
  268. .am-comment-bd
  269. {
  270. background:linear-gradient(to top,rgba(255,255,255,${opt}),rgba(247 247 247 / ${opt}));
  271. border-bottom-right-radius:8px!important;
  272. border-bottom-left-radius:8px!important;
  273. transition:all 0.3s ease;
  274. }
  275. .am-comment-main
  276. {
  277. transition:all 0.5s ease;
  278. backdrop-filter:blur(${bblr}px)!important;
  279. }
  280. .am-comment-main:hover
  281. {
  282. background:rgba(255,255,255,0.3)!important;
  283. box-shadow: 3px 3px 15px rgba(0, 0,0, 0.5)!important;
  284. }
  285. /*主页卡片*/
  286. .card
  287. {
  288. animation:beginup 0.5s;
  289. background:rgba(252,252,252,${opt})!important;
  290. border-radius:15px!important;
  291. transition:all 0.5s ease;
  292. box-shadow: 3px 3px 15px rgba(0, 0,0, 0.5)!important;
  293. position: relative;
  294. }
  295. .card::before
  296. {
  297. content: '';
  298. position: absolute;
  299. top: 0; left: 0; right: 0; bottom: 0;
  300. backdrop-filter:blur(${blr}px)!important;
  301. border-radius:15px;
  302. z-index: -1;
  303. }
  304. .card:hover
  305. {
  306. box-shadow: 3px 3px 20px rgba(0, 0,0, 0.5)!important;
  307. background:rgba(252,252,252,${opt_1})!important;
  308. }
  309. /*主页头图*/
  310. .user-header-top
  311. {
  312. opacity:0.85!important;
  313. }
  314. /*题目卡片*/
  315. .l-card
  316. {
  317. animation:beginup 0.5s;
  318. background:rgba(252,252,252,${opt})!important;
  319. border-radius:18px!important;
  320. box-shadow: 3px 3px 15px rgba(0, 0,0, 0.5)!important;
  321. transition:all 0.5s ease;
  322. position: relative;
  323. }
  324. .l-card::before
  325. {
  326. content: '';
  327. position: absolute;
  328. top: 0; left: 0; right: 0; bottom: 0;
  329. backdrop-filter:blur(${blr}px)!important;
  330. border-radius:18px!important;
  331. z-index: -1;
  332. }
  333. .l-card:hover
  334. {
  335. box-shadow: 3px 3px 20px rgba(0, 0,0, 0.5)!important;
  336. background:rgba(252,252,252,${opt_1})!important;
  337. }
  338. /*弹窗*/
  339. .dropdown
  340. {
  341. border-radius: 10px !important;
  342. z-index:10000;
  343. box-shadow: 3px 3px 20px rgba(0, 0,0, 0.5)!important;
  344. background-color:rgba(255,255,255,0) !important;
  345. }
  346. .dropdown>.l-card
  347. {
  348. margin-bottom:0px!important;
  349. }
  350. .dropdown > .center
  351. {
  352. z-index:10000;
  353. border-radius: 10px !important;
  354. background-color:rgba(255,255,255,${opt}) !important;
  355. }
  356. .dropdown a:hover
  357. {
  358. filter:brightness(1.2);
  359. }
  360. .popup
  361. {
  362. border-radius: 10px !important;
  363. background-color:rgba(255,255,255,${opt}) !important;
  364. backdrop-filter:blur(${blr}px)!important;
  365. z-index:999;
  366. }
  367. .swal2-container
  368. {
  369. z-index:100000;
  370. }
  371. .cover-upload
  372. {
  373. z-index:1000000!important;
  374. background:rgba(255,255,255,${opt});
  375. position:static!important;
  376. }
  377. .modal>.center
  378. {
  379. z-index:5;
  380. }
  381. /*专栏单选框*/
  382. .checkbox
  383. {
  384. color:#ccc!important;
  385. }
  386. /*用户菜单栏/顶栏*/
  387. .user-nav a
  388. {
  389. transition:all 0.5s ease;
  390. }
  391. .user-nav a:hover
  392. {
  393. color:#3498db;
  394. }
  395. .user-nav[data-v-2dfcfd35]
  396. {
  397. border-radius:8px!important;
  398. top:0.5rem!important;
  399. color:white!important;
  400. background-color:rgba(255,255,255,0)!important;
  401. }
  402. /*侧栏*/
  403. #app>.lfe-body
  404. {
  405. height:430px;
  406. border-bottom-right-radius:30px!important;
  407. border-top-right-radius:30px!important;
  408. margin-top:8%!important;
  409. background:${lfecl}!important;
  410. animation:lfepop 0.5s;
  411. z-index:35;
  412. }
  413. #app>.lfe-body>a
  414. {
  415. height:3.5em!important;
  416. transition: all 0.3s;
  417. margin-top:3px;
  418. }
  419. #app>.lfe-body>.popup-button
  420. {
  421. border-radius:12px!important;
  422. border-width:0px;
  423. border-color:rgba(0,0,0,.7)!important;
  424. transition: all 0.4s ease;
  425. background-color:${lfecl}!important;
  426. }
  427. #app>.lfe-body>.popup-button:hover
  428. {
  429. background-color:rgba(244,244,244,0.5)!important;
  430. border-width:3px;
  431. }
  432. #app>.lfe-body>a>.text
  433. {
  434. opacity: 0;
  435. display: block;
  436. transition:opacity 0.3s;
  437. margin-top:0px!important;
  438. }
  439. #app>.lfe-body>a:hover
  440. {
  441. filter:brightness(1.2);
  442. transform:translateY(-5px)!important;
  443. }
  444. #app>.lfe-body>a:hover>.text
  445. {
  446. opacity: 1!important;
  447. }
  448. .lfe-body>div[data-v-12f19ddc]
  449. {
  450. border-top-right-radius:30px!important;
  451. }
  452. .lfe-body>div[data-v-12f19ddc]
  453. {
  454. background-color:${logocl}!important;
  455. }
  456. /*卡片内菜单*/
  457. .inner-card,.am-panel
  458. {
  459. background-color:rgba(255,255,255,0.8)!important;
  460. border-radius:8px!important;
  461. }
  462. .discuss
  463. {
  464. background-color:rgba(255,255,255,0.8)!important;
  465. border-radius:8px!important;
  466. }
  467. /*按钮*/
  468. .am-btn
  469. {
  470. border-radius:10px!important;
  471. top:0px!important;
  472. transition:all 0.3s ease;
  473. box-shadow: 0 0px 0px 0 rgba(0, 0, 1, 0.5)!important;
  474. }
  475. .am-btn:hover
  476. {
  477. box-shadow: 0.3px 2px 6px 0 rgba(0, 0, 1, 0.5)!important;
  478. transform:translateY(-2px);
  479. }
  480. .solid
  481. {
  482. border-radius:10px!important;
  483. top:0px!important;
  484. }
  485. .solid:hover
  486. {
  487. box-shadow: 0 0px 7px 0 rgba(0, 0, 1, 0.5)!important;
  488. transform:translateY(-2px);
  489. }
  490. button.lform-size-middle
  491. {
  492. border-radius:10px!important;
  493. top:0px!important;
  494. }
  495. button.lform-size-middle:hover
  496. {
  497. box-shadow: 0 0px 7px 0 rgba(0, 0, 1, 0.5)!important;
  498. }
  499. button.lform-size-small
  500. {
  501. border-radius:8px!important;
  502. top:0px!important;
  503. }
  504. button.lform-size-small:hover
  505. {
  506. box-shadow: 0 0px 2px 0 rgba(0, 0, 1, 0.5)!important;
  507. }
  508. .float-bottom
  509. {
  510. background:rgba(255,255,255,0.9)!important;
  511. }
  512. button.lfe-form-sz-middle[data-v-66fcc50b]
  513. {
  514. border-radius:10px!important;
  515. top:0px!important;
  516. transition:all 0.3s ease;
  517. box-shadow: 0 0px 0px 0 rgba(0, 0, 1, 0.5)!important;
  518. }
  519. button.lfe-form-sz-middle[data-v-66fcc50b]:hover
  520. {
  521. box-shadow: 0.3px 2px 6px 0 rgba(0, 0, 1, 0.5)!important;
  522. top:-2px;
  523. }
  524. .swal2-styled
  525. {
  526. border-radius:10px!important;
  527. top:0px!important;
  528. }
  529. .swal2-styled:hover
  530. {
  531. box-shadow: 0.3px 2px 6px 0 rgba(0, 0, 1, 0.5)!important;
  532. transform:translateY(-2px);
  533. }
  534. /*代码*/
  535. .cm-editor
  536. {
  537. background-color:rgba(255,255,255,0.9);
  538. }
  539. .ace_function
  540. {
  541. color:red;
  542. }
  543. .cm-editor,code,.cm-line,.monaco-editor,.lfe-code,.cm-gutters,.CodeMirror-sizer
  544. {
  545. counter-reset: line-number;
  546. font-family: 'Fira Code', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace!important;
  547. font-size: 15px;
  548. }
  549. .lfe-marked pre,.lfe-marked pre>code
  550. {
  551. background:rgba(255,255,255,0.9);
  552. }
  553. /*选项*/
  554. .items>li>.entry:not(.selected)::before
  555. {
  556. left:50%!important;
  557. width:0%!important;
  558. background:#bfbfbf!important;
  559. transition:all 0.5s ease;
  560. }
  561. .items>li>.entry:hover::before
  562. {
  563. left:0%!important;
  564. width:100%!important;
  565. }
  566. .category ul>li.selected[data-v-04eb14e9]
  567. {
  568. color:white!important;
  569. background:#9D3DCF!important;
  570. border-radius:8px!important;
  571. }
  572. .selected::before
  573. {
  574. background:#3498db!important;
  575. }
  576. ul>li[data-v-01f8a102]:not(.selected)::before
  577. {
  578. left:50%!important;
  579. width:0%!important;
  580. background:#bfbfbf!important;
  581. transition:all 0.5s ease;
  582. }
  583. ul>li[data-v-01f8a102]:hover::before
  584. {
  585. left:0%!important;
  586. width:100%!important;
  587. }
  588. ul>li[data-v-01f8a102].selected::before
  589. {
  590. left:0%!important;
  591. width:100%!important;
  592. background:#3498db!important;
  593. }
  594. /*页码*/
  595. button
  596. {
  597. transition:all 0.3s;
  598. }
  599. .page-bar button
  600. {
  601. top:0px;
  602. }
  603. .page-bar button:hover
  604. {
  605. transform: translateY(-3px);
  606. }
  607. /*专栏页面*/
  608. .lside
  609. {
  610. background:rgba(255, 255, 255, 0.98) !important;
  611. backdrop-filter:blur(7px)!important;
  612. }
  613. .row.row-space-between.reply-info div:not(.text,.combo,div.row),.comment-filter-line span[data-v-0a88bc8f]
  614. {
  615. font-weight:700;
  616. }
  617. div.text.lform-size-middle
  618. {
  619. background-color:rgba(255,255,255,0.98)!important;
  620. }
  621. .top-bar
  622. {
  623. background:rgba(255, 255, 255, 0.98) !important;
  624. backdrop-filter:blur(10px)!important;
  625. }
  626. .name
  627. {
  628. transition:all 0.3s;
  629. }
  630. footer.lcolor-bg-grey-1
  631. {
  632. background-color:rgba(255,255,255,0.97);
  633. }
  634. .user-nav.rside
  635. {
  636. background-color:rgba(255,255,255,.98)!important;
  637. backdrop-filter:blur(7px)!important;
  638. }
  639. .row.title>a
  640. {
  641. transition:all 0.5s;
  642. letter-spacing:0.3px;
  643. }
  644. .row.title>a:hover
  645. {
  646. transform: translateY(-2px);
  647. color:rgba(52,152,219)!important;
  648. letter-spacing:1px;
  649. }
  650. span[data-v-386007e1]
  651. {
  652. border-radius:5px;
  653. }
  654. .reply-item>.meta
  655. {
  656. background:rgba(255,255,255,0.8)!important;
  657. border-top-left-radius:18px!important;
  658. border-top-right-radius:18px!important;
  659. }
  660. /*setting按钮*/
  661. .Hesetb
  662. {
  663. border-radius:15px;
  664. background:#3498db!important;
  665. height:30px;
  666. width:auto;
  667. color:white;
  668. border-width:0px;
  669. padding-left:10px!important;
  670. padding-right:10px!important;
  671. }
  672. .Hesetb:hover
  673. {
  674. filter:brightness(1.1);
  675. }
  676. /*标签*/
  677. .lfe-caption
  678. {
  679. border-radius:7px!important;
  680. }
  681. .luogu-tag
  682. {
  683. border-radius:7px!important;
  684. }
  685. /*讨论*/
  686. .author[data-v-23764882]
  687. {
  688. background:rgba(255,255,255,0)!important;
  689. border-top-left-radius:18px!important;
  690. border-top-right-radius:18px!important;
  691. }
  692. .row
  693. {
  694. background:rgba(255,255,255,0)!important;
  695. }
  696. /*头像*/
  697. img.avatar[data-v-ae15b82e]
  698. {
  699. transition:all .5s ease;
  700. }
  701. img.avatar[data-v-ae15b82e]:hover{
  702. transform:translateY(-3px);
  703. box-shadow: 5px 6px 10px rgba(1, 1, 1, 0.5);
  704. }
  705. /*代码块*/
  706. .lfe-code
  707. {
  708. border-radius:8px;
  709. background-color:rgba(255,255,255,0.87);
  710. }
  711. /*进度条*/
  712. .top-progress
  713. {
  714. z-index:999999!important;
  715.  
  716. }
  717. /*题目列表*/
  718. .title.color-default
  719. {
  720. letter-spacing:0.1px;
  721. transition:letter-spacing 0.5s ease;
  722. }
  723. .title.color-default:hover
  724. {
  725. letter-spacing:1px;
  726. }
  727. .title.color-default:active
  728. {
  729. letter-spacing:1.3px;
  730. }
  731. /*输入框*/
  732. #feed-content
  733. {
  734. border-radius:10px!important;
  735. background-color:rgba(255,255,255,0.8)!important;
  736. }
  737. .refined-input
  738. {
  739. border-radius:8px!important;
  740. transition:all 0.4s ease;
  741. }
  742. .refined-input:not(.search-box .refined-input):hover
  743. {
  744. box-shadow:3px 7px 10px 0 rgba(0,0,0,0.5);
  745. transform:translateY(-3px);
  746. }
  747. .search-box
  748. {
  749. border-radius:8px!important;
  750. transition:all 0.4s ease;
  751. }
  752. .search-box:hover
  753. {
  754. box-shadow:3px 7px 10px 0 rgba(0,0,0,0.5);
  755. transform:translateY(-3px);
  756. }
  757. .lfe-form-sz-small
  758. {
  759. border-radius:8px!important;
  760. transition:all 0.3s ease;
  761. }
  762. .lfe-form-sz-small:not( .refined-input>.lfe-form-sz-small,.combo-wrapper .lfe-form-sz-small):hover
  763. {
  764. box-shadow:2px 4px 7px 0 rgba(0,0,0,0.5);
  765. transform:translateY(-2px);
  766. }
  767. .lfe-form-sz-middle
  768. {
  769. border-radius:10px!important;
  770. transition:all 0.4s ease;
  771. }
  772. .lfe-form-sz-middle:not( .refined-input>.lfe-form-sz-middle,.combo-wrapper .lfe-form-sz-middle):hover
  773. {
  774. box-shadow:3px 5px 10px 0 rgba(0,0,0,0.5);
  775. transform:translateY(-3px);
  776. }
  777. input.am-form-field
  778. {
  779. border-radius:10px!important;
  780. background-color:rgba(255,255,255,0.8);
  781. transition:all 0.3s ease;
  782. }
  783. input.am-form-field:hover
  784. {
  785. box-shadow:3px 5px 10px 0 rgba(0,0,0,0.5);
  786. transform:translateY(-2px);
  787. }
  788. /*私信*/
  789. .message-block > .message[data-v-5c0627c6]
  790. {
  791. border-radius:8px!important;
  792. margin:1px;
  793. border:gold solid 0.5px;
  794. background:rgba(255,255,255,0.75)!important;
  795. transition:all 0.3s ease;
  796. }
  797. .message-block > .message[data-v-5c0627c6]:hover
  798. {
  799. transform:translateY(-2px)!important;
  800. box-shadow:2px 2px 7px 0 rgba(0,0,0,0.6);
  801. }
  802. .item[data-v-4d6dca7a]
  803. {
  804. transition:all 0.5s ease;
  805. }
  806. /*测试点*/
  807. .test-case
  808. {
  809. border-radius:8px;
  810. }
  811. .test-case .status
  812. {
  813. font-weight:650!important;
  814. }
  815. .test-case .id
  816. {
  817. font-weight:600!important;
  818. }
  819. /*动画*/
  820. @keyframes beginup
  821. {
  822. 0%
  823. {
  824. margin-bottom:5rem;
  825. }
  826. }
  827. @keyframes lfepop
  828. {
  829. 0%
  830. {
  831. left:-7rem;
  832. }
  833. 100%
  834. {
  835. left:0;
  836. }
  837. }
  838. `
  839. ;
  840. document.head.append(style);
  841. window.onload=function(){
  842. let hrefw=window.location.href//等待页面加载完成
  843. console.log(hrefw);
  844. if(hrefw=='https://www.luogu.com.cn/')
  845. {
  846. let usrnv=document.querySelector(".user-nav");
  847. let button = document.createElement('button');
  848. console.log(button);
  849. button.textContent="氦luogu";
  850. button.className="Hesetb";
  851. usrnv.insertBefore(button,usrnv.firstChild);
  852. const settingsPageContent = `
  853. <div class="l-card" style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 20px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); border-radius: 10px; z-index: 10999999;">
  854. <h2>设置页面</h2>
  855. <lable for="input1">背景图片</lable>
  856. <input type="text" id="input1" value="${Img}" class="am-form-field" style="margin-bottom: 10px;"><br>
  857. <lable for="input2">卡片模糊度(0-20)</lable>
  858. <input type="text" id="input2" value="${blr}" class="am-form-field" style="margin-bottom: 10px;"><br>
  859. <lable for="input3">犇犇模糊度(0-20)</lable>
  860. <input type="text" id="input3" value="${bblr}" class="am-form-field" style="margin-bottom: 10px;"><br>
  861. <lable for="input4">侧栏LOGO颜色</lable>
  862. <input data-v-0ceb994e="" type="color" id="input4" value="${logocl}" class="block" style="margin-bottom: 10px;"><br>
  863. <lable for="input5">侧栏颜色</lable>
  864. <input data-v-0ceb994e="" type="color" id="input5" value="${lfecl}" class="block" style="margin-bottom: 10px;"><br>
  865. <lable for="input6">透明度(0-1 0为完全透明)</lable>
  866. <input data-v-0ceb994e="" type="value" id="input6" value="${opt}" class="block" style="margin-bottom: 10px;"><br>
  867. <button id="close-settings" class="am-btn am-btn-danger">关闭</button>
  868. </div>
  869. <div style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 9999999;"></div>
  870. `;
  871. button.addEventListener('click', () => {
  872. // 创建设置页面
  873. const settingsPage=document.createElement('div');
  874. settingsPage.innerHTML=settingsPageContent;
  875. document.body.appendChild(settingsPage);
  876. const input1=document.getElementById('input1');
  877. const input2=document.getElementById('input2');
  878. const input3=document.getElementById('input3');
  879. const input4=document.getElementById('input4');
  880. const input5=document.getElementById('input5');
  881. const input6=document.getElementById('input6');
  882.  
  883. //绑定关闭按钮事件
  884. const closeButton=document.getElementById('close-settings');
  885. closeButton.addEventListener('click', () => {
  886. Img=input1.value;
  887. blr=input2.value;
  888. bblr=input3.value;
  889. logocl=input4.value;
  890. lfecl=input5.value;
  891. opt=input6.value;
  892. document.body.removeChild(settingsPage);
  893. deleteCookie("backimg");
  894. setcookie("backimg",Img,114514,'/',"luogu.com.cn",true);
  895. deleteCookie("blr");
  896. setcookie("blr",blr,114514,'/',"luogu.com.cn",true);
  897. deleteCookie("bblr");
  898. setcookie("bblr",bblr,114514,'/',"luogu.com.cn",true);
  899. deleteCookie("logo-color");
  900. setcookie("logo-color",logocl,114514,'/',"luogu.com.cn",true);
  901. deleteCookie("lfe-color");
  902. setcookie("lfe-color",lfecl,114514,'/',"luogu.com.cn",true);
  903. deleteCookie("opt");
  904. setcookie("opt",opt,114514,'/',"luogu.com.cn",true);
  905. location.reload();
  906. });
  907. });
  908. }
  909. }
  910. })();