Advertisement
ShaggyZE1

Better MAL Favs

Feb 9th, 2023
908
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.   var hide = '1'; //Define the fav info as visible
  18.   var CompaniesPosition = 'relative !important'; //Define the companies column position to show below all other tables
  19.   GM_registerMenuCommand("Choose MAL Favs Styles", function() { //Creates a new function
  20.     var UserInput = 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
  21.     GM_setValue("Choice", UserInput); //Defines the variable as the UserInput
  22.  
  23.     var UserInput2 = prompt('1 Allways move the companies table to the right.\n\n2 Show the companies table below all other tables\n*Write only your choice number and click OK'); //Gets the user input
  24.     GM_setValue("CompaniesTablePosition", UserInput2); //Defines the variable as the UserInput
  25.     location.reload(); //Reloads the page
  26.   }); //Adds an option to the menu and finishes the function
  27.  
  28.   if (GM_getValue("Choice") === undefined) { //If the variable doesn't exist yet
  29.     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
  30.   } //Finishes the if condition
  31.  
  32.   if (GM_getValue("Choice") === '1') { //If the user chose option 1
  33.     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
  34.   } //Finishes the if condition
  35.  
  36.   if (GM_getValue("Choice").match(/4|5/) !== null) { //If the user chose option 4 or 5
  37.     hide = '0'; //Hide the fav info
  38.   } //Finishes the if condition
  39.  
  40.   if (GM_getValue("CompaniesTablePosition") === '1' && document.querySelector("div.favmore").innerText.match('People ') !== null && GM_getValue("Choice") !== '1') { //If the user chose option 1 and the companies column is below all other columns, and if the user didn't choose option 1
  41.     CompaniesPosition = 'absolute !important'; //Define the companies column position to show below all other tables
  42.     document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" href="https://userstyles.org/styles/238158.css"/>`); //Make the companies column show on the right side By Shishio-kun style 238158
  43.   } //Finishes the if condition
  44.  
  45.   if (GM_getValue("Choice").match(/2|4/) !== null) { //If the user chose option 2 or 4
  46.     document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" https://userstyles.org/styles/221397.css"/>`); //Original Favorites Styles By Shishio-kun (style 221397)
  47.     document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" https://userstyles.org/styles/221276.css"/>`); //Original Favorites Styles By Shishio-kun (style 221276)
  48.   } //Finishes the if condition
  49.  
  50.   if (GM_getValue("Choice").match(/3|5/) !== null) { //If the user chose option 3 or 5
  51.     document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" href="https://userstyles.org/styles/221398.css"/>`); //Original Favorites Styles with bigger pics By Shishio-kun (style 221398)
  52.     document.head.insertAdjacentHTML("beforeend", `<link rel="stylesheet" href="https://userstyles.org/styles/221277.css"/>`); //Original Favorites Styles with bigger pics By Shishio-kun (style 221277)
  53.   } //Finishes the if condition
  54. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement