Sleazy Fork is available in English.

EH高亮本地本子

彩色高亮本地exhentai-manga-manager中存在的本子

  1. // ==UserScript==
  2. // @name EH高亮本地本子
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024.10.29
  5. // @description 彩色高亮本地exhentai-manga-manager中存在的本子
  6. // @author Cury
  7. // @match *://exhentai.org/*
  8. // @match *://e-hentai.org/*
  9. // @icon https://raw.githubusercontent.com/SchneeHertz/exhentai-manga-manager/master/public/icon.png
  10. // @grant GM_addStyle
  11. // @grant GM.xmlHttpRequest
  12. // @connect localhost
  13. // @license MIT
  14. // ==/UserScript==
  15.  
  16. (function () {
  17. 'use strict';
  18.  
  19. // 配置要使用的高亮颜色,下面出现的颜色均可选。
  20. const hightlightColor = '霓虹色';
  21.  
  22. GM_addStyle(`
  23. :root {
  24. --彩虹色: linear-gradient(-90deg, #602ce5cc 0, #2ce597cc 20%, #e7bb18cc 40%, #ff7657cc 60%, #45c1eecc 80%, #2ce597cc 100%);
  25.  
  26. --夕阳海滩: linear-gradient(-90deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
  27. --薰衣草田: linear-gradient(-90deg, #a18cd1 0%, #fbc2eb 100%);
  28. --柑橘清新: linear-gradient(-90deg, #f6d365 0%, #fda085 100%);
  29. --深海幻想: linear-gradient(-90deg, #43e97b 0%, #38f9d7 100%);
  30. --樱花飞舞: linear-gradient(-90deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
  31. --北极光: linear-gradient(-90deg, #4facfe 0%, #00f2fe 100%);
  32. --秋叶飘落: linear-gradient(-90deg, #fa709a 0%, #fee140 100%);
  33. --星空漫步: linear-gradient(-90deg, #30cfd0 0%, #330867 100%);
  34. --热带雨林: linear-gradient(-90deg, #43e97b 0%, #38f9d7 100%);
  35. --火焰燃烧: linear-gradient(-90deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
  36.  
  37. --日落色: linear-gradient(-90deg, #ff5e62cc 0%, #ff9966cc 50%, #ffcc66cc 100%);
  38. --海洋色: linear-gradient(-90deg, #00c9ffcc 0%, #92fe9dcc 100%);
  39. --星空色: linear-gradient(-90deg, #1e3c72cc 0%, #2a5298cc 100%);
  40. --森林色: linear-gradient(-90deg, #005a3ccc 0%, #35c24ecc 100%);
  41. --糖果色: linear-gradient(-90deg, #ff6b6bcc 0%, #f8b195cc 50%, #f67280cc 100%);
  42. --黎明色: linear-gradient(-90deg, #f953c6cc 0%, #b91dcc 100%);
  43. --霓虹色: linear-gradient(-90deg, #12c2eccc 0%, #c471edcc 50%, #f64f59cc 100%);
  44. --地平线色: linear-gradient(-90deg, #f7971ecc 0%, #ffd200cc 100%);
  45. --午夜蓝: linear-gradient(-90deg, #000428cc 0%, #004e92cc 100%);
  46. --火焰色: linear-gradient(-90deg, #fc466bcc 0%, #3f5efbcc 100%);
  47. }
  48. `);
  49.  
  50. if (document.getElementById('searchbox') == null) {
  51. return;
  52. }
  53. let dataHash;
  54. const gids = new Set();
  55.  
  56. const checkUrl = (async function () {
  57. const { response } = await GM.xmlHttpRequest({ url: 'http://localhost:23786/api/search?length=1000000' });
  58. const result = JSON.parse(response);
  59. if (result.hash === dataHash) {
  60. gids.forEach(gid => {
  61. const posted = document.getElementById(`posted_${gid}`);
  62. if (posted) {
  63. posted.style.borderColor = '#fff';
  64. posted.style.backgroundImage = `var(--${hightlightColor})`;
  65. }
  66. });
  67. return;
  68. } else {
  69. dataHash = result.hash;
  70. }
  71. result.data.forEach(manga => {
  72. try {
  73. const path = new URL(manga.url).pathname;
  74. const gid = path.split('/')[2]
  75. gids.add(gid);
  76. } catch (ignored) { }
  77. });
  78.  
  79. gids.forEach(gid => {
  80. const posted = document.getElementById(`posted_${gid}`);
  81. if (posted) {
  82. posted.style.borderColor = '#fff';
  83. posted.style.backgroundImage = `var(--${hightlightColor})`;
  84. }
  85. });
  86. });
  87.  
  88. setInterval(checkUrl, 10000);
  89. checkUrl();
  90. })();