hinatazaka46-process

Perform base processing

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/532854/1595984/hinatazaka46-process.js

  1. // ==UserScript==
  2. // @name hinatazaka46-process
  3. // @namespace https://gf.qytechs.cn/ja/users/1328592-naoqv
  4. // @description Perform base processing
  5. // @description:ja 基底処理を実行
  6. // @version 0.14
  7. // @icon https://cdn.hinatazaka46.com/files/14/hinata/img/favicons/favicon-32x32.png
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. const pageTypeMatch = (x = location.href) => (x).match(/(news|media|detail|search|formation|diary\/member\/list|diary\/member|diary\/detail|artist\/00|artist|greeting|biography|video|contents|discography|aimashou|event|about_fanclub)/);
  13.  
  14. const getPageType = (x = location.href) => (x).match(/contents_list/) ? "contents"
  15. : pageTypeMatch(x) ? pageTypeMatch(x)[0] : "other";
  16.  
  17. let id;
  18. let count = 0;
  19.  
  20. const replaceLang = () => {
  21.  
  22. const langSelect = document.getElementById('wovn-translate-widget');
  23. if (count >= 10) {
  24. clearInterval(id);
  25. }
  26. if (langSelect) {
  27. langSelect.style.top = "5px";
  28. document.querySelector('.wovn-lang-selector').style.height = "25px";
  29. document.querySelector('.wovn-lang-selector-links').style.paddingTop = "5px";
  30. clearInterval(id);
  31. }
  32. count++;
  33. };
  34.  
  35.  
  36. const doProcess = (proc, scriptName) => {
  37. handleException(proc, scriptName);
  38.  
  39. handleException(() => {
  40. const colorMode = getColorMode();
  41.  
  42. initializeColorToggle(colorMode);
  43.  
  44. analyzeDefaultColor();
  45. setColor(getPageType(), colorMode);
  46.  
  47. }, "HinatazakaBaseProcessor");
  48. id = setInterval(replaceLang, 200);
  49. };

QingJ © 2025

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