Better MAL Favs

Choose how you want profile favorites to look like.

目前为 2024-06-06 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Better MAL Favs
  3. // @namespace https://greasyfork.org/en/users/670188-hacker09?sort=daily_installs
  4. // @version 10
  5. // @description Choose how you want profile favorites to look like.
  6. // @author hacker09 & Shishio-kun
  7. // @include /https:\/\/myanimelist\.net\/profile\/[^\/]+(\/)?$/
  8. // @icon https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://myanimelist.net&size=64
  9. // @grant GM_registerMenuCommand
  10. // @run-at document-end
  11. // @grant GM_getValue
  12. // @grant GM_setValue
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. GM_registerMenuCommand("Choose MAL Favs Styles", function() { //Creates a new function
  18. GM_setValue("Choice", prompt('1 Actual style showing all favs titles and names\n\n2 Vertical style\n\n3 Vertical style with big images\n\n4 Vertical style without franchise name/year\n\n5 Vertical style with big images and without franchise name/year\n*Write only your choice number and click OK')); //Gets the user input and defines the variable as the UserInput
  19. location.reload(); //Reloads the page
  20. }); //Adds an option to the menu and finishes the function
  21.  
  22. switch (GM_getValue("Choice")) {
  23. case undefined: //If the variable doesn't exist yet
  24. alert('Click on the TamperMonkey extension icon, and click on the button "Choose MAL Favs Styles", to chose how you want the MAL favs to look like by default.'); //Shows how to config the script
  25. break;
  26. case '1': //If the user chose option 1
  27. document.head.insertAdjacentHTML('beforeend', '<style>.fav-slide-block .fav-slide .btn-fav .link .title, .fav-slide-block .fav-slide .btn-fav .link .users {opacity: unset;}</style>'); //Show the titles by default
  28. break;
  29. case '2': //If the user chose option 2
  30. document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" href="https://userstyles.org/styles/221397.css"/>`); //Original MAL Favorites Style
  31. break;
  32. case '3': //If the user chose option 3
  33. document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" href="https://userstyles.org/styles/221398.css"/>`); //Original MAL Favorites Style (big pics version)
  34. break;
  35. case '4': //If the user chose option 4
  36. document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" href="https://userstyles.org/styles/221276.css"/>`); //Make Favorites Vertical Again! (Minimal/Small ver)
  37. break;
  38. case '5': //If the user chose option 5
  39. document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" href="https://userstyles.org/styles/221277.css"/>`); //Make Favorites Vertical Again! (Minimal/Big ver)
  40. break;
  41. } //Finishes the switch condition
  42. })();