// ==UserScript==
// @name Aniscripts
// @namespace http://tampermonkey.net/
// @version 3.50
// @description Change stuff on Anilist.co
// @author hoh
// @match https://anilist.co/*
// @grant none
// @license GPLv3
// @downloadURL none
// ==/UserScript==
(function(){
"use strict";
const scriptInfo = {
"version" : "3.50",
"link" : "https://greasyfork.org/en/scripts/370473-aniscripts",
"author" : "hoh",
"authorLink" : "https://anilist.co/user/hoh/",
"license" : "GPLv3",
"language" : "Decensored JAVscript"
};
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
*/
/*
Aniscripts, sometimes just "the userscript", is modular and contains of several independet functions
The URL matching controller can be found near the bottom of this file.
Anilist runs on a framework of its own, which mostly avoids reloading the page. (instead it modifies popstate etc.)
Therefore, this script does the following:
1. Runs a clock checking if the URL has changed
2. Runs the modules relevant to that URL.
Some care must be taken checking if an instance of a module is already running, or if the page content has loaded yet.
An ambitious person could try changing those into mutationObserver or something, but it works fine as is.
"useScripts" contains the defauls for the various modules. This is stored in the user's localStorage.
*/
//a shared style node for all the modules. All classes are prefixed by "hoh" to avoid collisions with native Anilist classes
var style = document.createElement("style");
style.type = "text/css";
//most of these are used by the notification module
//The default colour is rgb(var(--color-blue)) provided by Anilist, but rgb(var(--color-green)) is preferred for things related to manga
style.innerHTML = `
.hohTime{
position: static;
float: right;
margin-right: 20px;
margin-top: 10px;
margin-left: auto;
font-size: 1.1rem;
}
.hohUnread{
border-right: 8px;
border-color: rgba(var(--color-blue));
border-right-style: solid;
}
.hohNotification{
margin-bottom: 10px;
background: rgb(var(--color-foreground));
border-radius: 4px;
justify-content: space-between;
line-height: 0;
min-height: 72px;
}
.hohNotification *{
line-height: 1.15;
}
.hohUserImageSmall{
display: inline-block;
background-position: 50%;
background-repeat: no-repeat;
background-size: cover;
position: absolute;
}
.hohUserImage{
height: 72px;
width: 72px;
display: inline-block;
background-position: 50%;
background-repeat: no-repeat;
background-size: cover;
position: absolute;
}
.hohMediaImage{
height: 70px;
margin-right: 5px;
}
.hohMessageText{
position: absolute;
margin-top: 30px;
margin-left: 80px;
max-width: 330px;
}
.hohMediaImageContainer{
vertical-align: bottom;
margin-left: 400px;
display: inline;
position: relative;
display: inline-block;
min-height: 70px;
}
.hohMediaImageContainer > a{
height: 70px;
line-height: 0!important;
}
span.hohMediaImageContainer{
line-height: 0!important;
}
.hohCommentsContainer{
margin-top: 5px;
}
.hohCommentsArea{
margin: 10px;
display: none;
padding-bottom: 2px;
margin-top: 5px;
width: 95%;
}
.hohComments{
float: right;
display: none;
margin-top: -30px;
margin-right: 15px;
cursor: pointer;
margin-left: 600px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.hohCombined .hohComments{
display: none!important;
}
.hohQuickCom{
padding: 5px;
background-color: rgb(var(--color-background));
margin-bottom: 5px;
position: relative;
}
.hohQuickComName{
margin-right: 15px;
color: rgb(var(--color-blue));
}
.hohThisIsMe{
color: rgb(var(--color-green));
}
.hohILikeThis{
color: rgb(var(--color-red));
}
.hohQuickComName::after{
content: ":";
}
.hohQuickComContent{
margin-right: 40px;
display: block;
}
.hohQuickComContent > p{
margin: 1px;
}
.hohQuickComLikes{
position: absolute;
right: 5px;
bottom: 5px;
display: inline-block;
}
.hohQuickComContent img {
max-width: 100%;
}
.hohSpoiler::before{
color: rgb(var(--color-blue));
cursor: pointer;
background: rgb(var(--color-background));
border-radius: 3px;
content: "Spoiler, click to view";
font-size: 1.3rem;
padding: 0 5px;
}
.hohSpoiler.hohClicked::before{
display: none;
}
.hohSpoiler > span{
display: none;
}
.hohMessageText > span > div.time{
display: none;
}
.hohUnhandledSpecial > div{
margin-top: -20px;
}
.hohMonospace{
font-family: monospace;
}
.hohSocialTabActivityCompressedContainer{
min-width: 480px;
}
.hohSocialTabActivityCompressedStatus{
vertical-align: middle;
padding-bottom: 7px;
}
.hohSocialTabActivityCompressedName{
vertical-align: middle;
margin-left: 3px;
}
.hohForumHider{
margin-right: 3px;
cursor: pointer;
font-family: monospace;
}
.hohForumHider:hover{
color: rgb(var(--color-blue));
}
.hohBackgroundCover{
height: 70px;
width: 50px;
display: inline-block;
background-repeat: no-repeat;
background-size: cover;
margin-top: 1px;
line-height: 0;
margin-bottom: 1px;
}
#hohDescription{
width: 280px;
height: 150px;
float: left;
color: rgb(var(--color-blue));
}
.hohStatsTrigger{
cursor: pointer;
border-radius: 3px;
color: rgb(var(--color-text-lighter));
display: block;
font-size: 1.4rem;
margin-bottom: 8px;
padding: 5px 10px;
}
.hohActive{
background: rgba(var(--color-foreground),.8);
color: rgb(var(--color-text));
font-weight: 500;
}
#hohFavCount{
position: absolute;
right: 30px;
color: rgba(var(--color-red));
top: 10px;
font-weight: 400;
}
.hohShamelessLink{
display: block;
margin-bottom: 5px;
}
.hohSlidePlayer{
display: block;
position: relative;
width: 500px;
}
.hohSlide{
position: absolute;
top: 0px;
font-size: 500%;
height: 100%;
display: flex;
align-items: center;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
opacity:0.5;
}
.hohSlide:hover{
background-color: rgb(0,0,0,0.4);
cursor: pointer;
opacity:1;
}
.hohRightSlide{
right: 0px;
padding-left: 10px;
padding-right: 20px;
}
.hohLeftSlide{
left: 0px;
padding-left: 20px;
padding-right: 10px;
}
.hohShare{
position: absolute;
right: 12px;
top: 30px;
cursor: pointer;
color: rgb(var(--color-blue-dim));
}
.activity-entry{
position: relative;
}
.hohEmbed{
border-style: solid;
border-color: rgb(var(--color-text));
border-width: 1px;
padding: 15px;
position: relative;
}
.hohEmbed .avatar{
border-radius: 3px;
height: 40px;
width: 40px;
background-position: 50%;
background-repeat: no-repeat;
background-size: cover;
display: inline-block;
}
.hohEmbed .name{
display: inline-block;
height: 40px;
line-height: 40px;
vertical-align: top;
color: rgb(var(--color-blue));
font-size: 1.4rem;
margin-left: 12px !important;
}
.hohEmbed .time{
color: rgb(var(--color-text-lighter));
font-size: 1.1rem;
position: absolute;
right: 12px;
top: 12px;
}
.hohRecsLabel{
color: rgb(var(--color-blue)) !important;
}
.hohRecsItem{
margin-top: 5px;
margin-bottom: 10px;
}
.hohTaglessLinkException{
display: block;
}
.hohTaglessLinkException::after{
content: ""!important;
}
.hohStatValue{
color: rgb(var(--color-blue));
}
.markdown-editor > [title="Image"],
.markdown-editor > [title="Youtube Video"],
.markdown-editor > [title="WebM Video"]{
color: rgba(var(--color-red));
}
.hohBackgroundUserCover{
height: 70px;
width: 70px;
display: inline-block;
background-position: 50%;
background-repeat: no-repeat;
background-size: cover;
margin-top: 1px;
margin-bottom: 1px;
}
.history-day.lv-9{
z-index:1!important
}
.hohRegularTag{
border-style: solid;
border-width: 1px;
border-radius: 3px;
padding: 2px;
margin-right: 3px;
}
.hohCross{
cursor: pointer;
margin-left: 2px;
color: red;
}
.hohFavCountBrowse{
color: white;
position: absolute;
right: 2px;
font-size: 60%;
opacity: 0.7;
}
.hohColourPicker{
position: absolute;
right: 60px;
margin-top: -110px;
}
.hohColourPicker h2{
color: #3db4f2;
font-size: 1.6rem;
font-weight: 400;
padding-bottom: 12px;
}
.hohSecondaryRow{
background-color: rgb(var(--color-background));
}
.hohSecondaryRow:hover{
background-color: rgb(var(--color-foreground));
}
.media-preview-card meter{
width: 150px;
margin-bottom: 5px;
}
.hohForumLink{
color: rgb(var(--color-text-lighter));
display: inline-block;
margin: 0 10px;
padding: 15px;
cursor: pointer;
}
#hohForumContent{
margin-top: 20px;
}
.hohThreadsBody{
width: 600px;
}
.hohThreadCard{
margin: 15px;
padding: 18px;
background-color: rgb(var(--color-foreground));
width: 470px;
height: 90px;
position: relative;
border-radius: 4px;
}
.hohThreadCard .title{
cursor: pointer;
margin-right: 110px;
width: 360px;
font-size: 1.4rem;
}
.hohThreadCard .info{
color: rgb(var(--color-text-lighter));
font-size: 1.2rem;
position: absolute;
right: 12px;
top: 12px;
}
.hohThreadCard .info span{
padding-left: 10px;
}
.hohThreadCard .category{
border-radius: 100px;
color: #fff;
display: inline-block;
font-size: 1.1rem;
margin-left: 10px;
padding: 4px 8px;
text-transform: lowercase;
position: absolute;
right: 15px;
bottom: 20px;
cursor: pointer;
}
.hohThreadCard .category:hover{
color: black;
}
.hohThreadCard .threadReply{
position: absolute;
left: 20px;
bottom: 20px;
font-size: 1.3rem;
}
.hohThreadCard .threadReply .user{
color: rgb(var(--color-blue));
}
.tags .tag{
min-height: 35px;
margin-bottom: 5px !important;
}
.studio .favourite{
position: absolute;
top: 30px;
right: 30px;
}
.filter .view-all{
background-color: rgb(var(--color-foreground));
height: 32px;
border-radius: 3px;
text-align: center;
padding-top: 8px;
}
#dubNotice{
font-size: 12px;
font-weight: 500;
text-align: center;
text-transform: capitalize;
background: rgb(var(--color-foreground));
margin-top: 0em;
margin-bottom: 16px;
border-radius: 3px;
padding: 8px 12px;
}
`;
document.getElementsByTagName("head")[0].appendChild(style);
//Todo: find out how to parse API headers for an accurate result
document.APIcallsUsed = 0;//this is NOT a reliable way to figure out how many more calls we can use, just a way to set some limit
var pending = {};
var APIcounter = setTimeout(function(){
document.APIcallsUsed = 0;
},60*1000);//reset counter every minute
var localStorageAvailable;//localStorage is great for not having to fetch the api data every time
var test = "test";
try{
localStorage.setItem(test,test);
localStorage.removeItem(test);
localStorageAvailable = true;
}
catch(e){
localStorageAvailable = false;
}
if(localStorageAvailable){
var aniscriptsUsed = localStorage.getItem("aniscriptsUsed");
if(aniscriptsUsed === null){
aniscriptsUsed = {
keys : []
};
}
else{
aniscriptsUsed = JSON.parse(aniscriptsUsed);
}
localStorage.setItem("aniscriptsUsed",JSON.stringify(aniscriptsUsed));
}
var useScripts = {//most modules are turned on by default
notifications : true,
socialTab : true,
forumComments : true,
staffPages : true,
tagDescriptions : true,
completedScore : true,
moreStats : true,
characterFavouriteCount : true,
studioFavouriteCount : true,
CSSfavs : true,
CSScompactBrowse : true,
CSSmangaGreen: false,
CSSfollowCounter: true,
CSSsubmissionCounter: false,
CSSprofileClutter: false,
CSSdecimalPoint: false,
CSSverticalNav: false,
hideLikes: false,
dubMarker: false,
CSSstudioStats: true,
CSS3d: false,
CSSsmileyScore: true,
colourPicker: true,
colourSettings: [],
mangaBrowse: false,
progressBar: false,
replaceNativeTags: true,
dubMarkerLanguage: "English"
};
var forceRebuildFlag = false;
if(localStorageAvailable){
const useScriptsSettings = JSON.parse(localStorage.getItem("hohSettings"));
if(useScriptsSettings){
var keys = Object.keys(useScriptsSettings);
keys.forEach(function(key){//this is to keep the default settings if the version in local storage is outdated
useScripts[key] = useScriptsSettings[key];
});
}
localStorage.setItem("hohSettings",JSON.stringify(useScripts));
}
var whoAmI = "";
//replace with query selector?
try{//use later for some scripts
whoAmI = document.getElementById("nav").children[0].children[1].children[1].href.match(/[\w\-]*\/$/)[0].slice(0,-1);//looks at the nav
}
catch(err){
console.log("could not get username");
}
const svgAssets = {
envelope : "✉",
cross : "✕",
frown : `
`,
meh : `
`,
smile : `
`,
star : `
`,
//the column sorting arrow
angleDown : `
`,
view : `
`,
reply : `
`,
repeat : `
`
};
if(useScripts.mangaBrowse){
const navLinks = document.querySelector(".links");
for(var i=0;i .wrap > .footer > .container");
if(colourPickerLocation){
const supportedColours = [
"--color-background",
"--color-foreground",
"--color-foreground-grey",
"--color-foreground-grey-dark",
"--color-foreground-blue",
"--color-foreground-blue-dark",
"--color-background-blue-dark",
"--color-overlay",
"--color-shadow",
"--color-shadow-dark",
"--color-text",
"--color-text-light",
"--color-text-lighter",
"--color-text-bright",
"--color-blue",
"--color-blue-dim",
"--color-white",
"--color-black",
"--color-red",
"--color-peach",
"--color-orange",
"--color-yellow",
"--color-green"
];
var colourChanger = function(){
for(var i=0;i a" + dataSelect;
moreStyle.innerHTML += ",a.title" + dataSelect;
moreStyle.innerHTML += ",.media-preview-card a.title" + dataSelect;
moreStyle.innerHTML += ",.quick-search-results .el-select-dropdown__item a" + dataSelect + "> span";
moreStyle.innerHTML += ",.media-embed" + dataSelect + " .title";
moreStyle.innerHTML += ",.status > a" + dataSelect;
moreStyle.innerHTML += "{visibility: hidden;font-size:10%;}";
moreStyle.innerHTML += ".title > a" + dataSelect + "::before";
moreStyle.innerHTML += ",a.title" + dataSelect + "::before";
moreStyle.innerHTML += ",.quick-search-results .el-select-dropdown__item a" + dataSelect + " > span::before";
moreStyle.innerHTML += ",.status > a" + dataSelect + "::before";
moreStyle.innerHTML += "{content:'" + alias[1].substring(0,Math.min(100,alias[1].length)) + "';visibility:visible;font-size:1000%;}";
moreStyle.innerHTML += ".media-embed" + dataSelect + " .title::before{content:'" + alias[1].substring(0,Math.min(100,alias[1].length)) + "';visibility:visible;font-size:1.3rem;}";
moreStyle.innerHTML += ".media-preview-card a.title" + dataSelect + "::before{content:'" + alias[1].substring(0,Math.min(100,alias[1].length)) + "';visibility:visible;font-size:1.4rem;}";
}
});
}
}
if(useScripts.CSSfavs){
let favStudioString = `
.favourites > div > .wrap > div,
.favourites > div > .wrap > a{
/*make the spaces in the grid even*/
margin-bottom: 0px!important;
margin-right: 0px!important;
column-gap: 10px!important;
}
.user .overview{
grid-template-columns: 460px auto!important;
}
.favourites > div > .wrap{
padding: 0px!important;
display: grid;
grid-gap: 10px;
column-gap: 10px!important;
grid-template-columns: repeat(auto-fill,85px);
grid-template-rows: repeat(auto-fill,115px);
background: rgb(0,0,0,0) !important;
width: 470px;
}
.favourite.studio{
cursor: pointer;
min-height: 115px;
font-size: 15px;
display: grid;
grid-gap: 10px;
padding: 2px!important;
padding-top: 8px!important;
background-color: rgba(var(--color-foreground))!important;
text-align: center;
align-content: center;
}
.site-theme-dark .favourite.studio{
background-color: rgb(49,56,68)!important;
}
.favourite.studio::after{
display: inline-block;
background-repeat: no-repeat;
content:"";
margin-left:5px;
background-size: 76px 19px;
width: 76px;
height: 19px;
}
`;
/*adds a logo to most favourite studio entries. Add more if needed */
const favStudios = [
[11, "MADHOUSE","https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Madhouse_studio_logo.svg/300px-Madhouse_studio_logo.svg.png"],
[4, "BONES","https://i.stack.imgur.com/7pRQn.png"],
[14, "Sunrise","https://upload.wikimedia.org/wikipedia/en/thumb/8/8c/Sunrise_company_logo.svg/220px-Sunrise_company_logo.svg.png"],
[32, "Manglobe","https://i.stack.imgur.com/alV3I.gif"],
[287, "David-Production","https://upload.wikimedia.org/wikipedia/en/thumb/7/75/David_production.jpg/220px-David_production.jpg",76,30],
[6, "Gainax","https://upload.wikimedia.org/wikipedia/en/thumb/a/a8/Gainax_logo.svg/220px-Gainax_logo.svg.png"],
[150, "Sanrio","https://upload.wikimedia.org/wikipedia/en/thumb/4/41/Sanrio_logo.svg/220px-Sanrio_logo.svg.png"],
[18, "Toei-Animation","https://i.stack.imgur.com/AjzVI.png",76,30],
[34, "Hal-Film-Maker","https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Hal_film_maker_logo.gif/220px-Hal_film_maker_logo.gif"],
[68, "Mushi-Productions","https://i.stack.imgur.com/HmYdT.jpg"],
[21, "Studio-Ghibli","https://upload.wikimedia.org/wikipedia/en/thumb/c/ca/Studio_Ghibli_logo.svg/220px-Studio_Ghibli_logo.svg.png",76,30],
[13, "Studio-4C","https://upload.wikimedia.org/wikipedia/en/e/ec/Studio_4C_logo.png"],
[2, "Kyoto-Animation","https://upload.wikimedia.org/wikipedia/en/thumb/b/bf/Kyoto_Animation_logo.svg/250px-Kyoto_Animation_logo.svg.png"],
[44, "Shaft","https://i.stack.imgur.com/tuqhK.png"],
[803, "Trigger","https://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Trigger_Logo.svg/220px-Trigger_Logo.svg.png"],
[7, "JC-Staff","https://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/J.C.Staff_Logo.svg/220px-J.C.Staff_Logo.svg.png"],
[102, "FUNimation-Entertainment","https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/Funimation_2016.svg/320px-Funimation_2016.svg.png"],
[132, "PA-Works","https://i.stack.imgur.com/7kjSn.png"],
[6145,"Science-SARU","https://i.stack.imgur.com/zo9Fx.png"],
[22, "Nippon-Animation","https://upload.wikimedia.org/wikipedia/en/thumb/b/b4/Nippon.png/200px-Nippon.png"],
[73, "TMS-Entertainment","https://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/TMS_Entertainment_logo.svg/220px-TMS_Entertainment_logo.svg.png"],
[65, "Tokyo-Movie-Shinsha","https://upload.wikimedia.org/wikipedia/en/2/22/Tokyo_Movie_Shinsha.png"],
[8, "Artland","https://upload.wikimedia.org/wikipedia/en/thumb/a/ae/Artland_logo.gif/200px-Artland_logo.gif"],
[569, "MAPPA","https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/MAPPA_Logo.svg/220px-MAPPA_Logo.svg.png"],
[314, "White-Fox","https://i.stack.imgur.com/lwG1T.png",76,30],
[10, "Production-IG","https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Production_I.G_Logo.svg/250px-Production_I.G_Logo.svg.png"],
[112, "Brains-Base","https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Brain%27s_Base_logo.png/200px-Brain%27s_Base_logo.png"],
[561, "A1-Pictures","https://i.stack.imgur.com/nBUYo.png",76,30],
[43, "Ufotable","https://upload.wikimedia.org/wikipedia/en/5/56/Ufotable-Logo.png",76,30],
[858, "Wit-Studio","https://i.stack.imgur.com/o3Rro.png",76,30],
[47, "Studio-Khara","https://i.stack.imgur.com/2d1TT.png",76,30],
[1, "Studio-Pierrot","https://upload.wikimedia.org/wikipedia/en/thumb/1/10/Studio_Pierrot.jpg/220px-Studio_Pierrot.jpg"],
[436, "AIC-Build","https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/AIC_logo.png/220px-AIC_logo.png"],
[48, "AIC", "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/AIC_logo.png/220px-AIC_logo.png"],
[3, "GONZO","https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Gonzo_company.png/220px-Gonzo_company.png"],
[300, "SILVER-LINK","https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/Silver_Link_Logo.svg/220px-Silver_Link_Logo.svg.png"],
[456, "Lerche","https://i.stack.imgur.com/gRQPc.png"],
[291, "CoMix-wave","https://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/Cwflogo.png/150px-Cwflogo.png"],
[95, "Doga-Kobo","https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Doga_Kobo_Logo.svg/220px-Doga_Kobo_Logo.svg.png"],
[290, "Kinema-Citrus","https://upload.wikimedia.org/wikipedia/commons/c/c0/Kinema_Citrus_logo.png",76,25],
[333, "TYO-Animations","https://i.stack.imgur.com/KRqAp.jpg",76,25],
[41, "Satelight","https://i.stack.imgur.com/qZVQg.png",76,30],
[6069,"Studio-3Hz","https://i.stack.imgur.com/eD0oe.jpg"],
[911, "Passione","https://i.stack.imgur.com/YyEGg.jpg"],
[418, "Studio-Gokumi","https://i.stack.imgur.com/w1y22.png"],
[51, "diomeda","https://i.stack.imgur.com/ZHt3T.jpg"],
[91, "feel","https://upload.wikimedia.org/wikipedia/en/thumb/0/07/Feel_%28company%29_logo.png/220px-Feel_%28company%29_logo.png",76,25],
[36, "Studio-Gallop","https://upload.wikimedia.org/wikipedia/commons/3/37/Studio_Gallop.png"],
[537, "SANZIGEN","https://i.stack.imgur.com/CkuqH.png",76,30],
[35, "Seven-Arcs","https://upload.wikimedia.org/wikipedia/en/a/ac/Seven_Arcs_logo.png",76,25],
[6222,"CloverWorks","https://i.stack.imgur.com/9Fvr7.jpg"],
[144, "Pony-Canyon","https://i.stack.imgur.com/9kkew.png"],
[17, "Aniplex","https://upload.wikimedia.org/wikipedia/commons/thumb/3/37/Aniplex_logo.svg/220px-Aniplex_logo.svg.png"],
[493, "Aniplex-of-America","https://upload.wikimedia.org/wikipedia/commons/thumb/3/37/Aniplex_logo.svg/220px-Aniplex_logo.svg.png"],
[555, "Studio-Chizu","http://www.studio-chizu.jp/images/logo.gif"],
[37, "Studio-DEEN","https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/Studio_Deen_logo.svg/220px-Studio_Deen_logo.svg.png"],
[159, "Kodansha","https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Kodansha.png/200px-Kodansha.png"],
[437, "Kamikaze-Douga","https://img7.anidb.net/pics/anime/178777.jpg"],
[459, "Nitroplus","https://upload.wikimedia.org/wikipedia/en/thumb/0/09/Nitroplus_logo.png/220px-Nitroplus_logo.png"],
[166, "Movic","https://upload.wikimedia.org/wikipedia/commons/f/f3/Movic_logo.png"],
[38, "Arms","https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Arms_Corporation.png/200px-Arms_Corporation.png"],
[247, "ShinEi-Animation","https://i.stack.imgur.com/b2lcL.png"],
[6235,"SEK-Studio","https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Flag_of_North_Korea.svg/125px-Flag_of_North_Korea.svg.png",74,25],
[58, "Square-Enix","https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Square_Enix_logo.svg/230px-Square_Enix_logo.svg.png"],
[503, "Nintendo-Co-Ltd","https://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/Nintendo.svg/220px-Nintendo.svg.png"],
[167, "Sega","https://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Sega_logo.svg/200px-Sega_logo.svg.png"],
[193, "Idea-Factory","https://upload.wikimedia.org/wikipedia/en/e/eb/Idea_factory.gif"],
[6077,"Orange","http://www.orange-cg.com/img/common/logo.gif"],
[309, "GoHands","https://i.stack.imgur.com/pScIZ.jpg"],
[104, "Lantis","https://upload.wikimedia.org/wikipedia/commons/3/39/Lantis_logo.png"],
[6071,"Studio-Shuka","https://upload.wikimedia.org/wikipedia/commons/f/fa/Shuka_studio.jpg"],
[53, "Dentsu","https://upload.wikimedia.org/wikipedia/commons/thumb/1/10/Dentsu_logo.svg/200px-Dentsu_logo.svg.png"],
[143, "Mainichi-Broadcasting","https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Mainichi_Broadcasting_System_logo.svg/200px-Mainichi_Broadcasting_System_logo.svg.png"],
[376, "Sentai-Filmworks","https://upload.wikimedia.org/wikipedia/commons/thumb/4/4b/Sentai_Filmworks_Official_Logo.jpg/220px-Sentai_Filmworks_Official_Logo.jpg"],
[681, "ASCII-Media-Works","https://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/ASCII_Media_Works_logo.svg/220px-ASCII_Media_Works_logo.svg.png"],
[334, "Ordet","https://i.stack.imgur.com/evr12.png",76,30],
[238, "ATX","https://upload.wikimedia.org/wikipedia/commons/thumb/c/c6/AT-X_logo.svg/150px-AT-X_logo.svg.png",76,30],
[66, "Key","https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Key_Visual_Arts_Logo.svg/167px-Key_Visual_Arts_Logo.svg.png",76,25],
[145, "TBS","https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/TBS_logo.svg/200px-TBS_logo.svg.png"],
[108, "Media-Factory","https://i.stack.imgur.com/rR7yU.png",76,25],
[346, "Hoods-Entertainment","https://i.stack.imgur.com/p7S0I.png"],
[6142,"Geno-Studio","https://upload.wikimedia.org/wikipedia/en/thumb/f/f4/Genostudio.jpg/220px-Genostudio.jpg",76,25],
[4418,"8bit","https://upload.wikimedia.org/wikipedia/en/e/ea/8-Bit_Animation_Studio.png"],
[113, "Kadokawa-Shoten", "https://i.stack.imgur.com/ZsUDR.gif"],
[262, "Kadokawa-Pictures-USA", "https://i.stack.imgur.com/ZsUDR.gif"],
[352, "Kadokawa-Pictures-Japan","https://i.stack.imgur.com/ZsUDR.gif"]
];
favStudios.forEach(function(studio){
favStudioString += ".favourite.studio[href=\"/studio/" + studio[0] + "/" + studio[1] + "\"]::after{background-image: url(\"" + studio[2] + "\");"
if(studio.length === 5){
favStudioString += "background-size: " + studio[3] + "px " + studio[4] + "px;width: " + studio[3] + "px;height: " + studio[4] + "px;";
}
favStudioString += "}";
});
moreStyle.innerHTML += favStudioString;
}
if(useScripts.CSScompactBrowse){
moreStyle.innerHTML += `
.search-page-unscoped.container{
padding-left: 10px;
padding-right: 0px;
}
.search-page-unscoped .description{
display:none;
}
body,.search-page-unscoped .preview-section{
counter-reset: ranking;
}
.search-page-unscoped .data::before {
left:2px;
opacity:0.4;
font-size:70%;
position:absolute;
counter-increment: ranking;
content: counter(ranking);
}
.search-page-unscoped .media-card{
min-width:150px!important;
grid-template-columns: 150px auto!important;
height: 297px!important;
width: 150px !important;
}
.search-page-unscoped .cover .overlay{
padding-left:8px!important;
padding-right:8px!important;
padding-top:4px!important;
}
.search-page-unscoped .grid-wrap > .media-card{
margin-left:30px;
}
.search-page-unscoped .media-card .cover{
width:150px;
height:215px;
margin-top:53px;
z-index: 100;
}
.search-page-unscoped .data{
margin-left: -150px;
}
.search-page-unscoped .genres{
min-height:29px;
z-index: 101;
padding: 8px 5px!important;
padding-bottom: 2px !important;
font-size: 1rem!important;
line-height: 1.15;
}
.search-page-unscoped .list-edit{
z-index: 101;
}
.search-page-unscoped .airing-countdown{
padding: 5px!important;
}
.search-page-unscoped .grid-wrap{
grid-template-columns: repeat(auto-fill, 150px) !important;
}
.search-page-unscoped .media{
grid-template-columns: repeat(auto-fill, 150px) !important;
width:100%;
}
.search-page-unscoped .overlay .studio{
margin-top: 2px!important;
margin-bottom: -8px!important;
}
.search-page-unscoped .list-status{
width: 20px!important;
height: 20px!important;
}
.search-page-unscoped .media-card:nth-child(5){
display: inline-grid!important;
}
`;
}
if(useScripts.CSSsubmissionCounter){
moreStyle.innerHTML += `
.submissions-wrap{
counter-reset: acceptedCount partialCount pendingCount rejectedCount;
}
.submissions-wrap .submission .status.accepted{
counter-increment: acceptedCount;
}
.submissions-wrap .submission .status.accepted::after{
content: counter(acceptedCount);
}
.submissions-wrap .submission .status.pending{
counter-increment: pendingCount;
}
.submissions-wrap .submission .status.pending::after{
content: counter(pendingCount);
}
.submissions-wrap .submission .status.partially_accepted{
counter-increment: partialCount;
}
.submissions-wrap .submission .status.partially_accepted::after{
content: counter(partialCount);
}
.submissions-wrap .submission .status.rejected{
counter-increment: rejectedCount;
}
.submissions-wrap .submission .status.rejected::after{
content: counter(rejectedCount);
}
.submissions-wrap::after{
content: "pending: " counter(pendingCount) ", accepted: " counter(acceptedCount) ", partially accepted: " counter(partialCount) ", rejected: " counter(rejectedCount);
}
`;
}
if(useScripts.CSSprofileClutter){
moreStyle.innerHTML += `
.overview .list-stats > .footer{
display: none;
}
.overview > .section > .desktop:nth-child(2){
display: none;
}
.overview > .section > .desktop:nth-child(3){
display: none;
}
.overview > .section > .desktop.favourites{
display: inherit;
}
`;
}
if(useScripts.CSSfollowCounter){
moreStyle.innerHTML += `
.user-social .user-follow > div.wrap{
grid-template-columns: repeat(auto-fill,75px)!important;
grid-template-rows: repeat(auto-fill,75px)!important;
}
body{
counter-reset: followCount;
}
.user-social .user-follow .user{
counter-increment: followCount;
}
.user-social .user-follow .user:nth-child(10n),
.user-social .user-follow .user:last-child{
overflow: visible!important;
}
.user-social .user-follow .user:last-child::after{
content: "Total: " counter(followCount);
position: relative;
left: 85px;
top: -48px;
opacity: 0.5;
}
`;
}
if(useScripts.CSSgreenManga){
moreStyle.innerHTML += `
.activity-manga_list > div > div > div > div > .title{
color: rgba(var(--color-green))!important;
}
.media .relations .cover[href^="/manga/"] + div div{
color: rgba(var(--color-green));
}
.media .relations .cover[href^="/anime/"] + div div{
color: rgba(var(--color-blue));
}
.media .relations .cover[href^="/manga/"]{
border-bottom-style: solid;
border-bottom-color: rgba(var(--color-green));
border-bottom-width: 2px;
}
.media .relations.small .cover[href^="/manga/"]::after{
position:absolute;
left:1px;
bottom:3px;
content:"";
border-style: solid;
border-color: rgba(var(--color-green));
border-width: 2px;
}
.media .relations .cover[href^="/anime/"]{
border-bottom-style: solid;
border-bottom-color: rgba(var(--color-blue));
border-bottom-width: 2px;
}
.media .relations .cover div.image-text{
margin-bottom: 2px!important;
border-radius: 0px!important;
padding-bottom: 8px!important;
padding-top: 8px!important;
font-weight: 500!important;
}
`;
}
if(useScripts.CSSverticalNav){
moreStyle.innerHTML += `
.logo{
margin-left: -60px!important;
/*the compact layout uses more of the space to the side, so we line up the logo to the left*/
}
.footer{
margin-top: 0px !important;
/*less space wasted over the footer*/
}
.container{
padding-left: 10px;
padding-right: 0px;
}
.hide{
top: 0px!important;
/*stop that top bar from jumping all over the place*/
}
.notification{
margin-bottom: 10px!important;
}
/*Dropdown menus are site theme based*/
.quick-search .el-select .el-input .el-input__inner,
.quick-search .el-select .el-input.is-focus .el-input__inner,
.el-select-dropdown,
.el-dropdown-menu,
.el-dropdown-menu__item--divided::before{
background: rgba(var(--color-foreground));
}
.el-select-dropdown__item.hover,
.el-select-dropdown__item:hover{
background: rgba(159, 173, 189, .2);
}
.el-dropdown-menu__item--divided{
border-color: rgba(var(--color-background));
}
.el-select-group__wrap:not(:last-of-type)::after{
background: rgba(var(--color-foreground));
}
.el-popper[x-placement^="bottom"] .popper__arrow,
.el-popper[x-placement^="bottom"] .popper__arrow::after{
border-bottom-color: rgba(var(--color-foreground));
}
.el-popper[x-placement^="top"] .popper__arrow,
.el-popper[x-placement^="top"] .popper__arrow::after{
border-top-color: rgba(var(--color-foreground));
}
/*Additions to dark theme dropdown*/
.site-theme-dark .quick-search.el-select .el-input.el-input__inner,
.site-theme-dark .quick-search .el-select .el-input.is-focus .el-input__inner,
.site-theme-dark .el-select-dropdown,
.site-theme-dark .el-dropdown-menu,
.site-theme-dark .el-dropdown-menu__item--divided::before{
background: rgba(17, 22, 29);
}
.site-theme-dark .el-select-group__wrap:not(:last-of-type)::after{
background: rgba(17, 22, 29);
}
.site-theme-dark .el-popper[x-placement^="bottom"] .popper__arrow,
.site-theme-dark .el-popper[x-placement^="bottom"] .popper__arrow::after{
border-bottom-color: rgba(17, 22, 29);
opacity: 1;
}
.site-theme-dark .el-popper[x-placement^="top"] .popper__arrow,
.site-theme-dark .el-popper[x-placement^="top"] .popper__arrow::after{
border-top-color: rgba(17, 22, 29);
opacity: 1;
}
/*--------------VERTICAL-NAV----------------*/
/*code by Kuwabara: https://userstyles.org/styles/161017/my-little-anilist-theme-can-not-be-this-cute*/
div#nav {
width: 65px;
height: 100%;
position: fixed!important;
top: 0!important;
left: 0!important;
transition: none!important;
}
div#nav.transparent {
background: rgba(var(--color-nav))!important;
}
.nav .wrap .links {
font-size: 1rem;
height: 355px;
margin-left: 0px;
padding-left: 0px;
width: 65px;
flex-direction: column;
}
.nav .wrap .links .link {
width: 65px;
padding: 5px 0px;
margin-bottom: 10px;
text-align: center;
/*color: rgba(var(--color-blue),0.6);*/
transition: 0.3s;
}
.nav .wrap .links .link:hover {
background: rgba(var(--color-blue),0.1);
}
.nav .wrap .links .link::before {
display: block;
content: '';
height: 24px;
width: 65px;
background-size: 24px;
margin-left: 0;
margin-bottom: 3px;
background-repeat: no-repeat;
background-position: center;
}
.nav .link[href="/home"]::before {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAPFBMVEX////Nzc3MzMzMzMzMzMzMzMzNzc3Ozs7MzMzOzs7Nzc3Pz8/Nzc3Ozs7MzMzMzMzMzMzMzMz////MzMxhQh83AAAAFHRSTlMAkAWq/wrBFc8f4DDqP/VV+mkBjLrki9AAAADdSURBVHgB7dPVYcQAEMTQvfOa2e6/1jBnwgrPa0Bfil/IzOxwCIxwLDKLYwiMssozVRkEoW7yQlPHp2i7vNK1Ebx+yBtDH7hxyjumMWDzkvcsc6DWfGQNzransJN7ScWR20urSm4vram5vbSu5fbShp7bS5tGbi9tmcG9tBXcS9vRvfRy5F56OXIvvRy5l16O3EsvR+6llyP30suBe2kruJe2o3vp5ci99HLkXno5ci+9HLmXXo7cSy9H7qWXQ/d6+3L5TqE54MCfCcQDDjjggAMOOOCAA38wYGZmdgrh0DDL6hLpfgAAAABJRU5ErkJggg==);
}
.nav .link[href*="/user/"]::before {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAQAAABIkb+zAAACeUlEQVR4Ae3bM7gcYRTG8Ylt22YT9XHSxnbS31vHtq0qdhPbOe/g7sS2bZ704XybnZ0zT87zry9+y48WxzwFKEABClCAAhQQZgpIVEImDtIL4jT3AgeRmaj0TwC/IG3BN+Lowjfa4hdMEnA5Dzzi6IN3OU9SACwhlhGWJAFATXwVA/iKmsYAmkgsqInGALiSAPCMAfReEoDemgNYVgpQQMwAT2mZ05Hq+gUvFPLqoDMtw7P4AG7awynXT+Oq3PZwuh0HwNbreX/3O6/nxSbpgNls/TnMFAzADs72NwBnwzahANyh/EHmUJQfd0QC7L5sBcvuKxCA65w9KICz0zV5gJlsBQ+z5AHamQCorTiAW9sE4NYWB7hc2ARwubA4gF/QBOAX1JdQqgHU1gTgtBEHwAwTAGbIA1w3AQj8IiNG78CPf++4D+buSh1Obws0nN4R7wnNrFhPKWlrLCb1NIJy/bzbQCPodoyWVbAcnanuhULyl1VCSAEKUIACFPAAx3GQdmEeRtEYWo1j9CAOgNvYiKnoapf69SjUbWB3xyK6IBCAS1hEbYOuzfllMRQnpABe0hyvDlvmeXVoDj2JFIAPmHe+BFvJdzmPPRA3ogF8wrhA/3wABEbRp3QDLrgN2EpdbgNy0gnIMn/sAzwPa9MEwI1EGbZSH+XC3jQA8M1pylY4JcrQi/ABy9kKL5oUOsBuFSbAbR46IKtYmICsYqED2Ao3IQAFKECnlApQwCtRgFf/39FjTBYFmGwMsKtIOn5PlZO5ALFYDGBJsldQ3FhfQWHLL4jNUV8CwmazS0A/RZUpI5prWHSAMqiyXoQTkALEpgAFKEABClDAd65sWJtplkTeAAAAAElFTkSuQmCC);
}
.nav .link[href*="/animelist"]::before {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEX////MzMw46qqDAAAAAXRSTlMAQObYZgAAAB1JREFUeAFjAIFR8P8//38Q+DAcOBAwGgajYTAKAIVtfpATE/21AAAAAElFTkSuQmCC);
}
.nav .link[href*="/mangalist"]::before {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEX////MzMw46qqDAAAAAXRSTlMAQObYZgAAAB1JREFUeAFjAIFR8P8//38Q+DAcOBAwGgajYTAKAIVtfpATE/21AAAAAElFTkSuQmCC);
}
.nav .link[href="/search/manga"]::before,
.nav .link[href="/search/anime"]::before {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAQMAAADYVuV7AAAABlBMVEX////MzMw46qqDAAAAAXRSTlMAQObYZgAAACRJREFUeAFjAIFR8P//h/8g8IFUzigHEoCkcSCIeM4ohzwwCgAUe7MQS689CwAAAABJRU5ErkJggg==);
}
.nav .link[href*="/forum"]::before {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAANlBMVEX////U1NTNzc3MzMzMzMzS0tLMzMzOzs7MzMzNzc3MzMzNzc3MzMzMzMzNzc3MzMzNzc3R0dEFv6PyAAAAEnRSTlMAGLPs/xHmFaCi6+Wh7bIZgBYCtFDnAAAAw0lEQVR4Ae3VhW0EQRTAUN8t80//xYZxRaOJHPxu4IlNlmXvulybtqLmeqGorm8r6wdKGtvqJkqa64GZktpP9JOABBJIIIHTIwTg9AgRaCcbmG2g/XIggQQSSCCBBBJYbGCVgb5TgW0/qAGC8mqAwAUCFwhcIHCBwAUCFwhcIHiuragACFwgcIHABQIXCFwgcIFABs4tNjDawE0vAxz7JgD1xRmwBWwBW8AWsAVsAVvAFrAFbAFbwBawBWwBueC1LMvuACDgQjDhWhbNAAAAAElFTkSuQmCC);
}
div#nav.transparent {
background: #1f2631!important;
/*background: rgba(var(--color-nav))!important;*/
}
#app {
margin-top: 0;
padding-left: 65px;
}
.nav .user {
position: fixed;
top: 0;
display: grid;
grid-gap: 40px;
width: 65px;
grid-template-rows: 50px 20px;
}
.search .dropdown.el-dropdown {
font-size: 10px;
}
.search .el-dropdown-link svg {
width: 65px;
height: 23px;
padding: 5px 0;
background: rgba(0, 0, 0, 0.2);
}
.nav .search {
width: 65px;
margin: 0;
text-align: center;
position: fixed;
top: 56px;
}
.quick-search-results {
z-index: 999!important;
top: 136px!important;
}
.user .avatar:hover+.chevron {
opacity: 0!important;
}
.hide {
top:0px!important;
}
/*-------------------*/
::selection {
background: rgba(var(--color-blue),0.4);
}
::-webkit-selection {
background: rgba(var(--color-blue),0.4);
}
::-moz-selection {
background: rgba(var(--color-blue),0.4);
}
::-webkit-scrollbar {
width: 7px;
height: 7px;
}
::-webkit-scrollbar-thumb {
background: #4e4e4e!important;
}
#app{
overflow:unset;
}
.user .header-wrap{
position: sticky;
top: -332px;
z-index: 100;
}
.list-stats{
margin-bottom:0px!important;
}
.activity-feed-wrap{
margin-top:25px;
}
.logo{
position: absolute;
margin-bottom: -500px;
display:none!important;
margin-left: 0px !important;
}
/*home stuff*/
.reply .header a.name[href="/user/Abyss/"]::after{
content: "Prima Undine";
margin-left:10px;
padding:3px;
border-radius:2px;
animation-duration: 20s;
animation-iteration-count: infinite;
animation-name: rainbow;
animation-timing-function: ease-in-out;
color: rgba(var(--color-white));
}
.reply .header a.name[href="/user/Taluun/"]::after{
content: "Best Friend";
margin-left:10px;
padding:3px;
border-radius:2px;
animation-duration: 20s;
animation-iteration-count: infinite;
animation-name: rainbow;
animation-timing-function: ease-in-out;
color: rgba(var(--color-white));
}
.details > .donator-badge{
left:105px!important;
padding:2px!important;
top: 100%!important;
-ms-transform: translate(0px, -34px);
-webkit-transform: translate(0px, -34px);
transform: translate(0px, -34px);
}
.activity-text > div > div > div > .donator-badge{
position:relative!important;
display:inline-block!important;
left:0px!important;
top:-10px!important;
-ms-transform: translate(0px, 0px);
-webkit-transform: translate(0px, 0px);
transform: translate(0px, 0px);
}
.activity-replies{
margin-top:5px!important;
margin-left:30px!important;
margin-right:0px!important;
}
.activity-entry{
margin-bottom: 10px!important;
}
.list-preview{
grid-gap: 10px!important;
padding:0px!important;
background: rgb(0,0,0,0)!important;
}
.home{
grid-column-gap: 30px!important;
margin-top: 20px!important;
grid-template-columns: auto 470px!important;
}
.activity-feed .reply{
padding:8px!important;
margin-bottom: 5px!important;
}
.list .details{
padding-left:10px!important;
padding-top:5px!important;
padding: 10px 16px!important;
padding-bottom: 7px !important;
}
.search{
margin-top:0px!important;
}
.emoji-spinner{
display:none!important;
}
.wrap{
border-radius: 2px!important;
}
.name{
margin-left: 0px!important;
}
.activity-text > div > div > div > .name{
margin-left: 12px!important;
}
.button{
margin-right: 5px!important;
}
.actions{
margin-bottom: 5px!important;
bottom: 0px!important;
}
.status{
display: inline-block!important;
}
.avatar{
display: block!important;
}
/*https://anilist.co/activity/29333544*/
.activity-entry .header a:nth-child(1){
display: inline-block!important;
}
.wrap > .list{
min-height: 80px!important;
grid-template-columns: 60px auto!important;
}
.popper__arrow{
display: none!important;
}
.media-preview{
grid-gap: 10px!important;
padding: 0px!important;
background: rgb(0,0,0,0)!important;
}
.media-preview-card{
display: inline-grid!important;
}
.replies > .count{
color: rgba(var(--color-blue));
}
.action.likes{
color: unset;
}
.like-wrap > .button:hover{
color: rgba(var(--color-red));
}
.replies > *:nth-child(2){
color: rgba(var(--color-blue));
}
.actions{
cursor: default;
}
.activity-manga_list > div > div > div > div > .title{
color: rgba(var(--color-green))!important;
}
.markdown-editor > [title="Image"],
.markdown-editor > [title="Youtube Video"],
.markdown-editor > [title="WebM Video"]{
color: rgba(var(--color-red));
}
.markdown-editor > div > svg{
min-width: 1em!important;
}
.feed-select .toggle > div.active[data-v-f37b0a84]{
color: rgba(var(--color-blue))!important;
}
.home .details .status:first-letter,
.social .details .status:first-letter {
text-transform:lowercase;
}
.activity-edit .markdown-editor,
.activity-edit .input{
margin-bottom: 10px!important;
}
.activity-edit .actions{
margin-bottom: 25px!important;
}
.like-wrap .users{
overflow-y: scroll!important;
}
.page-content .container .home.full-width{
grid-template-columns: unset !important;
}
.activity-text .text {
border-left: solid 5px rgba(var(--color-blue));
}
.section-header{
padding-left:0px!important;
}
.cover[href="/anime/440/Shoujo-Kakumei-Utena/"] + .details{
border-color: #eb609e;
border-width: 4px;
border-style: solid;
border-left-width: 0px;
}
.sticky .avatar, .sticky .body-preview,
.sticky .categories, .sticky .name{
display: none!important;
}
.search > .filter,
.search > .preview{
margin-top: 20px;
}
`;
}
if(useScripts.CSSdecimalPoint){
moreStyle.innerHTML += `
.medialist.POINT_10_DECIMAL .score[score="10"]::after,
.medialist.POINT_10_DECIMAL .score[score="9"]::after,
.medialist.POINT_10_DECIMAL .score[score="8"]::after,
.medialist.POINT_10_DECIMAL .score[score="7"]::after,
.medialist.POINT_10_DECIMAL .score[score="6"]::after,
.medialist.POINT_10_DECIMAL .score[score="5"]::after,
.medialist.POINT_10_DECIMAL .score[score="4"]::after,
.medialist.POINT_10_DECIMAL .score[score="3"]::after,
.medialist.POINT_10_DECIMAL .score[score="2"]::after,
.medialist.POINT_10_DECIMAL .score[score="1"]::after{
margin-left:-4px;
content: ".0";
}
`;
}
if(useScripts.CSSsmileyScore){
moreStyle.innerHTML += `
.fa-frown{
color: red;
}
.fa-smile{
color: green;
}
`;
}
if(useScripts.CSS3d){
moreStyle.innerHTML += `
.logo::after{
background-image: url("https://i.stack.imgur.com/KZoCH.jpg");
}
.media-preview-card,
.thread-card,
.review-card,
.activity-entry{
transform: skewX(-15deg);
box-shadow: 12px 12px 3px 1px rgba(7, 7, 7, 0.5);
border-top-style: solid;
border-top-width: 1px;
border-left-style: solid;
border-left-width: 1px;
}
.activity-entry{
margin-left: 20px;
margin-bottom: 25px!important;
border-radius: 10px;
}
.activity-entry .wrap{
background-image: linear-gradient(to bottom right, rgb(rgb(80,130,123)), rgb(var(--color-foreground-grey)))!important;
}
.feed-type-toggle .active{
transform: translate(0px,3px);
}
.title,
.embed,
.name,
.votes,
.donator-badge,
.status,
.avatar,
.reply,
textarea,
.feed-type-toggle,
#nav,
time{
box-shadow: 5px 5px 3px 1px rgba(7, 7, 7, 0.5);
}
.activity-entry .cover{
box-shadow: 5px 5px 3px 1px rgba(7, 7, 7, 0.5);
transform: translate(3px, -10px);
margin-top: 15px;
border-top-style: solid;
border-top-width: 1px;
border-left-style: solid;
border-left-width: 1px;
}
.reply{
margin-right: 10px;
margin-bottom: 15px!important;
}
.action.replies,
.links .link,
.category,
.notification-dot,
.like-wrap{
filter: drop-shadow(5px 5px 1px black);
}
.list-preview,
.media-preview{
padding-right: 10px !important;
background: none !important;
}
.content{
z-index: 101!important;
}
image{
filter: saturate(200%);
}
`;
}
if(useScripts.CSSstudioStats){
moreStyle.innerHTML += `
.stats-wrap .row a[href="/studio/34/Hal-Film-Maker"],
.stats-wrap .row a[href="/studio/18/Toei-Animation"],
.stats-wrap .row a[href="/studio/11/MADHOUSE"],
.stats-wrap .row a[href="/studio/1/Studio-Pierrot"],
.stats-wrap .row a[href="/studio/37/Studio-DEEN"],
.stats-wrap .row a[href="/studio/14/Sunrise"],
.stats-wrap .row a[href="/studio/7/JC-Staff"],
.stats-wrap .row a[href="/studio/6/Gainax"],
.stats-wrap .row a[href="/studio/44/Shaft"],
.stats-wrap .row a[href="/studio/2/Kyoto-Animation"],
.stats-wrap .row a[href="/studio/65/Tokyo-Movie-Shinsha"],
.stats-wrap .row a[href="/studio/10/Production-IG"],
.stats-wrap .row a[href="/studio/561/A1-Pictures"],
.stats-wrap .row a[href="/studio/21/Studio-Ghibli"],
.stats-wrap .row a[href="/studio/68/Mushi-Productions"],
.stats-wrap .row a[href="/studio/48/AIC"],
.stats-wrap .row a[href="/studio/200/Tezuka-Productions"],
.stats-wrap .row a[href="/studio/43/ufotable"],
.stats-wrap .row a[href="/studio/291/CoMix-Wave"],
.stats-wrap .row a[href="/studio/73/TMS-Entertainment"],
.stats-wrap .row a[href="/studio/829/Studio-Jack"],
.stats-wrap .row a[href="/studio/28/Oriental-Light-and-Magic"],
.stats-wrap .row a[href="/studio/27/Xebec"],
.stats-wrap .row a[href="/studio/3/GONZO"],
.stats-wrap .row a[href="/studio/112/Brains-Base"],
.stats-wrap .row a[href="/studio/300/SILVER-LINK"],
.stats-wrap .row a[href="/studio/51/diomeda"],
.stats-wrap .row a[href="/studio/314/White-Fox"],
.stats-wrap .row a[href="/studio/22/Nippon-Animation"],
.stats-wrap .row a[href="/studio/196/Production-Reed"],
.stats-wrap .row a[href="/studio/199/Studio-Nue"],
.stats-wrap .row a[href="/studio/803/Trigger"],
.stats-wrap .row a[href="/studio/132/PA-Works"],
.stats-wrap .row a[href="/studio/95/Doga-Kobo"],
.stats-wrap .row a[href="/studio/287/David-Production"],
.stats-wrap .row a[href="/studio/8/Artland"],
.stats-wrap .row a[href="/studio/569/MAPPA"],
.stats-wrap .row a[href="/studio/858/Wit-Studio"],
.stats-wrap .row a[href="/studio/41/Satelight"],
.stats-wrap .row a[href="/studio/456/Lerche"],
.stats-wrap .row a[href="/studio/91/feel"],
.stats-wrap .row a[href="/studio/290/Kinema-Citrus"],
.stats-wrap .row a[href="/studio/32/Manglobe"],
.stats-wrap .row a[href="/studio/4418/8bit"],
.stats-wrap .row a[href="/studio/555/Studio-Chizu"],
.stats-wrap .row a[href="/studio/45/Pink-Pineapple"],
.stats-wrap .row a[href="/studio/47/Studio-Khara"],
.stats-wrap .row a[href="/studio/13/Studio-4C"],
.stats-wrap .row a[href="/studio/103/Tatsunoko-Production"],
.stats-wrap .row a[href="/studio/6071/Studio-Shuka"],
.stats-wrap .row a[href="/studio/839/LIDENFILMS"],
.stats-wrap .row a[href="/studio/25/Milky-Animation-Label"],
.stats-wrap .row a[href="/studio/6222/CloverWorks"],
.stats-wrap .row a[href="/studio/309/GoHands"],
.stats-wrap .row a[href="/studio/911/Passione"],
.stats-wrap .row a[href="/studio/418/Studio-Gokumi"],
.stats-wrap .row a[href="/studio/365/PoRO"],
.stats-wrap .row a[href="/studio/292/AIC-Plus"],
.stats-wrap .row a[href="/studio/38/Arms"],
.stats-wrap .row a[href="/studio/6069/Studio-3Hz"],
.stats-wrap .row a[href="/studio/541/Seven"],
.stats-wrap .row a[href="/studio/6145/Science-SARU"],
.stats-wrap .row a[href="/studio/4/BONES"]{
color:rgba(var(--color-blue))
}
`;
}
document.getElementsByTagName("head")[0].appendChild(moreStyle);
const queryMediaList = `
query ($name: String!, $listType: MediaType) {
MediaListCollection (userName: $name, type: $listType) {
lists {
name
isCustomList
entries {
... mediaListEntry
}
}
}
}
fragment mediaListEntry on MediaList {
mediaId
status
progress
progressVolumes
repeat
notes
startedAt {
year
month
day
}
media {
episodes
chapters
volumes
duration
nextAiringEpisode {
episode
}
format
title {
romaji
}
tags {
name
}
}
scoreRaw: score (format: POINT_100)
}
`;
const queryActivity = `
query ($id: Int!) {
Activity(id: $id) {
... on TextActivity {
id
userId
type
text
user {
id
name
avatar {
large
}
}
likes {
id
}
replies {
text(asHtml: true)
user {
name
}
likes {
name
}
}
}
... on ListActivity {
id
userId
type
status
progress
user {
id
name
avatar {
large
}
}
media {
coverImage {
large
}
}
likes {
id
}
replies {
text(asHtml: true)
user {
name
}
likes {
name
}
}
}
... on MessageActivity {
id
type
likes {
id
}
replies {
text(asHtml: true)
user {
name
}
likes {
name
}
}
}
}
}
`;
var activityCache = {};//reduce API calls even if localStorage is not available.
var handleResponse = function(response){//generic handling of API responses
return response.json().then(function(json){
return (response.ok ? json : Promise.reject(json));
});
};
var handleError = function(error){
console.error(error);//not much more we can do. As most modules are independent an non-critical, it's better to just log the error and keep stuff running.
};
const url = "https://graphql.anilist.co";//Current Anilist API location
var listActivityCall = function(query,variables,callback,vars,cache){
/*
query, graphql request
vars, just, values to pass on to the callback function
cache::true, use cached data if available
cache::false, allways fetch new data
*/
let handleData = function(data){
pending[variables.id] = false;
if(localStorageAvailable){
localStorage.setItem(variables.id + "",JSON.stringify(data));
aniscriptsUsed.keys.push(variables.id);
if(aniscriptsUsed.keys.length > 1000){//don't hog to much of localStorage
localStorage.removeItem(aniscriptsUsed.keys[0]);
aniscriptsUsed.keys.shift();
}
localStorage.setItem("aniscriptsUsed",JSON.stringify(aniscriptsUsed));
}
else{
activityCache[variables.id] = data;//still useful even if we don't have localstorage
}
callback(data,vars);
};
let options = {//generic headers provided by API examples
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"query": query,
"variables": variables
})
};
if(localStorageAvailable && cache){
let localStorageItem = localStorage.getItem(variables.id + "");
if(!(localStorageItem === null)){
callback(JSON.parse(localStorageItem),vars);
return;
}
}
else if(activityCache.hasOwnProperty(variables.id) && cache){
callback(activityCache[variables.id],vars);
return;
}
fetch(url,options).then(handleResponse).then(handleData).catch(handleError);
++document.APIcallsUsed;
};
function generalAPIcall(query,variables,callback){//has no cache stuff to worry about, use this for all other calls to the API
let handleData = function(data){
callback(data,variables);
};
let options = {
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
"query": query,
"variables": variables
})
};
fetch(url,options).then(handleResponse).then(handleData).catch(handleError);
++document.APIcallsUsed;
}
function enhanceSocialTab(){//who wrote this trash code?
let perform = function(){
if(!document.URL.match(/^https:\/\/anilist\.co\/(anime|manga)\/\d*\/[\w\-]*\/social/)){
return;
}
var listOfActs = Array.from(document.getElementsByClassName("activity-entry"));
listOfActs.forEach(function(act){//compress activities without comments, they are all the same media entry anyway
if(
!act.hasOwnProperty("marked") &&
!(act.children[0].children[2].children[0].children.length > 1)
){
act.marked = true;
act.children[0].children[0].removeChild(act.children[0].children[0].children[0]);//remove cover image
var elements = act.children[0].children[0].children[0].children;
elements[2].parentNode.insertBefore(elements[2],elements[0]);//move profile picture to the beginning of the line
elements[0].parentNode.parentNode.style.minHeight = "70px";
elements[0].parentNode.classList.add("hohSocialTabActivityCompressedContainer");
elements[0].style.verticalAlign = "bottom";
elements[0].style.marginTop = "0px";
elements[1].classList.add("hohSocialTabActivityCompressedName");
elements[2].classList.add("hohSocialTabActivityCompressedStatus");
act.style.marginBottom = "10px";
}
});
/*add average score to social tab*/
var listOfFollowers = Array.from(document.getElementsByClassName("follow"));
var averageScore = 0;
var averageCount = 0;
listOfFollowers.forEach(function(follower){
if(
follower.children.length === 4
){
if(follower.children[3].nodeName != "svg"){
const followScore = follower.children[3].innerText.match(/\d+\.?\d*/g);
if(followScore && followScore.length === 2){
averageScore += 100*followScore[0]/followScore[1];
averageCount++;
}
else if(followScore && followScore.length === 1){//star rating
averageScore += (followScore[0]*20 - 10);
averageCount++;
}
}
else{//do count smiley scores, but with lower confidence
const smileyScore = follower.children[3].dataset.icon;
if(smileyScore === "frown"){
averageScore += (45)*0.5;
averageCount += 0.5;
}
else if(smileyScore === "meh"){
averageScore += (60)*0.5;
averageCount += 0.5;
}
else if(smileyScore === "smile"){
averageScore += (85)*0.5;
averageCount += 0.5;
}
}
}
});
if(averageCount){
averageScore = averageScore/averageCount;
var locationForIt = document.getElementById("averageScore");
if(!locationForIt){
locationForIt = document.createElement("span");
locationForIt.id = "averageScore";
document.getElementsByClassName("following")[0].insertBefore(
locationForIt,
document.getElementsByClassName("following")[0].children[0]
);
}
locationForIt.innerHTML = "average: " + averageScore.toFixed(1) + "/100";//fix rounding later
}
/*end average score*/
};
let tryAgain = function(){//loop the module until we leave that page
setTimeout(function(){
perform();
if(document.URL.match(/^https:\/\/anilist\.co\/(anime|manga)\/\d*\/[\w\-]*\/social/)){
tryAgain();
}
else{
activeScripts.socialTab = false;
}
},100);
};
activeScripts.socialTab = true;
perform();
tryAgain();
}
function enhanceForum(){//purpose: reddit-style comment three collapse button
let perform = function(){
if(!document.URL.match(/^https:\/\/anilist\.co\/forum\/thread\/.*/)){
return;
}
var comments = Array.from(document.getElementsByClassName("comment-wrap"));
comments.forEach(function(comment){
if(!comment.hasOwnProperty("hohVisited")){
comment.hohVisited = true;
let hider = document.createElement("span");
hider.innerText = "[-]";
hider.classList.add("hohForumHider");
hider.onclick = function(){
let parentComment = this.parentNode.parentNode;
if(this.innerHTML === "[-]"){
this.innerText = "[+]";
parentComment.children[1].style.display = "none";
if(parentComment.parentNode.children.length > 1){
parentComment.parentNode.children[1].style.display = "none";
}
}
else{
this.innerText = "[-]";
parentComment.children[1].style.display = "block";
if(parentComment.parentNode.children.length > 1){
parentComment.parentNode.children[1].style.display = "block";
}
}
};
comment.children[0].children[0].insertBefore(
hider,
comment.children[0].children[0].children[0]
);
}
});
};
let tryAgain = function(){//loop the forum script until we leave that page
setTimeout(function(){
perform();
if(document.URL.match(/^https:\/\/anilist\.co\/forum\/thread\/.*/)){
tryAgain();
}
else{
activeScripts.forumComments = false;
}
},100);
};
activeScripts.forumComments = true;
perform();
tryAgain();
}
function dubMarker(){
if(!document.URL.match(/^https:\/\/anilist\.co\/anime\/.*/)){
return;
}
if(document.getElementById("dubNotice")){
return;
}
const variables = {
id: document.URL.match(/\/anime\/(\d+)\//)[1],
page: 1,
language: useScripts.dubMarkerLanguage.toUpperCase()
};
const query = `
query ($id: Int!, $type: MediaType, $page: Int = 1, $language: StaffLanguage) {
Media(id: $id, type: $type) {
characters(page: $page, sort: [ROLE], role: MAIN) {
edges {
node {
id
}
voiceActors (language: $language) {
language
}
}
}
}
}
`;
let dubCallback = function(data){
let dubNoticeLocation = document.getElementsByClassName("sidebar");
if(!dubNoticeLocation.length && document.URL.match(/^https:\/\/anilist\.co\/anime\/.*/)){
setTimeout(function(){
dubCallback(data);
},200);
return;
}
if(data.data.Media.characters.edges.reduce(
(actors,a) => actors + a.voiceActors.length
)){//any voice actors for this language?
let dubNotice = document.createElement("p");
dubNotice.id = "dubNotice";
dubNotice.innerText = useScripts.dubMarkerLanguage + " dub available";
dubNoticeLocation[0].insertBefore(dubNotice,dubNoticeLocation[0].firstChild);
}
};
generalAPIcall(query,variables,dubCallback);
}
function enhanceStaff(){//currently only adds a favourite count
if(!document.URL.match(/^https:\/\/anilist\.co\/staff\/.*/)){
return;
}
let filterGroup = document.getElementsByClassName("content");
if(!filterGroup.length){
setTimeout(function(){
enhanceStaff();
},200);//may take some time to load
return;
}
filterGroup = filterGroup[0];
let favCount = document.createElement("span");
favCount.id = "hohFavCount";
favCount.innerText;
filterGroup.appendChild(favCount);
const variables = {id: document.URL.match(/\/staff\/(\d+)\//)[1]};
const query = "query($id: Int!){Staff(id: $id){favourites}}";
let favCallback = function(data){
let favButton = document.getElementsByClassName("favourite");
if(data.data.Staff.favourites === 0 && favButton[0].classList.contains("isFavourite")){//safe to assume
document.getElementById("hohFavCount").innerText = data.data.Staff.favourites+1;
}
else{
document.getElementById("hohFavCount").innerText = data.data.Staff.favourites;
}
if(favButton.length){
favButton[0].onclick = function(){
if(this.classList.contains("isFavourite")){
favCount.innerText = Math.max(parseInt(favCount.innerText)-1,0);//0 or above, just to avoid looking silly
}
else{
favCount.innerText = parseInt(favCount.innerText)+1;
}
};
}
};
generalAPIcall(query,variables,favCallback);
}
function addCompletedScores(){
let perform = function(){
if(!document.URL.match(/^https:\/\/anilist\.co\/(home|user|activity)\/?([\w\-]+)?\/?$/)){
return;
}
var status = document.getElementsByClassName("status");
for(var i=0;i 205){//horrible test, but we have not markup to go from. Assumes the tag dropdown is the only one with more than that number of children
bestGuess = i;
};
};
if(bestGuess === false){
return;
};
if(possibleTagContainers[bestGuess].hasOwnProperty("hohMarked")){
return;
}
else{
possibleTagContainers[bestGuess].hohMarked = true;
};
var superBody = document.getElementsByClassName("el-dialog__body")[0];
var descriptionTarget = document.createElement("span");
descriptionTarget.id = "hohDescription";
superBody.insertBefore(descriptionTarget,superBody.children[2]);
for(var i=0;i 1
&& notifications[i].classList[1] != "hasMedia"
){ //"notification unread" classlist
active.unread = true;
}
else{
active.unread = false;
};
active.type = "special"; //by default every activity is some weird thing we are displaying as-is
active.link = "aaa";//fixme. Edit 2019: I have no idea
if(//check if we can query that
notifications[i].children.length >= 1
&& notifications[i].children[1].children.length
&& notifications[i].children[1].children[0].children.length
&& notifications[i].children[1].children[0].children[0].children.length
){
//
const info = notifications[i].children[1].children[0].children[0];
active.directLink = info.href
active.text = info.innerHTML;
active.textName = info.childNodes[0].textContent.trim();
active.textSpan = info.childNodes[1].textContent;
active.link = info.href.match(/[0-9]+/)[0];
var testType = info.children[0].textContent;
if(testType === " liked your activity."){
active.type = "likeActivity";
}
else if(testType === " replied to your activity."){
active.type = "replyActivity";
}
else if(testType === " sent you a message."){
active.type = "messageActivity";
}
else if(testType === " liked your activity reply."){
active.type = "likeReplyActivity";
}
else if(testType === " mentioned you in their activity."){
active.type = "mentionActivity";
}
else if(testType === " replied to activity you previously replied to."){
active.type = "replyReplyActivity";
};
//
};
if(active.type === "special"){
active.text = notifications[i].children[1].innerHTML;//default
if(notifications[i].children[1].children.length){
const info = notifications[i].children[1].children[0];
if(
info.children.length >= 2
&& info.children[1].textContent === " started following you."
){
active.type = "followActivity";
active.directLink = info.children[0].href;
active.text = info.children[0].innerHTML;
active.textName = info.children[0].textContent.trim();
active.textSpan = info.children[1].textContent;
}
else if(
info.children.length >= 4
&& info.children[3].textContent === " aired."
){
active.type = "airingActivity";
active.directLink = info.children[0].href;
active.text = info.innerHTML;
};
};
};
if(
notifications[i].children.length > 1
&& notifications[i].children[1].children.length > 1
){
active.time = notifications[i].children[1].children[1].innerHTML;
}
else{
active.time = document.createElement("span");
};
active.image = notifications[i].children[0].style.backgroundImage;
active.href = notifications[i].children[0].href;
activities.push(active);
};
if(activities.length === prevLength && forceRebuildFlag === false){
return;
}
else{
prevLength = activities.length;
forceRebuildFlag = false;
};
var newContainer = document.getElementById("hohNotifications")
if(newContainer){
newContainer.parentNode.removeChild(newContainer);
};
newContainer = document.createElement("div");
newContainer.id = "hohNotifications";
var notificationsContainer = document.querySelector(".notifications");
if(!notificationsContainer){
return;
}
notificationsContainer.insertBefore(newContainer,notificationsContainer.firstChild);
var commentCallback = function(data){
var listOfComments = Array.from(document.getElementsByClassName("b" + data.data.Activity.id));
listOfComments.forEach(function(comment){
while(comment.children[1].childElementCount){
comment.children[1].removeChild(comment.children[1].lastChild);
};
if(comment.children[0].style.display != "block"){
comment.children[0].style.display = "block";
};
data.data.Activity.replies.forEach(function(reply){
var quickCom = document.createElement("div");
quickCom.classList.add("hohQuickCom");
var quickComName = document.createElement("span");
quickComName.classList.add("hohQuickComName");
quickComName.innerHTML = reply.user.name;
if(reply.user.name === whoAmI){
quickComName.classList.add("hohThisIsMe");
};
var quickComContent = document.createElement("span");
quickComContent.classList.add("hohQuickComContent");
quickComContent.innerHTML = reply.text;
var quickComLikes = document.createElement("span");
quickComLikes.classList.add("hohQuickComLikes");
if(reply.likes.length > 1){
quickComLikes.innerText = reply.likes.length + "♥";
}
else if(reply.likes.length === 1){
quickComLikes.innerText = "♥";
};
reply.likes.forEach(function(like){
if(like.name === whoAmI){
quickComLikes.classList.add("hohILikeThis");
};
});
quickCom.appendChild(quickComName);
quickCom.appendChild(quickComContent);
quickCom.appendChild(quickComLikes);
comment.children[1].appendChild(quickCom);
});
});
};
for(var i=0;i 5){
timeHideFlag = true;
}
else if(document.getElementById("hohNotifications").offsetWidth < 800 && counter > 2){
timeHideFlag = true;
};
text.href = activities[i].directLink;
let textName = document.createElement("span");
let textSpan = document.createElement("span");
textSpan.innerText = activities[i].textSpan;
textName.style.color = "rgb(var(--color-blue))";
if(counter > 1){
textSpan.innerText = " liked your activities.";
};
if(counter === 1){
while(
i + counter < activities.length
&& activities[i + counter].type === "likeActivity"
&& activities[i + counter].link === activities[i].link
){//several people likes one of your activities
var miniImageWidth = 40;
var miniImage = document.createElement("a");
miniImage.classList.add("hohUserImageSmall");
miniImage.href = activities[i + counter].href;
miniImage.title = activities[i + counter].textName;
miniImage.style.backgroundImage = activities[i + counter].image;
miniImage.style.height = miniImageWidth + "px";
miniImage.style.width = miniImageWidth + "px";
miniImage.style.marginLeft = (72 + (counter-1)*miniImageWidth) + "px";
newNotification.appendChild(miniImage);
counter++;
};
if(counter > 1){
text.style.marginTop = "45px";
activities[i].textName += " +";
};
}
else{
newNotification.classList.add("hohCombined");
};
textName.innerText = activities[i].textName;
text.appendChild(textName);
text.appendChild(textSpan);
i += counter -1;
}
else if(activities[i].type === "replyActivity" ){
var fakeNotNotImage = document.createElement("img");
var notNotImage = document.createElement("a");
notNotImage.href = activities[i].directLink;
fakeNotNotImage.classList.add("hohMediaImage");
fakeNotNotImage.classList.add(activities[i].link);
notNotImage.appendChild(fakeNotNotImage);
notNotImageContainer.appendChild(notNotImage);
while(
i + counter < activities.length
&& activities[i + counter].type === "replyActivity"
&& activities[i + counter].link === activities[i].link
){
var miniImageWidth = 40;
var miniImage = document.createElement("a");
miniImage.classList.add("hohUserImageSmall");
miniImage.href = activities[i + counter].href;
miniImage.style.backgroundImage = activities[i + counter].image;
miniImage.style.height = miniImageWidth + "px";
miniImage.style.width = miniImageWidth + "px";
miniImage.style.marginLeft = (72 + (counter-1)*miniImageWidth) + "px";
newNotification.appendChild(miniImage);
counter++;
};
if(counter > 1){
text.style.marginTop = "45px";
activities[i].textName += " +";
};
text.href = activities[i].directLink;
let textName = document.createElement("span");
let textSpan = document.createElement("span");
textName.innerText = activities[i].textName;
textSpan.innerText = activities[i].textSpan;
textName.style.color = "rgb(var(--color-blue))";
text.appendChild(textName);
text.appendChild(textSpan);
i += counter -1;
}
else if(activities[i].type === "replyReplyActivity" ){
var fakeNotNotImage = document.createElement("img");
var notNotImage = document.createElement("a");
notNotImage.href = activities[i].directLink;
fakeNotNotImage.classList.add("hohMediaImage");
fakeNotNotImage.classList.add(activities[i].link);
notNotImage.appendChild(fakeNotNotImage);
notNotImageContainer.appendChild(notNotImage);
while(
i + counter < activities.length
&& activities[i + counter].type === "replyReplyActivity"
&& activities[i + counter].link === activities[i].link
){
var miniImageWidth = 40;
var miniImage = document.createElement("a");
miniImage.classList.add("hohUserImageSmall");
miniImage.href = activities[i + counter].href;
miniImage.style.backgroundImage = activities[i + counter].image;
miniImage.style.height = miniImageWidth + "px";
miniImage.style.width = miniImageWidth + "px";
miniImage.style.marginLeft = (72 + (counter-1)*miniImageWidth) + "px";
newNotification.appendChild(miniImage);
counter++;
};
if(counter > 1){
text.style.marginTop = "45px";
activities[i].textName += " +";
};
text.href = activities[i].directLink;
let textName = document.createElement("span");
let textSpan = document.createElement("span");
textName.innerText = activities[i].textName;
textSpan.innerText = " replied to the same activity as you.";
textName.style.color = "rgb(var(--color-blue))";
text.appendChild(textName);
text.appendChild(textSpan);
i += counter -1;
}
else if(
activities[i].type === "messageActivity"
|| activities[i].type === "likeReplyActivity"
|| activities[i].type === "mentionActivity"
){
var fakeNotNotImage = document.createElement("img");
var notNotImage = document.createElement("a");
notNotImage.href = activities[i].directLink;
fakeNotNotImage.classList.add("hohMediaImage");
fakeNotNotImage.classList.add(activities[i].link);
notNotImage.appendChild(fakeNotNotImage);
notNotImageContainer.appendChild(notNotImage);
text.href = activities[i].directLink;
let textName = document.createElement("span");
let textSpan = document.createElement("span");
textName.innerText = activities[i].textName;
textSpan.innerText = activities[i].textSpan;
textName.style.color = "rgb(var(--color-blue))";
text.appendChild(textName);
text.appendChild(textSpan);
}
else if(activities[i].type === "airingActivity"){
var textSpan = document.createElement("span");
textSpan.innerHTML = activities[i].text;
text.appendChild(textSpan);
}
else if(activities[i].type === "followActivity"){
text.href = activities[i].directLink;
let textName = document.createElement("span");
let textSpan = document.createElement("span");
textName.innerText = activities[i].textName;
textSpan.innerText = activities[i].textSpan;
textName.style.color = "rgb(var(--color-blue))";
text.appendChild(textName);
text.appendChild(textSpan);
}
else{//display as-is
var textSpan = document.createElement("span");
textSpan.classList.add("hohUnhandledSpecial");
textSpan.innerHTML = activities[i].text;
text.appendChild(textSpan);
};
var time = document.createElement("div");
time.classList.add("hohTime");
time.innerHTML = activities[i - counter + 1].time;
var commentsContainer = document.createElement("div");
commentsContainer.classList.add("hohCommentsContainer");
commentsContainer.classList.add("b" + activities[i].link);//possible replies
var comments = document.createElement("a");
comments.classList.add("hohComments");
comments.innerText = "comments"
let quickCommentsExpander = document.createElement("span");
quickCommentsExpander.innerText = "+";
quickCommentsExpander.classList.add("hohMonospace");
comments.appendChild(quickCommentsExpander);
comments.onclick = function(){
if(this.children[0].innerText === "+"){
this.children[0].innerText = "-";
this.parentNode.children[1].style.display = "inline-block";
var query = queryActivity;
var variables = {
id: +this.parentNode.classList[1].substring(1)
};
var vars = {};
listActivityCall(query,variables,commentCallback,vars,false);
}
else{
this.children[0].innerText = "+";
this.parentNode.children[1].style.display = "none";
};
};
comments.classList.add("link");
var commentsArea = document.createElement("div");
commentsArea.classList.add("hohCommentsArea");
commentsContainer.appendChild(comments);
commentsContainer.appendChild(commentsArea);
newNotification.appendChild(notImage);
newNotification.appendChild(text);
newNotification.appendChild(notNotImageContainer);
if(!timeHideFlag){
newNotification.appendChild(time);
};
newNotification.appendChild(commentsContainer);
newContainer.appendChild(newNotification);
};
for(var i=0;document.APIcallsUsed < 90;i++){//heavy
if(!activities.length || i >= activities.length){//loading is difficult to predict. There may be nothing there when this runs
break;
};
var imageCallBack = function(data){
var type = data.data.Activity.type;
for(var j=0;j div");
if(!mediaCards.length){
setTimeout(function(){
addProgressBar();
},200);//may take some time to load
return;
};
mediaCards.forEach(function(card){
const progressInformation = card.innerText.match(/Progress:\ (\d+)\/(\d+)/);
if(progressInformation){
var pBar = document.createElement("meter");
pBar.value = progressInformation[1];
pBar.min = 0;
pBar.max = progressInformation[2];
card.parentNode.insertBefore(pBar,card);
};
});
}
function enhanceCharacter(){//adds a favourite count on every character page
if(!document.URL.match(/^https:\/\/anilist\.co\/character(\/.*)?/)){
return;
};
var filterGroup = document.getElementsByClassName("content");
if(!filterGroup.length){
setTimeout(function(){
enhanceCharacter();
},200);//may take some time to load
return;
};
const variables = {id: document.URL.match(/\/character\/(\d+)\/?/)[1]};
const query = `
query($id: Int!){
Character(id: $id){
favourites
}
}
`;
let favCallback = function(data){
var favButton = document.getElementsByClassName("favourite");
if(!favButton){
setTimeout(function(){
if(document.URL.match(/^https:\/\/anilist\.co\/character(\/.*)?/)){
favCallback(data);
};
},100);
return;
};
filterGroup = filterGroup[0];
var favCount = document.createElement("span");
favCount.id = "hohFavCount";
favCount.innerText;
filterGroup.appendChild(favCount);
if(data.data.Character.favourites === 0 && favButton[0].classList.contains("isFavourite")){//safe to assume
document.getElementById("hohFavCount").innerText = data.data.Character.favourites+1;
}
else{
document.getElementById("hohFavCount").innerText = data.data.Character.favourites;
};
if(favButton.length){
favButton[0].onclick = function(){
var favCount = document.getElementById("hohFavCount");
if(this.classList.contains("isFavourite")){
favCount.innerText = Math.max(parseInt(favCount.innerText)-1,0);//0 or above, just to avoid looking silly
}
else{
favCount.innerText = parseInt(favCount.innerText)+1;
};
};
};
};
generalAPIcall(query,variables,favCallback);
};
function enhanceStudio(){//adds a favourite count to every studio page
if(!document.URL.match(/^https:\/\/anilist\.co\/studio(\/.*)?/)){
return;
};
var filterGroup = document.querySelector(".container.header");
if(!filterGroup){
setTimeout(function(){
enhanceStudio();
},200);//may take some time to load
return;
};
const variables = {id: document.URL.match(/\/studio\/(\d+)\/?/)[1]};
const query = `
query($id: Int!){
Studio(id: $id){
favourites
}
}
`;
let favCallback = function(data){
var favButton = document.getElementsByClassName("favourite");
if(!favButton){
setTimeout(function(){
if(document.URL.match(/^https:\/\/anilist\.co\/studio(\/.*)?/)){
favCallback(data);
};
},100);
return;
};
var favCount = document.createElement("span");
favCount.id = "hohFavCount";
favCount.innerText;
filterGroup.appendChild(favCount);
if(data.data.Studio.favourites === 0 && favButton[0].classList.contains("isFavourite")){//safe to assume
document.getElementById("hohFavCount").innerText = data.data.Studio.favourites+1;
}
else{
document.getElementById("hohFavCount").innerText = data.data.Studio.favourites;
};
if(favButton.length){
favButton[0].onclick = function(){
var favCount = document.getElementById("hohFavCount");
if(this.classList.contains("isFavourite")){
favCount.innerText = Math.max(parseInt(favCount.innerText)-1,0);//0 or above, just to avoid looking silly
}
else{
favCount.innerText = parseInt(favCount.innerText)+1;
};
};
};
};
generalAPIcall(query,variables,favCallback);
};
function returnList(list){
let retl = [];
for(var i=0;i 100){
retlObj.scoreRaw = 100;
}
if(!retlObj.media.episodes && retlObj.media.nextAiringEpisode){
retlObj.media.episodes = retlObj.media.nextAiringEpisode.episode - 1;
}
retl.push(retlObj);
};
};
retl.sort((a,b) => a.mediaId - b.mediaId);
for(var i=1;i 1.1){
differenceSpan.style.color = "red";
};
targetLocation.innerText = "";
targetLocation.appendChild(differenceSpan);
let countSpan = document.createElement("span");
countSpan.innerText = " based on " + list3.length + " shared entries. Lower is better. 0.8 - 1.1 is common";
targetLocation.appendChild(countSpan);
};
generalAPIcall(query,variables,secondCallback);
};
function addMoreStats(){
if(!document.URL.match(/\/stats$/)){
return;
};
var filterGroup = document.getElementsByClassName("filter-group");
if(!filterGroup.length){
setTimeout(function(){
addMoreStats();
},200);//takes some time to load
return;
};
filterGroup = filterGroup[0];
var hohStatsTrigger = document.createElement("span");
hohStatsTrigger.classList.add("hohStatsTrigger");
hohStatsTrigger.innerText = "Script & More stats";
hohStatsTrigger.onclick = function(){
hohStatsTrigger.classList.add("hohActive");
var otherActive = document.getElementsByClassName("active");
for(var j=0;j" + scriptInfo.version + "";
scriptStats.appendChild(sVersion);
var sHome = document.createElement("p");
var sHomeLink = document.createElement("a");
sHome.innerText = "Homepage: ";
sHomeLink.innerText = scriptInfo.link;
sHomeLink.href = scriptInfo.link;
sHome.appendChild(sHomeLink);
scriptStats.appendChild(sHome);
var sInstructions = document.createElement("p");
sInstructions.innerText = "Some changes requires reloading the page.";
scriptStats.appendChild(sInstructions);
var scriptSettings = document.createElement("div");
if(localStorageAvailable){
for(var j=0;j a.list.length - b.list.length);
};
var regularTagsCollection = function(list,fields){
let tags = [];
list.forEach(function(media){
let item = {};
fields.forEach(function(field){
item[field.key] = field.method(media);
});
media.media.tags.forEach(function(tag){
var foundFlag = false;
for(var i=0;i a.average - b.average);
};
var drawTable = function(data,formatter,tableLocation){
while(tableLocation.childElementCount){
tableLocation.removeChild(tableLocation.lastChild);
};
const randomData = "data-v-e2beaf26";//I have no idea, but some css selectors want this
let header = document.createElement("h1");
header.innerText = formatter.title;
let tableContent = document.createElement("div");
tableContent.classList.add("table");
tableContent.setAttribute(randomData,"");
let headerRow = document.createElement("div");
headerRow.classList.add("header");
headerRow.classList.add("row");
headerRow.setAttribute(randomData,"");
let indexAccumulator = 0;
formatter.headings.forEach(function(heading){
let columnTitle = document.createElement("div");
columnTitle.innerText = heading;
if(formatter.focus === indexAccumulator){
columnTitle.innerHTML += " " + svgAssets.angleDown;
};
columnTitle.setAttribute(randomData,"");
columnTitle.index = +indexAccumulator;
columnTitle.addEventListener("click",function(){
formatter.focus = this.index;
data.sort(formatter.sorting[this.index]);
drawTable(data,formatter,tableLocation);
});
headerRow.appendChild(columnTitle);
indexAccumulator++;
});
tableContent.appendChild(headerRow);
for(var i=0;i a.score - b.score);
}
else{
data[i].list.sort(formatter.sorting[formatter.focus]);
}
for(var j=0;j 1){
cel.innerHTML = svgAssets.repeat + data[index].repeat;
}
}
},
function(cel,data,index,isPrimary){
if(isPrimary){
if(data[index].average === 0){
cel.innerText = "-";
}
else{
cel.innerText = Math.round(data[index].average);
}
}
else{
if(data[index].score === 0){
cel.innerText = "-";
}
else{
cel.innerText = Math.round(data[index].score);
}
}
},
function(cel,data,index,isPrimary){
if(!isPrimary && data[index].type === "MANGA"){
cel.innerText = "-";
}
else if(data[index].duration === 0){
cel.innerText = "-";
}
else if(data[index].duration < 60){
cel.innerText = Math.round(data[index].duration) + "min";
}
else{
cel.innerText = Math.round(data[index].duration/60) + "h";
};
},
function(cel,data,index,isPrimary){
if(isPrimary || data[index].type === "MANGA"){
cel.innerText = data[index].chaptersRead;
}
else{
cel.innerText = "-";
}
}
],
sorting : [
(a,b) => ("" + a.name).localeCompare(b.name),
(b,a) => a.list.length - b.list.length,
(b,a) => a.average - b.average,
(b,a) => a.duration - b.duration,
(b,a) => a.chaptersRead - b.chaptersRead
]
};
let listOfTags = regularTagsCollection(semaPhoreAnime.concat(semaPhoreManga),mixedFields);
for(var i=0;i div > h2");
if(possibleNativeLocation && possibleNativeLocation.length > 1 && possibleNativeLocation[1].innerText === "Tags"){
if(possibleNativeLocation[1].nextSibling.id != "regularTagsTable"){
let regularTagsTable = document.createElement("div");
regularTagsTable.id = "regularTagsTable";
possibleNativeLocation[1].parentNode.insertBefore(regularTagsTable,possibleNativeLocation[1].nextSibling);
drawTable(listOfTags,mixedFormatter,regularTagsTable);
possibleNativeLocation[1].parentNode.lastChild.style.display = "none";
};
}
setTimeout(checkNativeTable,200);
};
checkNativeTable();
};
//get anime list
var variables = {
name: document.URL.match(/\/([\w\-]+)\/stats\/?$/)[1],
listType: "ANIME"
};
var personalStatsCallback = function(data){
let personalStats = document.getElementById("personalStats");
personalStats.innerText = "";
let personalStatsHead = document.createElement("h1");
const thisName = document.URL.match(/\/([\w\-]+)\/stats/)[1];
personalStatsHead.innerText = "Anime stats for " + thisName;
personalStats.appendChild(document.createElement("hr"));
personalStats.appendChild(personalStatsHead);
let list = returnList(data);
if(whoAmI != thisName){
let compatabilityButton = document.createElement("button");
compatabilityButton.innerText = "Compatibility";
compatabilityButton.onclick = function(){compatCheck(list,whoAmI,"hohCheckCompat")};
personalStats.appendChild(compatabilityButton);
let hohCheckCompat = document.createElement("div");
hohCheckCompat.id = "hohCheckCompat";
personalStats.appendChild(hohCheckCompat);
};
let addStat = function(text,value,comment){//value,value,html
let newStat = document.createElement("p");
newStat.classList.add("hohStat");
let newStatText = document.createElement("span");
newStatText.innerText = text;
let newStatValue = document.createElement("span");
newStatValue.innerText = value;
newStatValue.classList.add("hohStatValue");
newStat.appendChild(newStatText);
newStat.appendChild(newStatValue);
if(comment){
let newStatComment = document.createElement("span");
newStatComment.innerHTML = comment;
newStat.appendChild(newStatComment);
};
personalStats.appendChild(newStat);
};
//first activity
let oldestYear = 2100;//fix this before 2100
let oldestMonth = 0;
let oldestDay = 0;
list.forEach(function(item){
if(item.startedAt.year){
if(item.startedAt.year < oldestYear){
oldestYear = item.startedAt.year;
oldestMonth = item.startedAt.month;
oldestDay = item.startedAt.day;
}
else if(
item.startedAt.year === oldestYear
&& item.startedAt.month < oldestMonth
){
oldestYear = item.startedAt.year;
oldestMonth = item.startedAt.month;
oldestDay = item.startedAt.day;
}
else if(
item.startedAt.year === oldestYear
&& item.startedAt.month === oldestMonth
&& item.startedAt.day < oldestDay
){
oldestYear = item.startedAt.year;
oldestMonth = item.startedAt.month;
oldestDay = item.startedAt.day;
};
};
});
//scoring stats
var previouScore = 0;
var maxRunLength = 0;
var maxRunLengthScore = 0;
var runLength = 0;
var sumEntries = 0;
var amount = 0;
var sumWeight = 0;
var sumEntriesWeight = 0;
var median = 0;
var sumDuration = 0;
var longestDuration = {
time: 0,
name: "",
status: "",
rewatch: 0,
id: 0
};
list.sort((a,b) => a.scoreRaw - b.scoreRaw);
for(var i=0;i longestDuration.time){
longestDuration.time = entryDuration;
longestDuration.name = list[i].media.title.romaji;
longestDuration.status = list[i].status;
longestDuration.rewatch = list[i].repeat;
longestDuration.id = list[i].mediaId;
};
if(list[i].scoreRaw === 0){//don't use unrated shows for scoring stats
continue;
};
if(median === 0){//the list is sorted, so when we are done ignoring the 0-ratings, we can safely find the median
median = list[i + Math.floor((list.length - i)/2)].scoreRaw;
};
amount++;//number of entries rated
sumEntries += list[i].scoreRaw;
if(list[i].scoreRaw === previouScore){
runLength++;
if(runLength > maxRunLength){
maxRunLength = runLength;
maxRunLengthScore = list[i].scoreRaw;
};
}
else{
runLength = 1;
previouScore = list[i].scoreRaw;
};
sumWeight += (list[i].media.duration|0)*(list[i].media.episodes|0);
sumEntriesWeight += list[i].scoreRaw*(list[i].media.duration|0)*(list[i].media.episodes|0);
};
list.sort((a,b) => a.mediaId - b.mediaId);
//display scoring stats
addStat("Anime on list: ",list.length);
addStat("Anime rated: ",amount);
if(amount != 0){//no scores
if(amount === 1){
addStat("Only one score given: ",maxRunLengthScore);
}
else{
addStat(
"Average score: ",
(Math.round(100*sumEntries/amount)/100).toFixed(2)
);
addStat(
"Average score: ",
(Math.round(100*sumEntriesWeight/sumWeight)/100).toFixed(2),
" (weighted by duration)"
);
addStat("Median score: ",median);
if(maxRunLength > 1){
addStat("Most common score: ",maxRunLengthScore, " (" + maxRunLength + " instances)");
}
else{
addStat("Most common score: ","","no two scores alike");
};
};
//longest activity
var singleText = (100*longestDuration.time/sumDuration).toFixed(2) + "% is ";
singleText += "" + longestDuration.name + "";
if(longestDuration.rewatch === 0){
if(longestDuration.status === "CURRENT"){singleText += ". Currently watching."}
else if(longestDuration.status === "PAUSED"){singleText += ". On hold."}
else if(longestDuration.status === "DROPPED"){singleText += ". Dropped."};
}
else{
if(longestDuration.status === "COMPLETED"){
if(longestDuration.rewatch === 1){
singleText += ". Rewatched once.";
}
else if(longestDuration.rewatch === 2){
singleText += ". Rewatched twice.";
}
else{
singleText += ". Rewatched " + longestDuration.rewatch + " times.";
};
}
else if(longestDuration.status === "CURRENT" || status === "REPEATING"){
if(longestDuration.rewatch === 1){
singleText += ". First rewatch in progress.";
}
else if(longestDuration.rewatch === 2){
singleText += ". Second rewatch in progress.";
}
else{
singleText += ". Rewatch number " + longestDuration.rewatch + " in progress.";
};
}
else if(longestDuration.status === "PAUSED"){
if(longestDuration.rewatch === 1){
singleText += ". First rewatch on hold.";
}
else if(longestDuration.rewatch === 2){
singleText += ". Second rewatch on hold.";
}
else{
singleText += ". Rewatch number " + longestDuration.rewatch + " on hold.";
};
}
else if(longestDuration.status === "DROPPED"){
if(longestDuration.rewatch === 1){
singleText += ". Dropped on first rewatch.";
}
else if(longestDuration.rewatch === 2){
singleText += ". Dropped on second rewatch.";
}
else{
singleText += ". Dropped on rewatch number " + longestDuration.rewatch + ".";
};
};
};
addStat(
"Time watched: ",
(sumDuration/(60*24)).toFixed(2),
" days (" + singleText + ")"
);
};
//TV episodes stats
var TVepisodes = 0;
var TVepisodesLeft = 0;
list.forEach(function(show){
if(show.media.format === "TV"){
TVepisodes += show.progress;
TVepisodes += show.repeat * Math.max((show.media.episodes|0),show.progress);
if(show.status === "CURRENT"){
TVepisodesLeft += Math.max((show.media.episodes|0) - show.progress,0);
};
};
});
addStat("TV episodes watched: ",TVepisodes);
addStat("TV episodes remaining for current shows: ",TVepisodesLeft);
//
var tagless = [];
for(var i=0;i largestValue){
largestValue = distribution[format][statusi];
};
};
};
};
};
var yAxisLimit = Math.ceil(
largestValue/Math.pow(10,(largestValue+"").length-1)
)*Math.pow(10,(largestValue+"").length-1);//cast to string and check the length is floor(log10(x))
var diagramFill = function(statusHeaders,formatHeaders,statusArray,formatArray){
const chartHeight = margins.height - margins.chartTextBottom - margins.bottom - margins.top;
ctx.fillStyle = "rgb(133,150,165)";
ctx.strokeStyle = "rgb(133,150,165)";
ctx.textAlign = "end";
ctx.fillText(yAxisLimit,margins.left + 20,margins.top);
ctx.fillText(0,margins.left + 20,margins.top + chartHeight);
ctx.fillText(yAxisLimit/2,margins.left + 20,margins.top + chartHeight/2);
const chartCellWidth = 100;
ctx.textAlign = "center";
for(var i=0;i 1){
cel.innerHTML += svgAssets.repeat + data[index].repeat;
}
}
},
function(cel,data,index,isPrimary){
if(isPrimary){
if(data[index].average === 0){
cel.innerText = "-";
}
else{
cel.innerText = Math.round(data[index].average);
}
}
else{
if(data[index].score === 0){
cel.innerText = "-";
}
else{
cel.innerText = Math.round(data[index].score);
}
}
},
function(cel,data,index){
if(data[index].duration === 0){
cel.innerText = "-";
}
else if(data[index].duration < 60){
cel.innerText = Math.round(data[index].duration) + "min";
}
else{
cel.innerText = Math.round(data[index].duration/60) + "h";
};
},
function(cel,data,index){
cel.innerText = data[index].episodes;
},
function(cel,data,index){
if(data[index].episodes === 0 && data[index].remaining === 0){
cel.innerText = "-";
}
else if(data[index].remaining === 0){
cel.innerText = "completed";
}
else{
cel.innerText = data[index].remaining;
}
}
],
sorting : [
(a,b) => ("" + a.name).localeCompare(b.name),
(b,a) => a.list.length - b.list.length,
(b,a) => a.average - b.average,
(b,a) => a.duration - b.duration,
(b,a) => a.episodes - b.episodes,
(b,a) => a.remaining - b.remaining
]
};
const animeFields = [
{
key : "name",
sumable : false,
method : function(media){
return media.media.title.romaji;
}
},
{
key : "mediaId",
sumable : false,
method : function(media){
return media.mediaId;
}
},
{
key : "score",
sumable : false,
method : function(media){
return media.scoreRaw;
}
},
{
key : "repeat",
sumable : false,
method : function(media){
return media.repeat;
}
},
{
key : "status",
sumable : false,
method : function(media){
return media.status;
}
},
{
key : "duration",
sumable : true,
method : function(media){
return media.watchedDuration;
}
},
{
key : "episodes",
sumable : true,
method : function(media){
return media.episodes;
}
},
{
key : "remaining",
sumable : true,
method : function(media){
return Math.max((media.media.episodes|0) - media.progress,0);
}
}
];
let customTags = customTagsCollection(list,animeFormatter.title,animeFields);
if(customTags.length){
var customTagsAnimeTable = document.createElement("div");
customTagsAnimeTable.id = "customTagsAnimeTable";
personalStats.appendChild(customTagsAnimeTable);
drawTable(customTags,animeFormatter,customTagsAnimeTable);
};
semaPhoreAnime = list;
nativeTagsReplacer();
};
generalAPIcall(queryMediaList,variables,personalStatsCallback);
//manga stats
var variables = {
name: document.URL.match(/\/([\w\-]+)\/stats/)[1],
listType: "MANGA"
};
var personalStatsMangaCallback = function(data){
var thisName = document.URL.match(/\/([\w\-]+)\/stats/)[1];
var personalStatsManga = document.getElementById("personalStatsManga");
personalStatsManga.innerText = "";
var personalStatsMangaHead = document.createElement("h1");
personalStatsMangaHead.innerText = "Manga stats for " + thisName;
personalStatsManga.appendChild(document.createElement("hr"));
personalStatsManga.appendChild(personalStatsMangaHead);
var list = returnList(data);
var personalStatsMangaContainer = document.createElement("div");
personalStatsMangaContainer.innerText = "Propose some stats I can put here";
personalStatsManga.appendChild(personalStatsMangaContainer);
var addStat = function(text,value,comment){//value,value,html
var newStat = document.createElement("p");
newStat.classList.add("hohStat");
var newStatText = document.createElement("span");
newStatText.innerText = text;
var newStatValue = document.createElement("span");
newStatValue.innerText = value;
newStatValue.classList.add("hohStatValue");
newStat.appendChild(newStatText);
newStat.appendChild(newStatValue);
if(comment){
var newStatComment = document.createElement("span");
newStatComment.innerHTML = comment;
newStat.appendChild(newStatComment);
};
personalStatsManga.appendChild(newStat);
};
var chapters = 0;
var volumes = 0;
/*
For most airing anime, Anilist provides "media.nextAiringEpisode.episode"
Unfortunately, the same is not the case for releasing manga.
THIS DOESN'T MATTER the first time a user is reading something, as we are then just using the current progress.
But on a re-read, we need the total length to count all the chapters read.
I can (and do) get a lower bound for this by using the current progress (this is what Anilist does),
but this is not quite accurate, especially early in a re-read.
The list below is to catch some of those exceptions
*/
var commonUnfinishedManga = {
"53390":{//aot
chapters:110,
volumes:26
},
"30002":{//berserk
chapters:357,
volumes:40
},
"30013":{//one piece
chapters:921,
volumes:90
},
"85486":{//mha
chapters:202,
volumes:20
},
"74347":{//opm
chapters:99,
volumes:17
},
"30026":{//HxH
chapters:385,
volumes:36
},
"30656":{//vagabond
chapters:327,
volumes:37
},
"30104":{//yotsuba&
chapters:102,
volumes:14
}
};
var listCreatedTime = new Date(2018,9,26);
var currentTime = new Date();
if(currentTime - listCreatedTime > 365*24*60*60*1000){
console.log("remind hoh to update the commonUnfinishedManga list");
};
var unfinishedLookup = function(mediaId,mode,mediaStatus,mediaProgress){
if(mediaStatus === "FINISHED"){
return 0;//it may have finished since the list was updated
};
if(commonUnfinishedManga.hasOwnProperty(mediaId)){
if(mode === "chapters"){
return commonUnfinishedManga[mediaId].chapters;
}
else if(mode === "volumes"){
return commonUnfinishedManga[mediaId].volumes;
}
else if(mode === "volumesNow"){
if(commonUnfinishedManga[mediaId].chapters <= mediaProgress){
return commonUnfinishedManga[mediaId].volumes;
}
else{
return 0;//conservative
};
};
return 0;//fallback
}
else{
return 0;//not in our list
};
};
for(var i=0;i a.scoreRaw - b.scoreRaw);
for(var i=0;i maxRunLength){
maxRunLength = runLength;
maxRunLengthScore = list[i].scoreRaw;
};
}
else{
runLength = 1;
previouScore = list[i].scoreRaw;
};
};
addStat("Manga on list: ",list.length);
addStat("Manga rated: ",amount);
addStat("Total chapters: ",chapters);
addStat("Total volumes: ",volumes);
list.sort((a,b) => a.mediaId - b.mediaId);
if(amount != 0){//no scores
if(amount === 1){
addStat(
"Only one score given: ",
maxRunLengthScore
);
}
else{
addStat(
"Average score: ",
(Math.round(100*sumEntries/amount)/100).toFixed(2)
);
addStat("Median score: ",median);
if(maxRunLength > 1){
addStat("Most common score: ",maxRunLengthScore, " (" + maxRunLength + " instances)");
}
else{
addStat("Most common score: ","","no two scores alike");
};
};
};
//
var mangaFormatter = {
title : "Custom Manga Tags",
headings : ["Tag","Count","Mean Score","Chapters","Volumes"],
focus : 1,
celData : [
function(cel,data,index,isPrimary){
if(isPrimary){
var nameCellCount = document.createElement("div");
nameCellCount.innerText = (index+1);
nameCellCount.classList.add("count");
nameCellCount.setAttribute("data-v-e2beaf26","");
cel.appendChild(nameCellCount);
var nameCellTag = document.createElement("a");
nameCellTag.setAttribute("data-v-2f71893a","");
nameCellTag.innerText = data[index].name;
nameCellTag.style.cursor = "pointer";
cel.appendChild(nameCellTag);
}
else{
var nameCellTag = document.createElement("a");
nameCellTag.setAttribute("data-v-2f71893a","");
nameCellTag.innerText = data[index].name;
nameCellTag.href = "https://anilist.co/manga/" + data[index].mediaId + "/";
nameCellTag.style.marginLeft = "50px";
nameCellTag.style.display = "block";
cel.appendChild(nameCellTag);
}
},
function(cel,data,index,isPrimary){
if(isPrimary){
cel.innerText = data[index].list.length;
}
else{
if(data[index].status === "DROPPED"){
cel.innerHTML = "";
}
else if(data[index].status === "CURRENT"){
cel.innerHTML = "";
}
else if(data[index].status === "PLANNING"){
cel.innerHTML = "";
}
else if(data[index].status === "REPEATING"){
cel.innerHTML = "";
}
else if(data[index].status === "PAUSED"){
cel.innerHTML = "";
}
if(data[index].repeat === 1){
cel.innerHTML = svgAssets.repeat;
}
else if(data[index].repeat > 1){
cel.innerHTML = svgAssets.repeat + data[index].repeat;
}
}
},
function(cel,data,index,isPrimary){
if(isPrimary){
if(data[index].average === 0){
cel.innerText = "-";
}
else{
cel.innerText = Math.round(data[index].average);
}
}
else{
if(data[index].score === 0){
cel.innerText = "-";
}
else{
cel.innerText = Math.round(data[index].score);
}
}
},
function(cel,data,index){
cel.innerText = data[index].chaptersRead;
},
function(cel,data,index){
cel.innerText = data[index].volumesRead;
}
],
sorting : [
(a,b) => ("" + a.name).localeCompare(b.name),
(b,a) => a.list.length - b.list.length,
(b,a) => a.average - b.average,
(b,a) => a.chaptersRead - b.chaptersRead,
(b,a) => a.volumesRead - b.volumesRead
]
};
const mangaFields = [
{
key : "name",
sumable : false,
method : function(media){
return media.media.title.romaji;
}
},
{
key : "repeat",
sumable : false,
method : function(media){
return media.repeat;
}
},
{
key : "status",
sumable : false,
method : function(media){
return media.status;
}
},
{
key : "mediaId",
sumable : false,
method : function(media){
return media.mediaId;
}
},
{
key : "score",
sumable : false,
method : function(media){
return media.scoreRaw;
}
},
{
key : "chaptersRead",
sumable : true,
method : function(media){
return media.chaptersRead;
}
},
{
key : "volumesRead",
sumable : true,
method : function(media){
return media.volumesRead;
}
}
];
let customTags = customTagsCollection(list,mangaFormatter.title,mangaFields);
if(customTags.length){
let customTagsMangaTable = document.createElement("div");
customTagsMangaTable.id = "customTagsMangaTable";
personalStatsManga.appendChild(customTagsMangaTable);
drawTable(customTags,mangaFormatter,customTagsMangaTable);
};
semaPhoreManga = list;
nativeTagsReplacer();
};
generalAPIcall(queryMediaList,variables,personalStatsMangaCallback);
};
for(var i=1;i .content.container");
if(!navLinks || !contentContainer){
setTimeout(function(){
if(document.URL.match(/^https:\/\/anilist\.co\/user(\/.*)?/)){
addForumLinks();
};
},100);
return;
};
var forumLink = document.createElement("a");
forumLink.innerText = "Forum";
forumLink.classList.add("link");
forumLink.classList.add("hohForumLink");
navLinks.appendChild(forumLink);
var hohContent = document.createElement("div");
hohContent.id = "hohForumContent";
hohContent.style.display = "none";
var hohContentHeading = document.createElement("h2");
var threadsBody = document.createElement("div");
threadsBody.classList.add("hohThreadsBody");
hohContentHeading.innerText = "Forum Threads Created";
threadsBody.appendChild(hohContentHeading);
hohContent.appendChild(threadsBody);
contentContainer.appendChild(hohContent);
forumLink.onclick = function(){
for(var i=0;i