F95 Redesign

F95Zone Redesign

目前为 2025-01-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name F95 Redesign
  3. // @namespace https://github.com/wandersons13/F95-Redesign
  4. // @version 0.3
  5. // @description F95Zone Redesign
  6. // @author wandersons13
  7. // @match https://f95zone.to/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=f95zone.to
  9. // @license GNU
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. const addCustomStyles = () => {
  17. const style = document.createElement('style');
  18. style.innerHTML = `
  19. .pageContent {
  20. max-width: ${window.innerWidth * 0.95}px !important;
  21. max-height: 360px !important;
  22. transition: none !important;
  23. top: 110px !important;
  24. }
  25. .p-body-inner {
  26. max-width: ${window.innerWidth * 0.95}px !important;
  27. transition: none !important;
  28. }
  29. .p-nav-inner {
  30. max-width: ${window.innerWidth * 0.95}px !important;
  31. transition: none !important;
  32. }
  33. .cover-hasImage {
  34. height: 360px !important;
  35. transition: none !important;
  36. }
  37. @media screen and (min-width: 1369px) {
  38. div#latest-page_items-wrap_inner.resource-wrap-game.grid-normal {
  39. grid-template-columns: repeat(5, 25%) !important;
  40. }
  41. div#latest-page_items-wrap {
  42. margin-left: -312px !important;
  43. }
  44. #latest-page_filter-wrap {
  45. margin-right: -312px !important;
  46. }
  47. }
  48. @media screen and (min-width: 1301px) and (max-width: 1366px) {
  49. div#latest-page_items-wrap_inner.resource-wrap-game.grid-normal {
  50. grid-template-columns: repeat(4, 20%) !important;
  51. }
  52. div#latest-page_items-wrap {
  53. margin-left: -45px !important;
  54. }
  55. #latest-page_filter-wrap {
  56. margin-left: -155px !important;
  57. }
  58. }
  59. `;
  60. document.head.appendChild(style);
  61. };
  62.  
  63. const highlightUnreadLinks = () => {
  64. const links = document.querySelectorAll('a');
  65. links.forEach(link => {
  66. if (link.href.includes('/unread?new=1')) {
  67. const buttonText = link.querySelector('.button-text');
  68. if (buttonText) {
  69. buttonText.style.setProperty('color', 'cyan', 'important');
  70. buttonText.style.fontWeight = 'bold';
  71. buttonText.style.textShadow = '1px 1px 2px black';
  72. }
  73. }
  74. });
  75. };
  76.  
  77. const applyUblockFilters = () => {
  78. const filters = [
  79. '.p-sectionLinks',
  80. '.uix_extendedFooter',
  81. '.p-footer-inner',
  82. '.view-thread.block--similarContents.block-container',
  83. '.js-notices.notices--block.notices'
  84. ];
  85.  
  86. filters.forEach(selector => {
  87. const elements = document.querySelectorAll(selector);
  88. elements.forEach(el => {
  89. el.style.display = 'none';
  90. });
  91. });
  92. };
  93.  
  94. addCustomStyles();
  95. highlightUnreadLinks();
  96. applyUblockFilters();
  97. })();