F95 Redesign

F95Zone Redesign

  1. // ==UserScript==
  2. // @name F95 Redesign
  3. // @namespace https://github.com/wandersons13/F95-Redesign
  4. // @version 0.5
  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. // @run-at document-start
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. const windowWidth = screen.width;
  16.  
  17. const style = document.createElement('style');
  18. style.innerHTML = `
  19. .pageContent {
  20. max-width: ${windowWidth * 0.95}px !important;
  21. max-height: 360px !important;
  22. transition: none !important;
  23. top: 110px !important;
  24. }
  25. .p-body-inner, .p-nav-inner {
  26. max-width: ${windowWidth * 0.95}px !important;
  27. transition: none !important;
  28. }
  29. .cover-hasImage {
  30. height: 360px !important;
  31. transition: none !important;
  32. }
  33. .highlight-unread {
  34. color: cyan;
  35. font-weight: bold;
  36. text-shadow: 1px 1px 2px black;
  37. }
  38. .p-sectionLinks,
  39. .uix_extendedFooter,
  40. .p-footer-inner,
  41. .view-thread.block--similarContents.block-container,
  42. .js-notices.notices--block.notices {
  43. display: none !important;
  44. }
  45. @media screen and (min-width: 1369px) {
  46. div#latest-page_items-wrap_inner.resource-wrap-game.grid-normal {
  47. grid-template-columns: repeat(5, 25%) !important;
  48. }
  49. div#latest-page_items-wrap {
  50. margin-left: -312px !important;
  51. }
  52. #latest-page_filter-wrap {
  53. margin-right: -312px !important;
  54. }
  55. }
  56. @media screen and (min-width: 1301px) and (max-width: 1366px) {
  57. div#latest-page_items-wrap_inner.resource-wrap-game.grid-normal {
  58. grid-template-columns: repeat(4, 20%) !important;
  59. }
  60. div#latest-page_items-wrap {
  61. margin-left: -45px !important;
  62. }
  63. #latest-page_filter-wrap {
  64. margin-left: -155px !important;
  65. }
  66. }
  67. `;
  68. document.documentElement.appendChild(style);
  69.  
  70. const highlightUnreadLinks=()=> {
  71. const links=document.querySelectorAll('a');
  72.  
  73. for (const link of links) {
  74. const text=link.textContent.trim().toLowerCase();
  75. const buttonText=link.querySelector('.button-text');
  76.  
  77. if (link.href.includes('/unread?new=1') || text==='jump to new' || (buttonText && buttonText.textContent.trim().toLowerCase()==='jump to new')) {
  78. link.classList.add('highlight-unread');
  79. if (buttonText) buttonText.classList.add('highlight-unread');
  80. }
  81. }
  82. }
  83.  
  84. ;
  85.  
  86. if (document.readyState === 'loading') {
  87. document.addEventListener('DOMContentLoaded', highlightUnreadLinks, { once: true });
  88. } else {
  89. highlightUnreadLinks();
  90. }
  91. })();