// ==UserScript== // @name Aniscripts // @namespace http://tampermonkey.net/ // @version 7.00 // @description Change stuff on Anilist.co // @author hoh // @match https://anilist.co/* // @grant GM_xmlhttpRequest // @license GPLv3 // @downloadURL none // ==/UserScript== (function(){ "use strict"; const scriptInfo = { "version" : "7.00", "link" : "https://greasyfork.org/en/scripts/370473-aniscripts", "author" : "hoh", "authorLink" : "https://anilist.co/user/hoh/", "license" : "GPLv3" }; /* 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. . */ /* "useScripts" contains the defaults for the various modules. This is stored in the user's localStorage. Many of the modules are closely tied to the Anilist API Other than that, some data loaded from MyAnimelist is the only external resource Optionally, a user may give the script privileges through the Anilist grant system, enabling some additional modules */ //a shared style node for all the modules. Most custom classes are prefixed by "hoh" to avoid collisions with native Anilist classes let style = document.createElement("style"); style.id = "aniscripts-styles"; style.type = "text/css"; //The default colour is rgb(var(--color-blue)) provided by Anilist, but rgb(var(--color-green)) is preferred for things related to manga style.textContent = ` body{ margin: 0px; } #hohSettings{ margin-top: 20px; display: none; } .apps + #hohSettings{ display: inline; } .hohTime{ position: absolute; right: 12px; top: 6px; 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; position: relative; } .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; } .hohMediaImageContainer{ vertical-align: bottom; margin-left: 400px; display: inline; position: relative; display: inline-block; min-height: 70px; width: calc(100% - 500px); text-align: right; padding-bottom: 1px; } .hohMediaImageContainer > a{ height: 70px; line-height: 0!important; display: inline-block; } span.hohMediaImageContainer{ line-height: 0!important; } .hohCommentsContainer{ margin-top: 5px; } .hohCommentsArea{ margin: 10px; display: none; padding-bottom: 2px; margin-top: 5px; width: 95%; } .hohCommentsContainer > a.link{ font-size: 1.3rem; } .hohComments{ float: right; display: none; margin-top: -21px; margin-right: 10px; 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(232,93,117); } .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: -15px; } .hohMonospace{ font-family: monospace; } .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; margin-left: -10px; padding: 5px 10px; font-weight: 700; } .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: 50px; width: 50px; display: inline-block; background-position: 50%; background-repeat: no-repeat; background-size: cover; margin-top: 11px; margin-bottom: 1px; } .hohRegularTag{ border-style: solid; border-width: 1px; border-radius: 3px; padding: 2px; margin-right: 3px; } .hohTableHider{ cursor: pointer; margin: 4px; color: rgb(var(--color-blue)); } .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: 0px; } .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; } .sidebar .tags .tag{ min-height: 35px; margin-bottom: 5px !important; } .custom-lists .el-checkbox__label{ display: inline !important; white-space: pre-wrap; white-space: -webkit-pre-wrap; white-space: normal; word-wrap: anywhere; word-break: break-word; } .hohStatusDot{ position: absolute; width: 10px; height: 10px; border-radius: 50px; } .hohStatusDotRight{ top: 2px; right: 2px; } .relations.hohRelationStatusDots .hohStatusDot{ position: relative; transform: translate(-5px,-5px); } .relations.hohRelationStatusDots > div.grid-wrap{ padding-top: 5px; } .relations.hohRelationStatusDots > h2{ margin-bottom: 5px; } .studio .container.header{ position: relative; } .studio .favourite{ position: absolute; top: 10px; right: 30px; } .filter .view-all{ background-color: rgb(var(--color-foreground)); height: 32px; border-radius: 3px; text-align: center; padding-top: 8px; } .title > a{ line-height: 1.15!important; } .embed .title{ line-height: 18px!important; } #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; } #hohDraw3x3{ margin-top: 5px; cursor: pointer; } .hohDisplayBox{ position: fixed; top: 80px; left: 200px; z-index: 999; padding: 20px; background-color: rgb(var(--color-foreground)); } .hohDisplayBoxClose{ position: absolute; right: 20px; top: 20px; cursor: pointer; background-color: red; } .hohFeedFilter{ position: absolute; top: 2px; font-size: 1.4rem; font-weight: 500; } .hohFeedFilter input{ width: 45px; background: none; border: none; margin-left: 6px; color: rgb(var(--color-text)); } .hohFeedFilter input::-webkit-outer-spin-button, .hohFeedFilter input::-webkit-inner-spin-button{ opacity: 1; } [list="staffRoles"]::-webkit-calendar-picker-indicator{ display: none; } [list="staffRoles"]{ background: rgb(var(--color-foreground)); background: rgb(var(--color-foreground)); padding: 5px; border-width: 0px; border-radius: 2px; margin-left: 20px; } .hohFeedFilter button{ color: rgb(var(--color-text)); cursor: pointer; background: none; border: none; margin-left: 10px; } .hohFeedFilter button:hover{ color: rgb(var(--color-blue)); } .actions .list .add{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .list-wrap .section-name, .quick-search input[placeholder="Search AniList"]{ text-transform: none; } .list-wrap{ counter-reset: animeCounter; } .medialist.table.compact .entry .title::before{ counter-increment: animeCounter; content: counter(animeCounter); display: inline-block; margin-right: 4px; margin-left: -17px; opacity: 0.2; text-align: right; width: 25px; min-width: 25px; font-size: 70%; } .hohEnumerateStaff{ position: absolute; margin-left: -12px; margin-top: 10px; } #hohMALscore .type{ font-size: 1.3rem; font-weight: 500; padding-bottom: 5px; } #hohMALscore .value{ color: rgb(var(--color-text-lighter)); font-size: 1.2rem; line-height: 1.3; } .hohMediaScore{ color: rgb(var(--color-text-lighter)); font-size: 1.2rem; position: absolute; top: -10px; padding-left: 10px; padding-right: 10px; margin-left: -10px; } .forum-thread .like .button{ margin-right: 0px!important; } #hohFilters{ margin-top: 5px; margin-bottom: 5px; } #hohFilters input{ width: 55px; margin: 5px; } .hohCompare{ margin-top: 10px; counter-reset: animeCounterComp; position: relative; } .hohCompare .hohUserRow, .hohCompare .hohHeaderRow{ background: rgb(var(--color-foreground)); } .hohCompare table, .hohCompare th, .hohCompare td{ border-top-width: 0px; border-bottom-width: 1px; border-right-width: 1px; border-left-width: 0px; border-style: solid; border-color: black; padding: 5px; } .hohCompare table{ background: rgb(var(--color-foreground-grey)); border-spacing: 0px; margin-top: 10px; border-right: none; border-bottom: none; } #app{ overflow: unset; } .list-stats{ margin-bottom: 0px!important; } .activity-feed-wrap, .activity-feed-wrap + div{ margin-top: 25px; } .page-content > .container, .notifications-feed, .page-content > .studio{ margin-top: 67px !important; } .hohUserRow td, .hohUserRow th{ min-width: 120px; border-top-width: 1px; position: sticky; top: 3px; z-index: 1000; background: rgb(var(--color-foreground)); } .hohHeaderRow td, .hohHeaderRow th{ border-top: none; } .hohUserRow input{ width: 100px; } .hohUserRow img{ width: 30px; height: 30px; border-radius: 2px; } tr.hohAnimeTable:nth-child(2n+1){ background-color: rgb(var(--color-foreground)); } .hohAnimeTable, .hohAnimeTable td{ position: relative; } .hohAnimeTable .hohStatusDot{ top: calc(50% - 5px); right: 5px; } .hohHeaderRow .hohStatusDot{ background: rgb(var(--color-background)); top: calc(50% - 5px); right: 5px; cursor: pointer; } .hohStatusProgress{ position: absolute; left: 60px; top: calc(50% - 5px); font-size: 60%; } .hohAnimeTable > td:nth-child(1)::before{ counter-increment: animeCounterComp; content: counter(animeCounterComp) ". "; position: absolute; left: 1px; text-align: right; width: 40px; color: rgb(var(--color-blue)); } .hohAnimeTable > td:nth-child(1){ padding-left: 43px; border-left-width: 1px; } .hohUserRow > td:nth-child(1), .hohHeaderRow > th:nth-child(1){ border-left: solid; border-left-width: 1px; border-color: black; } .hohArrowSort{ font-size: 3rem; cursor: pointer; margin-left: 4px; margin-right: 4px; } .hohFilterSort{ cursor: pointer; border-width: 1px; border-style: solid; padding: 2px; borderRadius: 4px; } .hohArrowSort:hover, .hohFilterSort:hover{ color: rgb(var(--color-blue)); } .hohAnimeTableRemove{ cursor: pointer; position: absolute; top: 0px; right: 0px; } .hohCheckbox.el-checkbox__input > span.el-checkbox__inner{ background-color: rgb(var(--color-foreground)); margin-right:10px; border-color: rgba(var(--color-text),.2); } .hohCheckbox input:checked + .el-checkbox__inner{ background-color: #409eff; border-color: #409eff; } .hohCheckbox input:checked + .el-checkbox__inner::after{ transform: rotate(45deg) scaleY(1); } .hohCheckbox input{ display: none; } .hohCheckbox{ margin-left: 2px; } .hohCheckbox .el-checkbox__inner::after { box-sizing: content-box; content: ""; border: 1px solid #fff; border-left: 0; border-top: 0; height: 7px; left: 4px; position: absolute; top: 1px; transform: rotate(45deg) scaleY(0); width: 3px; transition: transform .15s ease-in .05s; transform-origin: center; } .hohCheckbox .el-checkbox__inner { display: inline-block; position: relative; border: 1px solid #dcdfe6; border-radius: 2px; box-sizing: border-box; width: 14px; height: 14px; z-index: 1; transition: border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46); } .hohCheckbox.el-checkbox__input{ white-space: nowrap; cursor: pointer; outline: none; display: inline-block; line-height: 1; position: relative; vertical-align: middle; } .media-card .list-status[status="Repeating"]{ background: violet; } .sense-wrap{ display: none; } .hohDismiss{ cursor: pointer; transform: translate(20px,-11px); width: 10px; height: 5px; margin-left: -10px; } .substitution .media-roles:not(.substitution){ display: none; } .hohButton{ align-items: center; background: #3db4f2; border-radius: 4px; color: rgb(var(--color-text-bright)); cursor: pointer; display: inline-flex; font-size: 1.3rem; margin-right: 10px; margin-top: 15px; padding: 10px 15px; transition: .2s; border-width: 0px; } .user-social .title::before{ font-size: 1.6rem; } textarea{ background: rgb(var(--color-foreground)); } select{ background: rgb(var(--color-foreground)); padding: 5px; border-radius: 4px; border-width: 0px; margin: 4px; color: rgb(var(--color-text)); } .hohPostLink{ position: absolute; top: 30px; } .hohBlock{ padding: 4px; border-width: 1px; border-style: solid; border-radius: 5px; margin: 2px; } .hohBlockSpec{ padding-right: 15px; } .hohBlockCross{ padding: 5px; color: red; cursor: pointer; } .medialist .filters .filter-group:first-child > span{ position: relative; } .medialist .filters .filter-group:first-child > span .count{ position: absolute; right: 0px; } .like-wrap .users{ overflow-y: scroll!important; scrollbar-width: none; -ms-overflow-style: none; } .like-wrap .users::-webkit-scrollbar{ width: 0px; background: transparent; } .categories .category{ text-transform: none; white-space: nowrap; } .media-preview-card.hohFallback{ position: relative; } .media-preview-card .hohFallback{ position: absolute; top: 5px; left: 5px; word-break: break-word; overflow-y: hidden; max-height: 110px; max-width: 77px; } .media-preview-card .cover{ z-index: 3; } .hohChangeScore{ font-family: monospace; cursor: pointer; display: none; } .score[score="0"] .hohChangeScore, .medialist .score[score="0"]{ pointer-events: none; } .row:hover .hohChangeScore, .hohMediaScore:hover .hohChangeScore{ display: inline; } .activity-text .name[href="/user/Dunkan85/"]::after{ background-image: url(https://upload.wikimedia.org/wikipedia/commons/e/e4/Twitter_Verified_Badge.svg); background-size: 12px; display: inline-block; width: 12px; height: 12px; content: ""; margin-left: 5px; } .hohSumableStatusContainer{ float: right; } .hohSumableStatus{ width: 16px; height: 16px; text-align: center; vertical-align: middle; border-radius: 16px; line-height: 16px; color: black; font-size: 10px; display: inline-block; margin-left: 2px; } .relations.small > div{ margin-left: 5px; } .hohMyThreads{ color: rgb(var(--color-text-lighter)); padding: 5px 10px; font-size: 1.4rem; } .hohImport .el-checkbox__label{ padding-left: 0px; } .hohImportEntry{ width: 30%; display: inline-block; background-color: rgb(var(--color-foreground)); padding: 5px; margin: 5px; border-radius: 2px; } .hohImportRow{ margin: 10px; } .hohThemeSwitch{ align-items: center; background: rgb(var(--color-foreground)); border-radius: 4px; display: flex; justify-content: space-between; padding: 10px 13px; width: 100px; } .hohThemeSwitch .active{ color: rgb(var(--color-blue)); } .hohThemeSwitch > span{ cursor: pointer; } .user-social.listView .user-follow .wrap{ display: block!important; } .user-social.listView .user-follow .user{ height: 50px; width: 50px; margin: 5px; overflow: visible; border-top-right-radius: 0px; border-bottom-right-radius: 0px; } .user-social.listView .user-follow .user .name{ width: 250px; margin-left: 50px !important; opacity: 1; } .user-social.listView .thread-card .body-preview, .user-social.listView .thread-card .footer{ display: none; } .user-social.listView .thread-card .title{ margin-bottom: 0px; } .user-social.listView .thread-card{ margin-bottom: 10px; } .user-social.listView .user-comments .header{ display: none; } .user-social.listView .comment-wrap{ margin-bottom: 5px; } .hohDownload{ position: absolute; right: 10px; top: 305px; font-weight: bolder; font-size: 120%; } .media .hohDownload{ top: 375px; } meter::-webkit-meter-optimum-value{ background: rgb(var(--color-blue)); } meter::-moz-meter-bar{ background: rgb(var(--color-blue)); } .input-wrap.manga input[placeholder="Status"], .input-wrap.anime input[placeholder="Status"], .input-wrap.anime .form.score input{ width: 220px; } @media(max-width: 1040px){ .input-wrap.manga input[placeholder="Status"], .input-wrap.anime input[placeholder="Status"], .input-wrap.anime .form.score input{ width: 100%; } } @media(max-width: 760px){ #hohMALscore{ padding-right: 25px; } #hohMALscore .type{ font-weight: 400; } #hohMALscore .value{ color: rgb(var(--color-text)); font-size: 1.4rem; } .hohMediaImageContainer{ position: absolute; right: -22px; max-height: 30px; width: 25px; overflow: scroll; } .hohBackgroundUserCover{ margin-top: 1px; } .hohMediaImageContainer > a{ height: 20px; } .hohMediaImage{ height: 20px; width: 20px; margin-right: 0px } .hohNotification{ margin-right: 23px; font-size: 1.5rem; } .hohCommentsContainer{ position: relative; top: 70px; } .hohComments{ position: absolute; right: -5px; top: 5px; } .notifications-feed .filters p{ display: inline; margin-left: 10px; } .activity-feed .actions, .activity-feed .actions .action .count{ font-size: 1.6rem; } .hohDownload{ top: 50px; } .media .hohDownload{ top: 5px; } #dubNotice{ margin: 0px; } } @media(max-width: 500px){ .footer [href="https://anilist.co"], .footer [href="/sitemap/index.xml"]{ display: none; } .footer .links{ margin-left: -20px; } .markdown-editor{ padding: 12px 2px!important; } } .hohTable .row{ display: grid; grid-template-columns: 40% repeat(auto-fill, 120px); padding: 5px; cursor: pointer; } .hohTable .row.good{ grid-template-columns: 40% repeat(auto-fill, 150px); } .hohTable .row > div{ grid-row: 1; } .hohTable{ padding: 20px; background: rgb(var(--color-foreground)); } .hohTable .count{ display: inline-block; min-width: 20px; font-size: 70%; } .hohTable .hohSumableStatusContainer{ margin-right: 8px; } .hohTable .header.row{ background: rgb(var(--color-background)); } #regularAnimeTable, #regularMangaTable, #animeStaff, #animeStudios, #mangaStaff{ display: none!important; } .user[type="anime"][page="tags"]:not(.hohSpecialPage) #regularAnimeTable, .user[type="manga"][page="tags"]:not(.hohSpecialPage) #regularMangaTable, .user[type="anime"][page="staff"]:not(.hohSpecialPage) #animeStaff, .user[type="anime"][page="studios"]:not(.hohSpecialPage) #animeStudios, .user[type="manga"][page="staff"]:not(.hohSpecialPage) #mangaStaff{ display: block!important; } .user[type="anime"][page="tags"] .increase-stats::after, .user[type="manga"][page="tags"] .increase-stats::after, .user[type="anime"][page="staff"] .increase-stats::after, .user[type="anime"][page="studios"] .increase-stats::after, .user[type="manga"][page="staff"] .increase-stats::after{ content: "Or view the full list below:"; display: block; } .user .hohMilestones .milestones .milestone:nth-child(2)::after{ display: none; } .hohCategories{ margin-bottom: 20px; padding-right: 15px; padding-left: 0px; } .hohCategory{ display: inline-block; padding: 5px; margin: 3px; border-style: solid; border-radius: 5px; color: rgb(var(--color-text)); cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; font-size: 1.2rem; } .hohCategory.active{ background: rgb(var(--color-blue)); color: rgb(var(--color-text-bright)); } #hohSettings .hohSetting{ display: none; } #hohSettings.all .hohSetting, #hohSettings.Notifications .hohSetting.Notifications, #hohSettings.Feeds .hohSetting.Feeds, #hohSettings.Forum .hohSetting.Forum, #hohSettings.Lists .hohSetting.Lists, #hohSettings.Profiles .hohSetting.Profiles, #hohSettings.Stats .hohSetting.Stats, #hohSettings.Media .hohSetting.Media, #hohSettings.Navigation .hohSetting.Navigation, #hohSettings.Browse .hohSetting.Browse, #hohSettings.Script .hohSetting.Script, #hohSettings.Login .hohSetting.Login{ display: block; } .noLogin .hohSetting.Login{ opacity: 0.4; } .medialist.cards .entry-card .progress{ width: 60%; } #titleAliasInput{ max-width: 100%; } .hohAdvancedDollar{ font-weight: bold; margin-left: 9px; } .social input[list="socialUsers"]{ background: rgb(var(--color-foreground)); border-width: 0px; padding: 5px; margin-right: 5px; } .hohFeed{ --color-blue: 61,180,242; } .hohFeed{ margin-top: 20px; } .hohFeed .activity, .hohFeed .activity .reply{ min-height: 25px; position: relative; border-style: solid; border-width: 1px; border-bottom-width: 0px; } .hohFeed .activity .replies{ margin-left: 60px; margin-top: 5px; } .hohFeed .activity:last-child{ border-bottom-width: 1px; } .hohFeed .activity a{ text-decoration: none; color: rgb(var(--color-blue)); } .hohFeed .hohButton{ font-size: 1rem; color: initial; margin: 5px; } .hohFeed img{ max-width: 500px; } .hohFeed .markdown_spoiler{ background: rgb(31, 35, 45); color: rgb(31, 35, 45); } .hohFeed .markdown_spoiler:hover{ color: rgb(159,173,189); } .hohFeed .markdown_spoiler img{ filter: blur(10px) hue-rotate(60deg) brightness(0.7); } .hohFeed .markdown_spoiler:hover img{ filter: none; } .hohFeed .markdown_spoiler::after{ content: "Spoiler"; color: rgb(159,173,189); margin-left: 2px; } .hohZoom{ transform: scale(1.5); transform-origin: 0 0; transition: transform 0.4s; z-index: 200; box-shadow: 5px 5px 5px black; } .hohZoom .reply-wrap{ background: rgb(var(--color-background)); } .hohTable.hohNoPointer .row, .hohNoPointer{ cursor: unset; } .hohNewChapter{ position: relative; } .hohNewChapter .hohDisplayBoxClose{ display: none; top: 0px; } .hohNewChapter:hover .hohDisplayBoxClose{ display: inline; } .hohFeed .activity:hover > .time{ color: rgb(var(--color-blue)); } .hohSocialFeed{ position: relative; } .hohReplaceFeed > *:not(.hohSocialFeed){ display: none; } `; let documentHead = document.querySelector("head"); if(documentHead){ documentHead.appendChild(style); } else{ return;//xml documents or something. At least it's not a place where the script can run } try{ localStorage.setItem("test","test"); localStorage.removeItem("test"); } catch(e){ alert("Error: LocalStorage not available."); console.log("LocalStorage, required for saving settings, is not available. Terminating Aniscripts."); return; } const notificationColourDefaults = { "ACTIVITY_LIKE":{"colour":"rgb(250,122,122)","supress":false}, "ACTIVITY_REPLY_LIKE":{"colour":"rgb(250,122,122)","supress":false}, "THREAD_COMMENT_LIKE":{"colour":"rgb(250,122,122)","supress":false}, "THREAD_LIKE":{"colour":"rgb(250,122,122)","supress":false}, "THREAD_COMMENT_REPLY":{"colour":"rgb(61,180,242)","supress":false}, "ACTIVITY_REPLY":{"colour":"rgb(61,180,242)","supress":false}, "ACTIVITY_MESSAGE":{"colour":"rgb(123,213,85)","supress":false}, "FOLLOWING":{"colour":"rgb(123,213,85)","supress":false}, "ACTIVITY_MENTION":{"colour":"rgb(123,213,85)","supress":false}, "THREAD_COMMENT_MENTION":{"colour":"rgb(123,213,85)","supress":false}, "THREAD_SUBSCRIBED":{"colour":"rgb(247,191,99)","supress":false}, "AIRING":{"colour":"rgb(247,191,99)","supress":false} }; let useScripts = {//most modules are turned on by default notifications: true, socialTab: true, forumComments: true, forumMedia: true, staffPages: true, tagDescriptions: true, completedScore: true, droppedScore: false, moreStats: true, characterFavouriteCount: true, studioFavouriteCount: true, CSSfavs: true, CSScompactBrowse: true, CSSmangaGreen: false, CSSfollowCounter: true, CSSsubmissionCounter: false, CSSprofileClutter: false, CSSdecimalPoint: false, CSSverticalNav: false, CSSbannerShadow: true, hideLikes: false, dubMarker: false, CSSsmileyScore: true, CSSdarkDropdown: true, CSSexpandFeedFilters: false, feedCommentFilter: false, feedCommentComments: 0, feedCommentLikes: 0, colourPicker: true, colourSettings: [], mangaBrowse: false, progressBar: false, noRewatches: false, hideCustomTags: false, shortRomaji: false, replaceNativeTags: true, draw3x3: true, newChapters: true, limitProgress8: false, limitProgress10: false, tagIndex: true, ALbuttonReload: true, expandRight: false, timeToCompleteColumn: false, mangaGuess: true, replaceStaffRoles: true, settingsTip: true, enumerateSubmissionStaff: true, MALscore: false, mobileFriendly: false, entryScore: true, activityTimeline: true, browseFilters: true, embedHentai: false, comparissionPage: true, noImagePolyfill: false, reviewConfidence: true, blockWord: false, dropdownOnHover: false, showMarkdown: true, myThreads: false, dismissDot: true, moreImports: true, plussMinus: true, milestones: false, allStudios: false, CSSmobileTags: true, termsFeed: false, customCSS: false, subTitleInfo: false, customCSSValue: "", expandDescriptions: true, negativeCustomList: false, globalCustomList: false, dblclickZoom: false, homeScroll: true, blockWordValue: "nsfw", hideGlobalFeed: false, profileBackground: true, yearStepper: true, profileBackgroundValue: "inherit", viewAdvancedScores: true, databaseStats: {//default numbers "anime": 12927, "manga": 45432, "users": 263880, "staff": 28753, "characters": 71664, "reviews": 2272, "updated": 0 }, notificationColours: notificationColourDefaults, staffRoleOrder: "alphabetical", titleLanguage: "ROMAJI", dubMarkerLanguage: "English", accessToken: "", aniscriptsAPI: false }; let userObject = JSON.parse(localStorage.getItem("auth")); let whoAmI = ""; let whoAmIid = 0; try{//use later for some scripts whoAmI = document.querySelector(".nav .links .link[href^='/user/']").href.match(/\/user\/(.*)\//)[1];//looks at the nav } catch(err){ if(userObject){ whoAmI = userObject.name; } else{ console.warn("could not get username"); } } let forceRebuildFlag = false; useScripts.save = function(){ localStorage.setItem("hohSettings",JSON.stringify(useScripts)); }; const useScriptsSettings = JSON.parse(localStorage.getItem("hohSettings")); if(useScriptsSettings){ let 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]; }); } if(userObject){ useScripts.titleLanguage = userObject.options.titleLanguage; whoAmIid = userObject.id; } useScripts.save(); function safeURL(URL){ return encodeURIComponent(URL.replace(/\s|\/|:|★/g,"-").replace(/(\.|\)|\\|#|!|,|’)/g,"").replace(/ä/g,"a")); } function fuzzyDateCompare(first,second){ if(!first.year || !second.year){ return -1 } if(first.year > second.year){ return 0 } else if(first.year < second.year){ return 1 } if(!first.month || !second.month){ return -1 } if(first.month > second.month){ return 0 } else if(first.month < second.month){ return 1 } if(!first.day || !second.day){ return -1 } if(first.day > second.day){ return 0 } else if(first.day < second.day){ return 1 } return -1 } function formatTime(diff,type){ let magRound = function(num){ if(num < 1){ return Math.round(num); } else{ if( Math.log(Math.ceil(num)) < 2*Math.log(num) - Math.log(Math.floor(num)) ){ return Math.ceil(num); } else{ return Math.floor(num); }; }; }; let times = [ {name: "year",short: "y",value: 60*60*24*365}, {name: "month",short: "m",value: 60*60*24*30}, {name: "week",short: "w",value: 60*60*24*7}, {name: "day",short: "d",value: 60*60*24}, {name: "hour",short: "h",value: 60*60}, {name: "minute",short: "m",value: 60}, {name: "second",short: "s",value: 1}, ]; let timeIndex = 0; let significantValue = 0; let reminder = 0; do{ significantValue = diff/times[timeIndex].value; reminder = (diff - Math.floor(significantValue) * times[timeIndex].value)/times[timeIndex + 1].value; timeIndex++; }while(!Math.floor(significantValue) && timeIndex < (times.length - 1)); timeIndex--; if(!Math.floor(significantValue)){ if(type === "short"){ return magRound(diff) + "s"; }; if(magRound(diff) === 1){ return magRound(diff) + " second"; }; return magRound(diff) + " seconds"; } if(Math.floor(significantValue) > 1){ if(type === "short"){ return magRound(significantValue) + times[timeIndex].short; }; return magRound(significantValue) + " " + times[timeIndex].name + "s"; } if(magRound(reminder) > 1){ if(type === "short"){ return "1" + times[timeIndex].short + " " + magRound(reminder) + times[timeIndex + 1].short; } return "1 " + times[timeIndex].name + " " + magRound(reminder) + " " + times[timeIndex + 1].name + "s"; } if(magRound(reminder) === 1){ if(type === "short"){ return "1" + times[timeIndex].short + " 1" + times[timeIndex + 1].short; } return "1 " + times[timeIndex].name + " 1 " + times[timeIndex + 1].name; } if(type === "short"){ return "1" + times[timeIndex].short; } return "1 " + times[timeIndex].name; } function nativeTimeElement(timestamp){ let dateObj = new Date(timestamp*1000); let elem = create("time"); elem.setAttribute("datetime",dateObj); elem.title = dateObj.toLocaleDateString() + ", " + dateObj.toLocaleTimeString(); let now = new Date(); let diff = Math.round(now.valueOf()/1000) - Math.round(dateObj.valueOf()/1000); if(diff === 0){ elem.innerText = "Just now"; } if(diff === 1){ elem.innerText = "1 second ago"; } else if(diff < 60){ elem.innerText = diff + " seconds ago"; } else{ diff = Math.floor(diff/60); if(diff === 1){ elem.innerText = "1 minute ago"; } else if(diff < 60){ elem.innerText = diff + " minutes ago"; } else{ diff = Math.floor(diff/60); if(diff === 1){ elem.innerText = "1 hour ago"; } else if(diff < 24){ elem.innerText = diff + " hours ago"; } else{ diff = Math.floor(diff/24); if(diff === 1){ elem.innerText = "1 day ago"; } else if(diff < 7){ elem.innerText = diff + " days ago"; } else if(diff === 7){ elem.innerText = "1 week ago"; } else if(diff < 30){ elem.innerText = Math.floor(diff/7) + " weeks ago"; } else if(diff === 30){ elem.innerText = "1 month ago"; } else if(diff < 365){ elem.innerText = Math.floor(diff/30) + " months ago"; } else{ diff = Math.floor(diff/365); if(diff === 1){ elem.innerText = "1 year ago"; } else{ elem.innerText = diff + " years ago"; } } } } } return elem; } let wilson = function(positiveScore,total){ if(total === 0){ return { left: 0, right: 0 }; } // phat is the proportion of successes // in a Bernoulli trial process let phat = positiveScore / total; // z is 1-alpha/2 percentile of a standard // normal distribution for error alpha=5% let z = 1.96; // implement the algorithm https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval#Wilson_score_interval let a = phat + z * z / (2 * total); let b = z * Math.sqrt((phat * (1 - phat) + z * z / (4 * total)) / total); let c = 1 + z * z / total; return { left: (a - b) / c, right: Math.min(1,(a + b) / c) }; }; Number.prototype.roundPlaces = function(places){ return +( Math.round( this * Math.pow(10,places) ) / Math.pow(10,places) ); } String.prototype.capitalize = function(){ return this.charAt(0).toUpperCase() + this.slice(1); } let VALUE = ((a,b) => a - b);//Used for storting functions let VALUE_DESC = ((b,a) => a - b); let TRUTHY = (a => a);//filtering let ACCUMULATE = function(a,b){ return (a || 0) + (b || 0); }; function create(type,classes,text,appendLocation,cssText){ let element = document.createElement(type); if(Array.isArray(classes)){ element.classList.add(...classes); } else if(classes){ if(classes[0] === "#"){ element.id = classes.substring(1); } else{ element.classList.add(classes); } }; if(text || text === 0){ element.innerText = text; }; if(appendLocation){ appendLocation.appendChild(element); }; if(cssText){ element.style.cssText = cssText; }; return element; }; function createCheckbox(target,id){//target[,id] let hohCheckbox = create("label",["hohCheckbox","el-checkbox__input"],false,target); let checkbox = create("input",false,false,hohCheckbox); if(id){ checkbox.id = id; } checkbox.type = "checkbox"; create("span","el-checkbox__inner",false,hohCheckbox); return checkbox; } const svgAssets = { envelope : "✉", cross : "✕", like : "♥", likeNative : ` `, frown : ` `, meh : ` `, smile : ` `, star : ` `, //the column sorting arrow angleDown : ` `, view : ` `, reply : ` `, repeat : ` `, external : ` `, listView : ` `, simpleListView : ` `, bigListView : ` `, compactView : ` `, cardView : ` `, link : ` ` }; const distributionColours = { "COMPLETED" : "rgb(104, 214, 57)", "CURRENT" : "rgb( 2, 169, 255)", "PAUSED" : "rgb(247, 121, 164)", "DROPPED" : "rgb(232, 93, 117)", "PLANNING" : "rgb(247, 154, 99)", "REPEATING" : "violet" }; const distributionFormats = { "TV" : "TV", "TV_SHORT" : "TV Short", "MOVIE" : "Movie", "SPECIAL" : "Special", "OVA" : "OVA", "ONA" : "ONA", "MUSIC" : "Music", "MANGA" : "Manga", "NOVEL" : "Light Novel", "ONE_SHOT" : "One Shot" }; const distributionStatus = { "FINISHED" : "Finished", "RELEASING" : "Releasing", "NOT_YET_RELEASED" : "Not Yet Released", "CANCELLED" : "Cancelled" }; if(useScripts.mangaBrowse){ let navLinks = document.querySelector(`#nav .links .link[href="/search/anime"]`); if(navLinks){ navLinks.href = "/search/manga"; /*must remove the existing evenlistener for clicks. the reason for this is that it fires before the link, making the href useless this unfortunately turns it into a regular link, which reloads the page, so it's slower than the default behaviour. but since user interactions is even slower, this still saves time for those who only are interested in manga */ let mangaBrowseLink = navLinks.cloneNode(true);//copying and pasting the node should remove all event references to it navLinks.parentNode.replaceChild(mangaBrowseLink,navLinks); }; }; if(useScripts.colourPicker && (!useScripts.mobileFriendly)){ let colourStyle = create("style"); colourStyle.id = "colour-picker-styles"; colourStyle.type = "text/css"; documentHead.appendChild(colourStyle); const basicStyles = ` .footer .links{ margin-left: calc(0px + 1%); transform: translate(0px,10px); } .hohColourPicker .hohCheckbox{ margin-left: 10px; } `; let applyColourStyles = function(){ colourStyle.textContent = basicStyles;//eh, fix later. useScripts.colourSettings.forEach(function(colour){ let hexToRgb = function(hex){ let result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1],16), g: parseInt(result[2],16), b: parseInt(result[3],16) } : null; } if(colour.initial){ let rgbSet = hexToRgb(colour.initial); colourStyle.textContent += ":root{" + colour.colour + ":" + rgbSet.r + "," + rgbSet.g + "," + rgbSet.b + ";}"; }; if(colour.dark){ let rgbSet = hexToRgb(colour.dark); colourStyle.textContent += ".site-theme-dark{" + colour.colour + ":" + rgbSet.r + "," + rgbSet.g + "," + rgbSet.b + ";}"; }; if(colour.contrast){ let rgbSet = hexToRgb(colour.contrast); colourStyle.textContent += ".site-theme-contrast{" + colour.colour + ":" + rgbSet.r + "," + rgbSet.g + "," + rgbSet.b + ";}"; }; }); };applyColourStyles(); let colourPickerLocation = document.querySelector("#app > .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" ]; let colourChanger = function(){ for(var i=0;i a${dataSelect} ,a.title${dataSelect} ,.overlay > a.title${dataSelect} ,.media-preview-card a.title${dataSelect} ,.quick-search-results .el-select-dropdown__item a${dataSelect}> span ,.media-embed${dataSelect} .title ,.status > a.title${dataSelect} ,.role-card a.content${dataSelect} > .name{ visibility: hidden; font-size: 2%; line-height: 0px; } a.title${dataSelect}::before ,.quick-search-results .el-select-dropdown__item a${dataSelect} > span::before ,.role-card a.content${dataSelect} > .name::before ,.title > a${dataSelect}::before ,.home .status > a.title${dataSelect}::before ,.media-embed${dataSelect} .title::before ,.overlay > a.title${dataSelect}::before ,.media-preview-card a.title${dataSelect}::before{ content:"${targetName}" }`; } } const shortRomaji = (useScripts.shortRomaji ? [ ["/anime/30/","Evangelion"], ["/anime/32/","End of Evangelion"], ["/anime/5114/","FMA:B"], ["/anime/10620/","Mirai Nikki"], ["/anime/1575/","Code Geass"], ["/anime/2904/","Code Geass R2"], ["/anime/21355/","Re:Zero"], ["/anime/2001/","Gurren Lagann"], ["/anime/21202/","Konosuba!"], ["/anime/21699/","Konosuba! 2"], ["/anime/21574/","Konosuba!: Kono Subarashii Choker ni Shufuku wo!"], ["/anime/9756/","Madoka★Magica"], ["/anime/9989/","AnoHana"], ["/anime/20623/","Kiseijuu"], ["/anime/14741/","Chuunibyou!"], ["/anime/18671/","Chuunibyou! 2"], ["/anime/14813/","OreGairu"], ["/anime/20920/","Danmachi"], ["/anime/8074/","HIGHSCHOOL OF THE DEAD"], ["/anime/849/","Haruhi"], ["/anime/4382/","Haruhi (2009)"], ["/anime/19603/","Unlimited Blade Works"], ["/anime/20792/","Unlimited Blade Works 2"], ["/anime/8769/","OreImo"], ["/anime/10020/","OreImo Specials"], ["/anime/13659/","OreImo 2"], ["/anime/18857/","OreImo 2 Specials"], ["/anime/2025/","Darker than BLACK"], ["/anime/20698/","OreGairu 2"], ["/anime/16592/","Danganronpa"], ["/anime/16742/","WataMote"], ["/anime/101291/","Bunny Girl-senpai"], ["/anime/104157/","Bunny Girl-senpai Movie"], ["/anime/19221/","NouKome"], ["/anime/45/","Rurouni Kenshin"], ["/anime/8795/","Panty & Stocking"], ["/anime/21860/","Sukasuka"], ["/anime/33/","Berserk"], ["/anime/97938/","Boruto"], ["/anime/97907/","Death March"], ["/anime/100183/","Gun Gale Online"], ["/anime/20474/","JoJo: Stardust Crusaders"], ["/anime/20799/","JoJo: Stardust Crusaders - Egypt-hen"], ["/anime/21450/","JoJo: Diamond wa Kudakenai"], ["/anime/102883/","JoJo: Ougon no Kaze"], ["/anime/101921/","Kaguya-sama wa Kokuraseta"], ["/anime/101166/","Danmachi: Orion no Ya"], ["/anime/20791/","Heaven’s Feel I. presage flower"], ["/anime/21718/","Heaven’s Feel II. lost butterfly"], ["/anime/21719/","Heaven’s Feel III. spring song"], ["/anime/1089/","Macross: Ai Oboete Imasu ka"], ["/anime/572/","Nausicaä"], ["/anime/513/","Laputa"], ["/anime/44/","Rurouni Kenshin: Tsuioku-hen"], ["/anime/528/","Mewtwo no Gyakushuu"], ["/anime/530/","Sailor Moon"], ["/anime/740/","Sailor Moon R"], ["/anime/532/","Sailor Moon S"], ["/anime/1239/","Sailor Moon SuperS"], ["/anime/996/","Sailor Moon Sailor Stars"], ["/anime/949/","Gunbuster!"], ["/anime/18677/","Yuushibu"], ["/manga/86635/","Kaguya-sama wa Kokurasetai"], ["/anime/17074/","Monogatari Second Season"], ["/anime/20910/","Shimoseka"] ] : []); function initCSS(){ moreStyle.textContent = ""; let aliasFlag = false; if(useScripts.shortRomaji){ shortRomaji.forEach(createAlias); aliasFlag = true; } const titleAliases = JSON.parse(localStorage.getItem("titleAliases")); if(titleAliases){ aliasFlag = true; titleAliases.forEach(createAlias); } if(aliasFlag){ moreStyle.textContent += ` a.title::before ,.quick-search-results .el-select-dropdown__item a > span::before{ visibility: visible; font-size: 5000%; line-height: 1.15; margin-right: 2px; } .medialist.table .title > a::before{ visibility: visible; font-size: 1.5rem; margin-right: 2px; } .medialist.compact .title > a::before ,.medialist.cards .title > a::before ,.home .status > a.title::before ,.media-embed .title::before{ visibility: visible; font-size: 1.3rem; margin-right: 2px; } .role-card a.content > .name::before{ visibility: visible; font-size: 1.2rem; } .overlay > a.title::before ,.media-preview-card a.title::before{ visibility: visible; font-size: 1.4rem; line-height: 1.15; } .role-card a.content > .name{ line-height: 1.3!important; }`; } if(useScripts.CSSfavs){ /*adds a logo to most favourite studio entries. Add more if needed */ const favStudios = [ [1, "Studio-Pierrot", "https://upload.wikimedia.org/wikipedia/en/thumb/1/10/Studio_Pierrot.jpg/220px-Studio_Pierrot.jpg"], [2, "Kyoto-Animation","https://upload.wikimedia.org/wikipedia/en/thumb/b/bf/Kyoto_Animation_logo.svg/250px-Kyoto_Animation_logo.svg.png"], [3, "GONZO", "https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Gonzo_company.png/220px-Gonzo_company.png"], [4, "BONES", "https://i.stack.imgur.com/7pRQn.png"], [5, "Bee-Train", "https://upload.wikimedia.org/wikipedia/commons/4/45/Bee_Train.svg"], [6, "Gainax", "https://upload.wikimedia.org/wikipedia/en/thumb/a/a8/Gainax_logo.svg/220px-Gainax_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"], [8, "Artland", "https://upload.wikimedia.org/wikipedia/en/thumb/a/ae/Artland_logo.gif/200px-Artland_logo.gif"], [10, "Production-IG", "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Production_I.G_Logo.svg/250px-Production_I.G_Logo.svg.png"], [11, "MADHOUSE", "https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Madhouse_studio_logo.svg/300px-Madhouse_studio_logo.svg.png"], [13, "Studio-4C", "https://upload.wikimedia.org/wikipedia/en/e/ec/Studio_4C_logo.png"], [14, "Sunrise", "https://upload.wikimedia.org/wikipedia/en/thumb/8/8c/Sunrise_company_logo.svg/220px-Sunrise_company_logo.svg.png"], [17, "Aniplex", "https://upload.wikimedia.org/wikipedia/commons/thumb/3/37/Aniplex_logo.svg/220px-Aniplex_logo.svg.png"], [18, "Toei-Animation", "https://i.stack.imgur.com/AjzVI.png",76,30], [21, "Studio-Ghibli", "https://upload.wikimedia.org/wikipedia/en/thumb/c/ca/Studio_Ghibli_logo.svg/220px-Studio_Ghibli_logo.svg.png",76,30], [22, "Nippon-Animation","https://upload.wikimedia.org/wikipedia/en/thumb/b/b4/Nippon.png/200px-Nippon.png"], [25, "Milky-Animation-Label","https://img.fireden.net/a/image/1467/16/1467164781976.png"], [27, "Xebec", "https://upload.wikimedia.org/wikipedia/fr/b/bd/Logo_Xebec.svg"], [28, "Oriental-Light-and-Magic","https://i.stack.imgur.com/Sbllv.png"], [32, "Manglobe", "https://i.imgur.com/W8U74wO.png"], [34, "Hal-Film-Maker", "https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Hal_film_maker_logo.gif/220px-Hal_film_maker_logo.gif"], [35, "Seven-Arcs", "https://upload.wikimedia.org/wikipedia/en/a/ac/Seven_Arcs_logo.png",76,25], [36, "Studio-Gallop", "https://upload.wikimedia.org/wikipedia/commons/3/37/Studio_Gallop.png"], [37, "Studio-DEEN", "https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/Studio_Deen_logo.svg/220px-Studio_Deen_logo.svg.png"], [38, "Arms", "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Arms_Corporation.png/200px-Arms_Corporation.png"], [39, "Daume", "https://upload.wikimedia.org/wikipedia/commons/3/3e/Daume_studio_logo.png",70,35], [41, "Satelight", "https://i.stack.imgur.com/qZVQg.png",76,30], [43, "ufotable", "https://upload.wikimedia.org/wikipedia/en/5/56/Ufotable-Logo.png",76,30], [44, "Shaft", "https://i.stack.imgur.com/tuqhK.png"], [45, "Pink-Pineapple", "https://i.stack.imgur.com/2NMQ0.png"], [47, "Studio-Khara", "https://i.stack.imgur.com/2d1TT.png",76,30], [48, "AIC", "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/AIC_logo.png/220px-AIC_logo.png"], [51, "diomeda", "https://i.stack.imgur.com/ZHt3T.jpg"], [53, "Dentsu", "https://upload.wikimedia.org/wikipedia/commons/thumb/1/10/Dentsu_logo.svg/200px-Dentsu_logo.svg.png"], [58, "Square-Enix", "https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Square_Enix_logo.svg/230px-Square_Enix_logo.svg.png"], [65, "Tokyo-Movie-Shinsha","https://upload.wikimedia.org/wikipedia/en/2/22/Tokyo_Movie_Shinsha.png"], [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], [68, "Mushi-Productions","https://i.stack.imgur.com/HmYdT.jpg"], [73, "TMS-Entertainment","https://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/TMS_Entertainment_logo.svg/220px-TMS_Entertainment_logo.svg.png"], [79, "Genco", "https://www.thefilmcatalogue.com/assets/company-logos/5644/logo_en.png"], [86, "Group-TAC", "https://upload.wikimedia.org/wikipedia/commons/b/b7/Group_TAC.png"], [91, "feel", "https://upload.wikimedia.org/wikipedia/en/thumb/0/07/Feel_%28company%29_logo.png/220px-Feel_%28company%29_logo.png",76,25], [95, "Doga-Kobo", "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Doga_Kobo_Logo.svg/220px-Doga_Kobo_Logo.svg.png"], [97, "ADV-Films", "https://upload.wikimedia.org/wikipedia/en/4/45/A.D._Vision_%28logo%29.png"], [102, "FUNimation-Entertainment","https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/Funimation_2016.svg/320px-Funimation_2016.svg.png"], [103, "Tatsunoko-Production","https://upload.wikimedia.org/wikipedia/commons/thumb/7/7a/Tatsunoko_2016_logo.png/300px-Tatsunoko_2016_logo.png"], [104, "Lantis", "https://upload.wikimedia.org/wikipedia/commons/3/39/Lantis_logo.png"], [108, "Media-Factory", "https://i.stack.imgur.com/rR7yU.png",76,25], [112, "Brains-Base", "https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Brain%27s_Base_logo.png/200px-Brain%27s_Base_logo.png"], [113, "Kadokawa-Shoten","https://i.stack.imgur.com/ZsUDR.gif"], [119, "Viz-Media", "https://upload.wikimedia.org/wikipedia/en/thumb/e/e9/Viz_Media_logo.png/220px-Viz_Media_logo.png"], [132, "PA-Works", "https://i.stack.imgur.com/7kjSn.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"], [144, "Pony-Canyon", "https://i.stack.imgur.com/9kkew.png"], [145, "TBS", "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/TBS_logo.svg/200px-TBS_logo.svg.png"], [150, "Sanrio", "https://upload.wikimedia.org/wikipedia/en/thumb/4/41/Sanrio_logo.svg/220px-Sanrio_logo.svg.png"], [159, "Kodansha", "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Kodansha.png/200px-Kodansha.png"], [166, "Movic", "https://upload.wikimedia.org/wikipedia/commons/f/f3/Movic_logo.png"], [167, "Sega", "https://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Sega_logo.svg/200px-Sega_logo.svg.png"], [169, "Fuji-TV", "https://upload.wikimedia.org/wikipedia/en/thumb/e/e9/Fuji_TV_logo.svg/225px-Fuji_TV_logo.svg.png",76,30], [193, "Idea-Factory", "https://upload.wikimedia.org/wikipedia/en/e/eb/Idea_factory.gif"], [196, "Production-Reed","https://upload.wikimedia.org/wikipedia/fr/7/7d/Production_Reed_Logo.png"], [199, "Studio-Nue", "https://i.stack.imgur.com/azzKH.png"], [200, "Tezuka-Productions","https://upload.wikimedia.org/wikipedia/fr/f/fe/Tezuka_Productions_Logo.png"], [238, "ATX", "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c6/AT-X_logo.svg/150px-AT-X_logo.svg.png",76,30], [247, "ShinEi-Animation","https://i.stack.imgur.com/b2lcL.png"], [262, "Kadokawa-Pictures-USA","https://i.stack.imgur.com/ZsUDR.gif"], [287, "David-Production","https://upload.wikimedia.org/wikipedia/en/thumb/7/75/David_production.jpg/220px-David_production.jpg",76,30], [290, "Kinema-Citrus", "https://upload.wikimedia.org/wikipedia/commons/c/c0/Kinema_Citrus_logo.png",76,25], [291, "CoMix-Wave", "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/Cwflogo.png/150px-Cwflogo.png"], [292, "AIC-Plus", "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/AIC_logo.png/220px-AIC_logo.png"], [300, "SILVER-LINK", "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/Silver_Link_Logo.svg/220px-Silver_Link_Logo.svg.png"], [309, "GoHands", "https://i.stack.imgur.com/pScIZ.jpg"], [314, "White-Fox", "https://i.stack.imgur.com/lwG1T.png",76,30], [333, "TYO-Animations", "https://i.stack.imgur.com/KRqAp.jpg",76,25], [334, "Ordet", "https://i.stack.imgur.com/evr12.png",76,30], [346, "Hoods-Entertainment","https://i.stack.imgur.com/p7S0I.png"], [352, "Kadokawa-Pictures-Japan","https://i.stack.imgur.com/ZsUDR.gif"], [365, "PoRO", "https://i.stack.imgur.com/3rlAh.png"], [372, "NIS-America-Inc","https://upload.wikimedia.org/wikipedia/en/e/e7/Nis.png"], [376, "Sentai-Filmworks","https://i.stack.imgur.com/JV8R6.png",74,30], [397, "Bridge", "https://i.imgur.com/4Qn4EmK.png"], [418, "Studio-Gokumi", "https://i.stack.imgur.com/w1y22.png"], [436, "AIC-Build", "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/AIC_logo.png/220px-AIC_logo.png"], [437, "Kamikaze-Douga", "https://img7.anidb.net/pics/anime/178777.jpg"], [456, "Lerche", "https://i.stack.imgur.com/gRQPc.png"], [459, "Nitroplus", "https://upload.wikimedia.org/wikipedia/en/thumb/0/09/Nitroplus_logo.png/220px-Nitroplus_logo.png"], [493, "Aniplex-of-America", "https://upload.wikimedia.org/wikipedia/commons/thumb/3/37/Aniplex_logo.svg/220px-Aniplex_logo.svg.png"], [503, "Nintendo-Co-Ltd","https://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/Nintendo.svg/220px-Nintendo.svg.png"], [537, "SANZIGEN", "https://i.stack.imgur.com/CkuqH.png",76,30], [555, "Studio-Chizu", "https://i.stack.imgur.com/h2RuH.gif"], [561, "A1-Pictures", "https://i.stack.imgur.com/nBUYo.png",76,30], [569, "MAPPA", "https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/MAPPA_Logo.svg/220px-MAPPA_Logo.svg.png"], [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"], [803, "Trigger", "https://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Trigger_Logo.svg/220px-Trigger_Logo.svg.png"], [783, "GKids", "https://upload.wikimedia.org/wikipedia/commons/thumb/c/ca/GKIDS_logo.svg/150px-GKIDS_logo.svg.png"], [839, "LIDENFILMS", "https://upload.wikimedia.org/wikipedia/en/6/6e/LidenFilms.png",76,30], [858, "Wit-Studio", "https://i.stack.imgur.com/o3Rro.png",76,30], [911, "Passione", "https://i.stack.imgur.com/YyEGg.jpg"], [4418,"8bit", "https://upload.wikimedia.org/wikipedia/en/e/ea/8-Bit_Animation_Studio.png"], [6069,"Studio-3Hz", "https://i.stack.imgur.com/eD0oe.jpg"], [6071,"Studio-Shuka", "https://upload.wikimedia.org/wikipedia/commons/f/fa/Shuka_studio.jpg"], [6077,"Orange", "https://i.stack.imgur.com/ve9mm.gif"], [6142,"Geno-Studio", "https://upload.wikimedia.org/wikipedia/en/thumb/f/f4/Genostudio.jpg/220px-Genostudio.jpg",76,25], [6145,"Science-SARU", "https://i.stack.imgur.com/zo9Fx.png"], [6222,"CloverWorks", "https://i.stack.imgur.com/9Fvr7.jpg"], [6225,"TriF-studio", "https://i.stack.imgur.com/lL85s.png",60,50], [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], [6283,"Studio-Durian", "https://studio-durian.jp/images/ROGO2opa.png"] ]; let favStudioString = ""; if(useScripts.CSSfavs){ 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; }`; favStudios.forEach(function(studio){ if(studio[2] !== ""){ 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.textContent += favStudioString; } if(useScripts.CSScompactBrowse){ moreStyle.textContent += ` .search-page-unscoped.container{ padding-left: 10px; padding-right: 0px; position: relative; } .search-page-unscoped > .results.media{ margin-top: 40px; } .search-page-unscoped:not(.cardView) .description, .studio-page-unscoped:not(.cardView) .description{ display: none; } .search-page-unscoped .preview-section, .search-page-unscoped, .studio-page-unscoped, .results > .studio{ counter-reset: ranking; } .search-page-unscoped:not(.cardView) .character, .search-page-unscoped:not(.cardView) .staff, .studio-page-unscoped:not(.cardView) .character, .studio-page-unscoped:not(.cardView) .staff{ position: relative; } .search-page-unscoped .data::before, .studio-page-unscoped .data::before, .search-page-unscoped .results > .character .cover::before, .search-page-unscoped .results > .staff .cover::before{ left: 2px; opacity: 0.4; font-size: 70%; position: absolute; counter-increment: ranking; content: counter(ranking); } .search-page-unscoped:not(.cardView) .media-card, .studio-page-unscoped:not(.cardView) .media-card{ min-width: 150px!important; grid-template-columns: 150px auto!important; height: 297px!important; width: 150px !important; } .search-page-unscoped:not(.cardView) .cover .overlay, .studio-page-unscoped:not(.cardView) .cover .overlay{ padding-left: 8px!important; padding-right: 8px!important; padding-top: 4px!important; padding-bottom: 14px!important; } .search-page-unscoped:not(.cardView) .grid-wrap > .media-card, .studio-page-unscoped:not(.cardView) .grid-wrap > .media-card{ margin-left: 30px; } .search-page-unscoped:not(.cardView) .media-card .cover, .studio-page-unscoped:not(.cardView) .media-card .cover{ width: 150px; height: 215px; margin-top: 53px; z-index: 100; } .search-page-unscoped:not(.cardView) .data, .studio-page-unscoped:not(.cardView) .data{ margin-left: -150px; } .search-page-unscoped:not(.cardView) .genres, .studio-page-unscoped:not(.cardView) .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:not(.cardView) .list-edit, .studio-page-unscoped:not(.cardView) .list-edit{ z-index: 101; } .search-page-unscoped:not(.cardView) .airing-countdown, .studio-page-unscoped:not(.cardView) .airing-countdown{ padding: 5px!important; } .search-page-unscoped:not(.cardView) .grid-wrap, .studio-page-unscoped:not(.cardView) .grid-wrap{ grid-template-columns: repeat(auto-fill, 150px) !important; } .search-page-unscoped:not(.cardView) .media, .studio-page-unscoped:not(.cardView) .media{ grid-template-columns: repeat(auto-fill, 150px) !important; width:100%; } .search-page-unscoped:not(.cardView) .overlay .studio{ margin-top: 2px!important; margin-bottom: -8px!important; } .search-page-unscoped:not(.cardView) .list-status, .studio-page-unscoped:not(.cardView) .list-status{ width: 20px!important; height: 20px!important; } .search-page-unscoped:not(.cardView) .media-card:nth-child(5){ display: inline-grid!important; } .search-page-unscoped.listView .results.media, .search-page-unscoped.compactListView .results.media, .studio-page-unscoped.listView .container.grid-wrap, .studio-page-unscoped.compactListView .container.grid-wrap{ display: block!important; } .search-page-unscoped.listView .media-card, .studio-page-unscoped.listView .media-card{ margin-bottom: 10px; height: 195px; width: 95%; } .search-page-unscoped.listView .media-card .cover, .studio-page-unscoped.listView .media-card .cover{ height: 165px; width: 115px; } .search-page-unscoped.listView .media-card .cover .overlay, .studio-page-unscoped.listView .media-card .cover .overlay{ position: absolute; top: 0px; left: 115px; z-index: 5; background: none; width: 550px; padding: 10px; color: rgb(var(--color-text)); } .search-page-unscoped.listView .media-card .cover .overlay .studio{ margin-top: 15px; } .search-page-unscoped.listView .media-card .data, .studio-page-unscoped.listView .media-card .data{ margin-left: -70px; height: 195px; } .search-page-unscoped.listView .media-card .data .list-edit, .studio-page-unscoped.listView .media-card .data .list-edit{ display: inline; width: 115px; height: 30px; position: absolute; left: -115px; top: 165px; } .search-page-unscoped.listView .media-card .data .genres, .studio-page-unscoped.listView .media-card .data .genres{ display: inline; } .search-page-unscoped.listView .media-card .data .extra, .studio-page-unscoped.listView .media-card .data .extra{ padding-left: 50%; } .search-page-unscoped.listView .media-card .data .description, .studio-page-unscoped.listView .media-card .data .description{ height: 102px; } .search-page-unscoped.listView .media-card .data .airing-countdown, .search-page-unscoped.compactListView .media-card .data .airing-countdown, .studio-page-unscoped.listView .media-card .data .airing-countdown, .studio-page-unscoped.compactListView .media-card .data .airing-countdown{ text-align: right; } .search-page-unscoped.listView .media-card .data .list-edit .action, .studio-page-unscoped.listView .media-card .data .list-edit .action{ padding: 5px; } .search-page-unscoped.compactListView .media .media-card, .studio-page-unscoped.compactListView .media-card{ margin-bottom: 5px; height: 30px; width: 95%; } .search-page-unscoped.compactListView .media-card .data .description, .studio-page-unscoped.compactListView .media-card .data .description{ display: none; } .search-page-unscoped.compactListView .media-card .cover, .studio-page-unscoped.compactListView .media-card .cover{ background: none!important; height: 30px; } .search-page-unscoped.compactListView .media-card .cover .list-status, .studio-page-unscoped.compactListView .media-card .cover .list-status{ transform: translate(-3px,-3px); z-index: 51; box-shadow: none; } .search-page-unscoped.compactListView .media-card .cover .overlay, .studio-page-unscoped.compactListView .media-card .cover .overlay{ z-index: 49; background: none; position: absolute; top: 0px; left: 20px; padding: 6px; width: 600px; color: rgb(var(--color-text)); } .search-page-unscoped.compactListView .media-card .cover .overlay .studio{ display: none; } .search-page-unscoped.compactListView .media-card .data, .studio-page-unscoped.compactListView .media-card .data{ margin-left: -185px; position: relative; } .search-page-unscoped.compactListView .media-card .data .list-edit, .studio-page-unscoped.compactListView .media-card .data .list-edit{ position: absolute; top: 0px; width: 115px; left: calc(100% - 115px); background: none; } .search-page-unscoped.compactListView .media-card:hover .data .airing-countdown, .studio-page-unscoped.compactListView .media-card:hover .data .airing-countdown{ display: none; } .search-page-unscoped.compactListView .media-card .data .extra, .studio-page-unscoped.compactListView .media-card .data .extra{ position: absolute; left: calc(100% - 550px); top: 0px; background: none; width: 150px; } .search-page-unscoped.compactListView .media-card .data .genres, .studio-page-unscoped.compactListView .media-card .data .genres{ position: absolute; width: 200px; top: 6px; background: none; left: calc(100% - 350px); display: inline; padding: 0px; height: 30px; line-height: 10px; } .search-page-unscoped.compactListView .media-card .data .genres span, .studio-page-unscoped.compactListView .media-card .data .genres span{ vertical-align: middle; } .search-page-unscoped.compactListView .data::before, .studio-page-unscoped.compactListView .data::before{ font-size: 50%; } .search-page-unscoped.listView .data::before, .studio-page-unscoped.listView .data::before{ font-size: 60%; } .search-page-unscoped .hohThemeSwitch{ width: 130px; position: absolute; right: 40px; top: -2px; } .studio-page-unscoped .hohThemeSwitch{ width: 130px; position: absolute; top: 60px; left: 50%; } @media(max-width: 1040px){ .search-page-unscoped{ margin-top: 40px !important; } .search-page-unscoped .hohThemeSwitch{ right: 55px; top: 45px; } .search-page-unscoped .filter-toggle{ padding-top: 10px; margin-top: 2px; margin-left: 0px; } .search-page-unscoped > .results.media{ margin-top: 44px; } } @media(max-width: 850px){ .search-page-unscoped:not(.cardView) .results.media{ display: inline-grid; grid-column-gap: 15px; grid-row-gap: 15px; } } @media(max-width: 760px){ .search-page-unscoped.compactListView .media-card .data .genres{ display: none; } .search-page-unscoped.compactListView .media-card .data .extra{ left: calc(100% - 280px); width: 120px; } .search-page-unscoped.listView .media-card .data{ margin-left: -45px; } } @media(max-width: 550px){ .search-page-unscoped.compactListView .media-card .data .extra{ display: none; } } `; } if(useScripts.CSSsubmissionCounter){ moreStyle.textContent += ` .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.textContent += ` .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.CSSbannerShadow){ moreStyle.textContent += ` .banner .shadow{ display: none; } `; } if(useScripts.CSSgreenManga){ moreStyle.textContent += ` .activity-markdown a[href^="https://anilist.co/manga/"]{ color: rgba(var(--color-green)); } .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; } .media-embed[data-media-type="manga"] .title{ color: rgba(var(--color-green)); } .media-manga .actions .list{ background: rgba(var(--color-green)); } .media-manga .sidebar .review.button{ background: rgba(var(--color-green)); } .media-manga .container .content .nav .link{ color:rgba(var(--color-green)); } `; } if(useScripts.CSSexpandFeedFilters && (!useScripts.mobileFriendly)){ moreStyle.textContent += ` .home .activity-feed-wrap .section-header .el-dropdown-menu, .user .activity-feed-wrap .section-header .el-dropdown-menu{ background: none; position: static; display: inline !important; margin-right: 15px; box-shadow: none !important; } .home .activity-feed-wrap .section-header .el-dropdown-menu__item, .user .activity-feed-wrap .section-header .el-dropdown-menu__item{ font-weight: normal; color: rgb(var(--color-text-lighter)); margin-left: -2px !important; display: inline; font-size: 1.2rem; padding: 4px 15px 5px 15px; border-radius: 3px; transition: .2s; background: none; } .home .activity-feed-wrap .section-header .el-dropdown-menu__item.active, .user .activity-feed-wrap .section-header .el-dropdown-menu__item.active{ background: none!important; color: rgb(var(--color-blue)); } .home .activity-feed-wrap .section-header .el-dropdown-menu__item:hover, .user .activity-feed-wrap .section-header .el-dropdown-menu__item:hover{ background: none!important; color: rgb(var(--color-blue)); } .home .feed-select .feed-filter, .user .section-header > .el-dropdown > .el-dropdown-selfdefine{ display: none; } `; } if(useScripts.CSSverticalNav && (!useScripts.mobileFriendly)){ moreStyle.textContent += ` .media .activity-entry .cover{ display: none; } .media .activity-entry .details{ min-width: 500px; margin-left: 30px; } .media .activity-entry .details > .avatar{ position: absolute; top: 0px; left: 5px; } .media .activity-entry .list{ min-height: 55px !important; } .media .activity-entry .replies .count, .media .activity-entry .replies .count + svg{ color: rgb(var(--color-red)); } #app .tooltip.animate-position{ transition: opacity .26s ease-in-out,transform 0s ease-in-out; } .studio .hohThemeSwitch{ top: 30px; } .stats-wrap .stat-cards{ grid-gap: 20px; grid-template-columns: repeat(auto-fill, 300px); } .stats-wrap .stat-cards.has-images{ grid-gap: 20px; grid-template-columns: repeat(auto-fill, 600px); } .stats-wrap .stat-cards .stat-card{ box-shadow: none; padding: 10px; padding-bottom: 0px; } .stats-wrap .stat-cards .stat-card > .title{ font-size: 2rem; } .stats-wrap .stat-cards .stat-card.has-image > .wrap > .image{ margin-top: -45px; height: 100px; width: 70px; } .stats-wrap .highlight .value{ font-size: 2rem; } .stats-wrap .highlight .circle{ box-shadow: none; height: 35px; width: 35px; } .stats-wrap .highlights{ grid-gap: 30px 0px; margin-left: 1%; width: 98%; margin-top: 0px; grid-template-columns: repeat(6,1fr); margin-bottom: 20px; } .stats-wrap .stat-cards .stat-card.has-image > .title{ margin-left: 75px; } .stats-wrap .stat-cards .stat-card .inner-wrap .relations-wrap{ padding: 5px 15px; } .stats-wrap .stat-cards .stat-card .inner-wrap .relations-wrap .relations{ transition: transform .1s ease-in-out; } .stats-wrap .stat-cards .stat-card .inner-wrap .relations-wrap .relation-card{ margin-right: 5px; } .stats-wrap .stat-cards .stat-card .inner-wrap .relations-wrap .relation-card .image{ width: 70px; height: 100px; } .stats-wrap .stat-cards .stat-card .count.circle{ top: 12px; right: 12px; height: 20px; width: 20px; } .stats-wrap .stat-cards .stat-card .inner-wrap .detail .value{ font-size: 1.4rem; font-weight: 700; color: rgb(var(--color-blue)); } .stats-wrap .stat-cards .stat-card .inner-wrap .detail .label{ font-size: 1.1rem; } .stats-wrap .stat-cards .stat-card .inner-wrap .relations-wrap .button{ box-shadow: none; top: 40px; } .stats-wrap .stat-cards .stat-card .inner-wrap .relations-wrap .button.previous{ left: 18px; } .stats-wrap .stat-cards .stat-card .inner-wrap .relations-wrap .button.next{ right: 18px; } .user .desktop .genre-overview.content-wrap{ font-size: 1.3rem; } .forum-thread .comment-wrap{ border-left: solid!important; margin-bottom: 10px!important; } .forum-thread .comment-wrap.odd{ border-left-style: double!important; } .forum-thread .comment-wrap.hohCommentSelected{ border-left-color: rgb(var(--color-blue))!important; } .forum-thread .comment-wrap.hohCommentHidden{ border-left-style: dotted!important; } .forum-feed .overview-header{ color: rgba(var(--color-blue))!important; font-size: 2rem!important; } .forum-feed .thread-card{ margin-bottom: 10px!important; } .forum-feed .filter-group > a{ margin-bottom: 2px!important; } .activity-entry > .wrap > .actions{ bottom: 0px!important; } .page-content > .container, .notifications-feed, .page-content > .studio{ margin-top: 25px !important; } .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*/ } .hohUserRow td, .hohUserRow th{ top: 44px; } .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; } .media-embed + br{ display: none; } /*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)); } .wrap .link.router-link-exact-active.router-link-active, .nav .link.router-link-exact-active.router-link-active{ background: rgba(var(--color-foreground-grey)); color: rgba(var(--color-blue)); } /*--------------VERTICAL-NAV----------------*/ /*modified code from Kuwabara: https://userstyles.org/styles/161017/my-little-anilist-theme-can-not-be-this-cute*/ .hohDismiss{ transform: translate(17.5px,-40px); margin-left: 0px!important; } #app > .nav { border-top: none !important; } #app div#nav.nav{ width: 65px; height: 100%!important; 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!important; margin-left: 0px; padding-left: 0px; width: 65px; min-width: 65px !important; flex-direction: column; } #app #nav.nav .wrap .links a.link{ width: 65px; padding: 5px 0px; margin-bottom: 10px; text-align: center; height: unset!important; transition: 0.3s; padding-left: 0px!important; } div#nav.nav .link.router-link-exact-active.router-link-active, #nav > div > div.links > a:hover{ border-bottom-width: 0px!important; } .nav .wrap .links .link:hover{ background: rgba(var(--color-blue),0.1); } .nav .wrap .links .link::before{ display: block; content: ""; height: 24px!important; width: 65px!important; background-size: 24px; margin-left: 0!important; margin-bottom: 3px!important; background-repeat: no-repeat; background-position: center; filter: grayscale(100%) brightness(1.4); } .nav .link[href*="/user/"]:hover::before, .nav .link[href^="/forum/"]:hover::before, .nav .link[href="/login"]::before, .nav .link[href="/social"]::before, .nav .link[href^="/search/"]:hover::before, .nav .link[href^="/home"]:hover::before, .site-theme-contrast .nav .link.router-link-active::before{ filter: grayscale(0%); } .logo-full{ display: none; } .nav .link[href="/home"]::before, .nav .link[href="/login"]::before{ background: url('data:image/svg+xml;utf8,'); } .nav .link[href^="/user/"]::before, .nav .link[href="/social"]::before{ background: url('data:image/svg+xml;utf8,'); } .nav .link[href*="/animelist"]::before, .nav .link[href*="/mangalist"]::before{ background: url('data:image/svg+xml;utf8,'); } .nav .link[href^="/search/"]::before{ background: url('data:image/svg+xml;utf8,'); } .nav .link[href*="/forum"]::before{ background: url('data:image/svg+xml;utf8,'); } .nav .link[href="/signup"]::before{ background: url('data:image/svg+xml;utf8,+'); } .landing .link{ margin-left: unset!important; } #nav > div.wrap.guest > div.links a.link.login, #nav > div.wrap.guest > div.links a.link.signup{ padding: 5px 0px!important; } div#nav.transparent{ background: #1f2631!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/oho/"]::after{ content: "summerbois"; 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; } .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 > svg: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, .activity-entry .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; } .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; } .home .media-preview-card:nth-child(5n+3) .content{ border-radius: 3px 0 0 3px; left: auto !important; right: 100%; text-align: right; } .home .media-preview-card:nth-child(5n+3) .content .info{ right: 12px; } .link:hover .hohSubMenu{ color: rgb(var(--color-text-bright)); } .hohSubMenu{ position: absolute; left: 64px; top: 0px; display: none; background: #1f2631; } .hohSubMenuLink{ display: block; margin-left: 3px; padding: 4px; font-size: 130%; text-align: left; color: rgb(var(--color-text-bright)); } @media(max-width: 1540px){ .container{ max-width: 1200px; } } `; } if(useScripts.CSSdecimalPoint){ moreStyle.textContent += ` .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.CSSdarkDropdown){ moreStyle.textContent += ` .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; } `; } if(useScripts.CSSsmileyScore){ moreStyle.textContent += ` .fa-frown{ color: red; } .fa-smile{ color: green; } `; } if(useScripts.limitProgress8){ moreStyle.textContent += ` .home:not(.full-width) .media-preview-card:nth-child(n+9){ display:none!important; } `; } else if(useScripts.limitProgress10){ moreStyle.textContent += ` .home:not(.full-width) .media-preview-card:nth-child(n+11){ display:none!important; } `; } if(useScripts.CSSmobileTags){ moreStyle.textContent += ` @media(max-width: 760px){ .media .sidebar .tags{ display: inline; } .media .sidebar .tags .tag{ display: inline-block; margin-right: 2px; } .media .sidebar .tags .tag .rank{ display: inline; } .media .sidebar .tags .tag .vote-dropdown .el-dropdown-link{ display: inline; } .media .sidebar .tags .add-icon{ opacity: 1; } } `; } };initCSS(); documentHead.appendChild(moreStyle); let customStyle = create("style"); let currentUserCSS = ""; customStyle.id = "customCSS-aniscripts-styles"; customStyle.type = "text/css"; documentHead.appendChild(customStyle); let aliases = new Map(); ( JSON.parse( localStorage.getItem("titleAliases") ) || [] ).concat( shortRomaji ).forEach(function(alias){ let matches = alias[0].match(/^\/(anime|manga)\/(\d+)\/$/); if(matches){ aliases.set(parseInt(matches[2]),alias[1]); }; }); const queryMediaListManga = ` 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{ chapters volumes format title{romaji native english} tags{name} genres meanScore } scoreRaw: score(format: POINT_100) } `; const queryMediaListAnime = ` query($name: String!, $listType: MediaType){ MediaListCollection(userName: $name, type: $listType){ lists{ name isCustomList entries{ ... mediaListEntry } } } } fragment mediaListEntry on MediaList{ mediaId status progress repeat notes startedAt{ year month day } media{ episodes duration nextAiringEpisode{episode} format title{romaji native english} tags{name} genres meanScore studios{nodes{isAnimationStudio id name}} } scoreRaw: score(format: POINT_100) } `; const queryMediaListStaff = ` query($name: String!, $listType: MediaType){ MediaListCollection(userName: $name, type: $listType){ lists{ entries{ ... mediaListEntry } } } } fragment mediaListEntry on MediaList{ mediaId media{ a:staff(sort:ID,page:1){nodes{id name{first last}}} b:staff(sort:ID,page:2){nodes{id name{first last}}} } } `; const queryMediaListCompat = ` 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 native english} } scoreRaw: score(format: POINT_100) } `; const queryMediaListNotes = ` query($name: String!, $listType: MediaType){ MediaListCollection(userName: $name, type: $listType){ lists{ entries{ mediaId notes } } } }`; 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} id } } ... on ListActivity { id userId type status progress user{ id name avatar{large} } media{ coverImage{large} title{romaji native english} } likes{id} replies{ text(asHtml: true) user{name} likes{name} id } } ... on MessageActivity{ id type likes{id} replies{ text(asHtml: true) user{name} likes{name} id } } } } `; const queryAuthNotifications = ` query($page: Int,$name: String){ User(name: $name){unreadNotificationCount} Page(page: $page){ notifications{ ... on AiringNotification{type} ... on FollowingNotification{type} ... on ActivityMessageNotification{type} ... on ActivityMentionNotification{type} ... on ActivityReplyNotification{type} ... on ActivityLikeNotification{type} ... on ActivityReplyLikeNotification{type} ... on ThreadCommentMentionNotification{type} ... on ThreadCommentReplyNotification{type} ... on ThreadCommentSubscribedNotification{type} ... on ThreadCommentLikeNotification{type} ... on ThreadLikeNotification{type} } } } `; const ANILIST_WEIGHT = 41;//weighting center for the weighted score formula let APIlimit = 90; let 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 let pending = {}; let APIcounter = setTimeout(function(){ APIcallsUsed = 0; },60*1000);//reset counter every minute, as our quota grows back let handleResponse = function(response){ APIlimit = response.headers.get("x-ratelimit-limit"); APIcallsUsed = APIlimit - response.headers.get("x-ratelimit-remaining"); return response.json().then(function(json){ return (response.ok ? json : Promise.reject(json)); }); }; const url = "https://graphql.anilist.co";//Current Anilist API location const authUrl = "https://anilist.co/api/v2/oauth/authorize?client_id=1933&response_type=token";//1933 = aniscripts let aniCast = {postMessage: function(){}};//dummy object if(window.BroadcastChannel){ aniCast = new BroadcastChannel("aniscripts"); aniCast.onmessage = function(message){ if(message.data.type && message.data.type === "cache"){ sessionStorage.setItem(message.data.key,message.data.value); } } } else{ /* Safari is the most common case where BroadcastChannel is not available. * It *should* be available in most other browsers, so if it isn't here's a message to those where it fails * Safari users can't really do anything about it, so there's no need to nag them with it, hence the window.safari test * If Apple implements it in the future, the code should be updated, but the code doesn't do anything *wrong* then either * it will just not print the warning when BroadcastChannel isn't available */ if(!window.safari){ console.warn("BroadcastChannel not available. Aniscripts will not be able to share cached data between tabs"); } } //mandatory: query,variables,callback //optional: cacheKey, and optionally even then, how long the item is fresh in the cache function generalAPIcall(query,variables,callback,cacheKey,timeFresh,useLocalStorage,overWrite){ if(cacheKey && ((useLocalStorage && window.localStorage) || (!useLocalStorage && window.sessionStorage))){ let cacheItem = JSON.parse( (useLocalStorage ? localStorage.getItem(cacheKey) : sessionStorage.getItem(cacheKey)) ); if(cacheItem){ if( ( !cacheItem.duration || ((new Date()).valueOf() < cacheItem.time + cacheItem.duration) ) && !overWrite ){ callback(cacheItem.data,variables); return; } else{ (useLocalStorage ? localStorage.removeItem(cacheKey) : sessionStorage.removeItem(cacheKey)) } } } let handleData = function(data){ callback(data,variables); if(cacheKey && ((useLocalStorage && window.localStorage) || (!useLocalStorage && window.sessionStorage))){ let saltedHam = JSON.stringify({ data: data, time: (new Date()).valueOf(), duration: timeFresh }); if(useLocalStorage){ localStorage.setItem(cacheKey,saltedHam); } else{ try{ sessionStorage.setItem(cacheKey,saltedHam); } catch{ console.error("Aniscripts cache is full. Searching for expired items..."); let purgeCounter = 0; Object.keys(sessionStorage).forEach(function(key){ try{ let item = JSON.parse(sessionStorage.getItem(key)); if(item.time && ((new Date()).valueOf() - item.time > item.duration)){ sessionStorage.removeItem(key); purgeCounter++; } } catch{ /*there may be non-JSON objects in session storage. the best way to check for JSON-ness is the JSON parser, so this needs a try wrapper */ } }); if(purgeCounter){ console.log("Purged " + purgeCounter + " expired items"); } else{ Object.keys(sessionStorage).slice(0,10).forEach(function(key){ sessionStorage.removeItem(key); }); console.log("Found no expired items. Deleted some at random to free up space."); } try{ sessionStorage.setItem(cacheKey,saltedHam); } catch{ console.error("The Aniscripts cache failed for the key '" + cacheKey + "'. "); if(saltedHam.length > 50000){ console.warn("The cache item is possibly too large (approx. " + saltedHam.length + " bytes)"); } else{ console.warn("Setting cache item failed. Please report or check your localStorage settings."); } } }; aniCast.postMessage({type:"cache",key:cacheKey,value:saltedHam}); } } }; let options = { method: "POST", headers: { "Content-Type": "application/json", "Accept": "application/json" }, body: JSON.stringify({ "query": query, "variables": variables }) }; let handleError = function(error){ if(error.errors && error.errors.some(err => err.status === 404)){//not really an error handleData(null); return; }; console.error(error,variables); handleData(null); }; fetch(url,options).then(handleResponse).then(handleData).catch(handleError); APIcallsUsed++; } /* rawQueries = [ { query: a graphql query variables: variables like a normal API call callback: like in a normal API call cacheKey: [optional] duration: [optional] } ... ] */ function queryPacker(rawQueries,possibleCallback){//get a list of query calls, and pack them into one query. The result is then split up again and sent back to each call. let queries = rawQueries.filter(function(query){//filter out those that have data in our local cache if(query.cacheKey){ let cacheItem = JSON.parse(sessionStorage.getItem(query.cacheKey)); if(cacheItem){ if( !cacheItem.duration || ((new Date()).valueOf() < cacheItem.time + cacheItem.duration) ){ query.callback(cacheItem.data); return false; } else{ sessionStorage.removeItem(query.cacheKey);//expired data } } } return true; }); queries.forEach(function(query){//inline all variables query.query = query.query.trim().replace(/^query.*?{/,"").slice(0,-1).trim(); const enums = ["type"]; Object.keys(query.variables).forEach(function(variable){ let replacement = query.variables[variable]; if(!enums.includes(variable) && typeof query.variables[variable] === "string"){ replacement = "\"" + replacement + "\"" } query.query = query.query.split("$" + variable).join(replacement); }) }); let enumeratedQueries = queries.map(function(query,index){ query.getFields = []; let internalList = []; let partial = ""; let getField = ""; let collectGetField = true; let left = 0; Array.from(query.query).forEach(function(letter){ partial += letter; if(letter === "{"){ left++; collectGetField = false; } else if(letter === "("){ collectGetField = false; } else if(letter === "}"){ left--; if(left === 0){ internalList.push("a" + index + "a" + internalList.length + ":" + partial.trim()); query.getFields.push(getField.trim()); partial = ""; getField = ""; collectGetField = true; }; } else if(collectGetField){ getField += letter; }; }); return internalList.join(); }); let mainQuery = ` query{ ${enumeratedQueries.join("\n")} } `; let queryUnpacker = function(data){ if(!data){ queries.forEach(function(query,index){ query.callback(null); }) } else{ queries.forEach(function(query,index){ let returnStructure = {data:{}}; query.getFields.forEach(function(field,fieldIndex){ returnStructure.data[field] = data.data["a" + index + "a" + fieldIndex]; }); query.callback(returnStructure); if(query.cacheKey){ let cacheStrucuture = { data: returnStructure } if(query.duration){ cacheStrucuture.time = (new Date()).valueOf(); cacheStrucuture.duration = query.duration; } sessionStorage.setItem(query.cacheKey,JSON.stringify(cacheStrucuture)); } }); if(possibleCallback){ possibleCallback(); } } } if(queries.length){//hey, they might all have been in cache generalAPIcall(mainQuery,{},queryUnpacker);//send our "superquery" to the regular API handler } } function authAPIcall(query,variables,callback,cacheKey,timeFresh,useLocalStorage){//only use this for queries explicitely requiring auth permissions if(cacheKey){ let cacheItem = JSON.parse( (useLocalStorage ? localStorage.getItem(cacheKey) : sessionStorage.getItem(cacheKey)) ); if(cacheItem){ if( !cacheItem.duration || ((new Date()).valueOf() < cacheItem.time + cacheItem.duration) ){ callback(cacheItem.data,variables); return; } else{ (useLocalStorage ? localStorage.removeItem(cacheKey) : sessionStorage.removeItem(cacheKey)) } } } let handleData = function(data){ callback(data,variables); if(cacheKey){ let saltedHam = JSON.stringify({ data: data, time: (new Date()).valueOf(), duration: timeFresh }); if(useLocalStorage){ localStorage.setItem(cacheKey,saltedHam); } else{ sessionStorage.setItem(cacheKey,saltedHam); aniCast.postMessage({type:"cache",key:cacheKey,value:saltedHam}); } } }; let options = { method: "POST", headers: { "Authorization": "Bearer " + useScripts.accessToken, "Content-Type": "application/json", "Accept": "application/json" }, body: JSON.stringify({ "query": query, "variables": variables }) }; let handleError = function(error){ console.error(error); if(error.errors){ error.errors.forEach(function(thing){ if(thing.message === "Invalid token"){ useScripts.accessToken = ""; useScripts.save(); console.log("access token retracted"); }; }); }; }; fetch(url,options).then(handleResponse).then(handleData).catch(handleError); APIcallsUsed++; } function scoreFormatter(score,format,name){ if(name === "shuurei"){ const shuureiSystem = ["",">:(","Ew","Ugh","Hm","Ok","Nice","Ooh","Wow","Fave",":D"]; return `${shuureiSystem[score]}`; } else if(format === "POINT_100"){ return score + "/100"; } else if( format === "POINT_10_DECIMAL" || format === "POINT_10" ){ return score + "/10"; } else if(format === "POINT_3"){ if(score === 3){ return svgAssets.smile; } else if(score === 2){ return svgAssets.meh; } else if(score === 1){ return svgAssets.frown; }; } else if(format === "POINT_5"){ return score + svgAssets.star; } } function convertScore(score,format){ if(format === "POINT_100"){ return score; } else if( format === "POINT_10_DECIMAL" || format === "POINT_10" ){ return score*10; } else if(format === "POINT_3"){ if(score === 3){ return 85; } else if(score === 2){ return 60; } else if(score === 1){ return 45; } return 0; } else if(format === "POINT_5"){ if(score === 0){ return 0; }; return score*20 - 10; } } function saveAs(uri,filename){ let link = create("a"); if(typeof link.download === "string"){ document.body.appendChild(link); link.download = filename; link.href = uri; link.click(); document.body.removeChild(link); } else{ location.replace(uri); } } function saveAsBlob(data,fileName){ let link = create("a"); document.body.appendChild(link); let json = JSON.stringify(data); let blob = new Blob([json],{type: "octet/stream"}); let url = window.URL.createObjectURL(blob); link.href = url; link.download = fileName; link.click(); window.URL.revokeObjectURL(url); document.body.removeChild(link); } function levDist(s,t){//https://stackoverflow.com/a/11958496/5697837 // Step 1 let n = s.length; let m = t.length; if(!n){ return m } if(!m){ return n } let d = []; //2d matrix for(var i = n; i >= 0; i--) d[i] = []; // Step 2 for(var i = n; i >= 0; i--) d[i][0] = i; for(var j = m; j >= 0; j--) d[0][j] = j; // Step 3 for(var i = 1; i <= n; i++){ let s_i = s.charAt(i - 1); // Step 4 for(var j = 1; j <= m; j++){ //Check the jagged ld total so far if(i === j && d[i][j] > 4){ return n } let t_j = t.charAt(j - 1); let cost = (s_i === t_j) ? 0 : 1; // Step 5 //Calculate the minimum let mi = d[i - 1][j] + 1; let b = d[i][j - 1] + 1; let c = d[i - 1][j - 1] + cost; if(b < mi){ mi = b } if(c < mi){ mi = c; } d[i][j] = mi; // Step 6 //Damerau transposition /*if (i > 1 && j > 1 && s_i === t.charAt(j - 2) && s.charAt(i - 2) === t_j) { d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost); }*/ } } return d[n][m]; } //Morimasa code https://greasyfork.org/en/scripts/375622-betterfollowinglist const stats = { element: null, count: 0, scoreSum: 0, scoreCount: 0 } const scoreColors = e => { let el = e.querySelector("span") || e.querySelector("svg"); let light = document.body.classList.contains("site-theme-dark") ? 45 : 38; if(!el){ return; } else if(el.nodeName === "svg"){ // smiley if(el.dataset.icon === "meh"){ el.childNodes[0].setAttribute("fill",`hsl(60, 100%, ${light}%)`) } stats.scoreCount += 0.5;//weight those scores lower because of the precission stats.scoreSum += ({"smile": 85,"meh": 60,"frown": 35}[el.dataset.icon])*0.5; } else if(el.nodeName === "SPAN"){ let score = el.innerText.split("/").map(num => parseInt(num)); if(score.length === 1){// convert stars, 10 point and 10 point decimal to 100 point score = score[0]*20-10 } else{ if(score[1] === 10){ score = score[0]*10 } else{ score = score[0] } } el.style.color = `hsl(${score*1.2}, 100%, ${light}%)`; stats.scoreCount++; stats.scoreSum += score; } } const handler = (data,target,idMap) => { if(!target){ return; } data.forEach(e => { target[idMap[e.user.id]].style.gridTemplateColumns = "30px 1.3fr .7fr .6fr .2fr .2fr .5fr"; //css is my passion const progress = create("div","progress",e.progress); if(e.media.chapters || e.media.episodes){ progress.innerText = `${e.progress}/${e.media.chapters || e.media.episodes}`; } target[idMap[e.user.id]].insertBefore(progress,target[idMap[e.user.id]].children[2]) let notesEL = create("span") // notes const createIcon = function(cssClass,text,d){ let el = create("span",cssClass); el.title = text; el.innerHTML = ``; return el; } if(e.notes){ notesEL = createIcon("notes",e.notes,"M256 32C114.6 32 0 125.1 0 240c0 49.6 21.4 95 57 130.7C44.5 421.1 2.7 466 2.2 466.5c-2.2 2.3-2.8 5.7-1.5 8.7S4.8 480 8 480c66.3 0 116-31.8 140.6-51.4 32.7 12.3 69 19.4 107.4 19.4 141.4 0 256-93.1 256-208S397.4 32 256 32z"); } let dateString = [ e.startedAt.year, e.startedAt.month, e.startedAt.day ].filter(TRUTHY).map(a => ((a + "").length === 1 ? "0" + a : "" + a)).join("-") + " - " + [ e.completedAt.year, e.completedAt.month, e.completedAt.day ].filter(TRUTHY).map(a => ((a + "").length === 1 ? "0" + a : "" + a)).join("-"); if(dateString !== " - "){ target[idMap[e.user.id]].children[3].title = dateString; } target[idMap[e.user.id]].insertBefore( notesEL,target[idMap[e.user.id]].children[4] ) let rewatchEL = create("span"); if(e.repeat){ rewatchEL = createIcon("repeat",e.repeat,"M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z"); } target[idMap[e.user.id]].insertBefore( rewatchEL,target[idMap[e.user.id]].children[4] ); }) } const MakeStats = () => { if(stats.element){ stats.element.remove(); } let main = create("h2"); const createStat = (text, number) => { let el = create("span",false,text); create("span",false,number,el); return el } let count = createStat("Users: ",stats.count); main.append(count); let avg = createStat("Avg: ",0); avg.style.float = "right"; main.append(avg); const parent = document.querySelector(".following"); parent.prepend(main); stats.element = main; } function enhanceSocialTab(){ if(!location.pathname.match(/^\/(anime|manga)\/\d*\/[\w\-]*\/social/)){ return; } let listOfFollowers = Array.from(document.getElementsByClassName("follow")); if(!listOfFollowers.length){ setTimeout(enhanceSocialTab,100); return; }; MakeStats(); let idmap = {}; listOfFollowers.forEach(function(e,i){ if(!e.dataset.changed){ const avatarURL = e.querySelector(".avatar").dataset.src; if(!avatarURL || avatarURL === "https://s4.anilist.co/file/anilistcdn/user/avatar/large/default.png"){ return; } const id = avatarURL.split("/").pop().match(/\d+/g)[0]; idmap[id] = i; scoreColors(e); ++stats.count; e.dataset.changed = true; } }) if(Object.keys(idmap).length){ const mediaID = window.location.pathname.split("/")[2]; generalAPIcall( `query($users:[Int],$media:Int){ Page{ mediaList(userId_in: $users,mediaId: $media){ progress notes repeat user{id} startedAt{year month day} completedAt{year month day} media{chapters episodes} } } }`, {users: Object.keys(idmap), media: mediaID}, function(res){ handler(res.data.Page.mediaList,listOfFollowers,idmap) } ) let statsElements = stats.element.querySelectorAll("span > span"); statsElements[0].innerText = stats.count; const avgScore = parseInt(stats.scoreSum/stats.scoreCount) || 0; if(avgScore){ statsElements[1].style.color = `hsl(${avgScore*1.2}, 100%, 40%)` statsElements[1].innerText = `${avgScore}%`; } else{ statsElements[1].parentNode.remove(); // no need if no scores } } /*add average score to social tab*/ let root = listOfFollowers[0].parentNode; let distribution = {}; Object.keys(distributionColours).forEach(function(status){ distribution[status] = 0; }); listOfFollowers.forEach(function(follower){ distribution[follower.querySelector(".status").innerText.toUpperCase()]++; }); if( Object.keys(distributionColours).some(status => distribution[status] > 0) ){ let locationForIt = document.getElementById("averageScore"); let dataList = document.getElementById("socialUsers"); let statusList = document.getElementById("statusList"); if(!locationForIt){ let insertLocation = document.querySelector(".following"); insertLocation.parentNode.style.marginTop = "5px"; insertLocation.parentNode.style.position = "relative"; locationForIt = create("span","#averageScore"); insertLocation.insertBefore( locationForIt, insertLocation.children[0] ); statusList = create("span","#statusList",false,false,"position:absolute;right:0px;top:5px;"); insertLocation.insertBefore( statusList, insertLocation.children[0] ); dataList = create("datalist","#socialUsers"); insertLocation.insertBefore( dataList, insertLocation.children[0] ); } locationForIt.nextSibling.style.marginTop = "5px"; if(dataList.childElementCount < listOfFollowers.length){ listOfFollowers.slice(dataList.childElementCount).forEach(function(follower){ let option = create("option",false,false,dataList); option.value = follower.children[1].innerText; }); } while(statusList.childElementCount){ statusList.lastChild.remove(); } Object.keys(distributionColours).sort().forEach(function(status){ if(distribution[status]){ let statusSumDot = create("div","hohSumableStatus",distribution[status],statusList,"cursor:pointer;"); statusSumDot.style.background = distributionColours[status]; statusSumDot.title = distribution[status] + " " + status.toLowerCase().capitalize(); if(distribution[status] > 99){ statusSumDot.style.fontSize = "8px"; } if(distribution[status] > 999){ statusSumDot.style.fontSize = "6px"; }; statusSumDot.onclick = function(){ Array.from(root.querySelectorAll(".follow .status")).forEach(function(item){ if(item.innerText.toUpperCase() === status){ item.parentNode.style.display = "grid"; } else{ item.parentNode.style.display = "none"; }; }); }; } }); }; let waiter = function(){ setTimeout(function(){ if(root.childElementCount !== listOfFollowers.length){ enhanceSocialTab(); } else{ waiter(); }; },100); };waiter(); } function enhanceSocialTabFeed(){ let URLstuff = location.pathname.match(/^\/(anime|manga)\/(\d+)\/[\w\-]*\/social/); if(!URLstuff){ return; } let feedLocation = document.querySelector(".activity-feed"); if(!feedLocation){ setTimeout(enhanceSocialTabFeed,100); return; }; let hohFeed = create("div","hohSocialFeed"); feedLocation.insertBefore(hohFeed,feedLocation.children[0]); let optionsContainer = create("div",false,false,hohFeed,"position:absolute;top:0px;right:0px;"); let hasReplies = createCheckbox(optionsContainer); create("span",false,"Has Replies",optionsContainer,"margin-right:7px;"); let isFollowing = createCheckbox(optionsContainer); create("span",false,"Following",optionsContainer); let feedHeader = create("h2",false,"Recent Activity",hohFeed,"display:none;"); let feedContent = create("div",false,false,hohFeed,"display:none;"); let query = ""; let buildFeed = function(page){ authAPIcall( query, { page: page, mediaId: parseInt(URLstuff[2]) }, function(data){ const randomData = "data-v-5e47e186"; data.data.Page.activities.forEach(act => { let activityEntry = create("div",["activity-entry","activity-" + URLstuff[1] + "_list"],false,feedContent);activityEntry.setAttribute(randomData,""); let wrap = create("div","wrap",false,activityEntry);wrap.setAttribute(randomData,""); let list = create("div","list",false,wrap);list.setAttribute(randomData,""); let cover = create("a",["cover","router-link-active"],false,list);cover.setAttribute(randomData,""); cover.href = "/" + URLstuff[1] + "/" + URLstuff[2] + "/" + safeURL(act.media.title.userPreferred); cover.style.backgroundImage = `url("${act.media.coverImage.medium}")`; let details = create("div","details",false,list);details.setAttribute(randomData,""); let name = create("a","name",act.user.name,details);name.setAttribute(randomData,""); name.href = "/user/" + act.user.name; details.appendChild(document.createTextNode(" ")); let status = create("div","status",act.status + (act.progress ? " " + act.progress + " of" : ""),details);status.setAttribute(randomData,""); let link = create("a",["title","router-link-active"]," " + act.media.title.userPreferred,status);link.setAttribute(randomData,""); link.href = "/" + URLstuff[1] + "/" + URLstuff[2] + "/" + safeURL(act.media.title.userPreferred); let avatar = create("a","avatar",false,details);avatar.setAttribute(randomData,""); avatar.href = "/user/" + act.user.name; avatar.style.backgroundImage = `url("${act.user.avatar.medium}")`; let timeWrapper = create("div","time",false,wrap);timeWrapper.setAttribute(randomData,""); let action = create("a","action",false,timeWrapper);action.setAttribute(randomData,""); action.innerHTML = svgAssets.link; action.href = "/activity/" + act.id; let time = nativeTimeElement(act.createdAt);timeWrapper.appendChild(time);time.setAttribute(randomData,""); let actions = create("div","actions",false,wrap);actions.setAttribute(randomData,""); let actionReplies = create("div",["action","replies"],false,actions);actionReplies.setAttribute(randomData,""); if(act.replies.length){ let replyCount = create("span","count",act.replies.length,actionReplies);replyCount.setAttribute(randomData,""); actionReplies.appendChild(document.createTextNode(" ")); }; actionReplies.innerHTML += svgAssets.reply; actions.appendChild(document.createTextNode(" ")); let actionLikes = create("div",["action","likes"],false,actions);actionLikes.setAttribute(randomData,""); const randomData2 = "data-v-48a11675"; let likeWrap = create("div","like-wrap",false,actionLikes);likeWrap.setAttribute(randomData,"");likeWrap.setAttribute(randomData2,""); let likeButton = create("div","button",false,actionLikes);likeButton.setAttribute(randomData2,""); let likeCount = create("span","count",act.likes.length || "",likeButton);likeCount.setAttribute(randomData2,""); likeButton.appendChild(document.createTextNode(" ")); likeButton.innerHTML += svgAssets.likeNative; likeButton.title = act.likes.map(a => a.name).join("\n"); if(act.likes.some(like => like.name === whoAmI)){ likeButton.classList.add("liked"); }; likeButton.onclick = function(){ authAPIcall( "mutation($id:Int){ToggleLike(id:$id,type:ACTIVITY){id}}", {id: act.id}, function(data2){ if(!data2){ authAPIcall(//try again once if it fails "mutation($id:Int){ToggleLike(id:$id,type:ACTIVITY){id}}", {id: act.id}, function(data3){} ) } } ); if(act.likes.some(like => like.name === whoAmI)){ act.likes.splice(act.likes.findIndex(user => user.name === whoAmI),1); likeButton.classList.remove("liked"); if(act.likes.length > 0){ likeButton.querySelector(".count").innerText = act.likes.length; } else{ likeButton.querySelector(".count").innerText = ""; }; } else{ act.likes.push({name: whoAmI}); likeButton.classList.add("liked"); likeButton.querySelector(".count").innerText = act.likes.length; }; likeButton.title = act.likes.map(a => a.name).join("\n"); }; let replyWrap = create("div","reply-wrap",false,activityEntry,"display:none;");replyWrap.setAttribute(randomData,""); let repliesOpen = false; actionReplies.onclick = function(){ if(repliesOpen){ replyWrap.style.display = "none"; repliesOpen = false; } else{ replyWrap.style.display = "block"; repliesOpen = true; } }; const randomDataReplies = "data-v-4798f76b"; let activityReplies = create("div","activity-replies",false,replyWrap);activityReplies.setAttribute(randomData,"");activityReplies.setAttribute(randomDataReplies,""); const rnd = "data-v-a94f982a"; act.replies.forEach(rep => { let reply = create("div","reply",false,activityReplies);reply.setAttribute(randomDataReplies,"");reply.setAttribute(rnd,""); let header = create("div","header",false,reply);header.setAttribute(rnd,""); let repAvatar = create("a","avatar",false,header);repAvatar.setAttribute(rnd,""); repAvatar.href = "/user/" + rep.user.name; repAvatar.style.backgroundImage = `url("${rep.user.avatar.medium}")`; header.appendChild(document.createTextNode(" ")); let repName = create("a","name",rep.user.name,header);repName.setAttribute(rnd,""); repName.href = "/user/" + rep.user.name; let cornerWrapper = create("div","actions",false,header);cornerWrapper.setAttribute(rnd,""); let repActionLikes = create("div",["action","likes"],false,cornerWrapper);repActionLikes.setAttribute(rnd,""); const randomDataHate = "data-v-56156952"; let repLikeWrap = create("div","like-wrap",false,repActionLikes);repLikeWrap.setAttribute(rnd,"");likeWrap.setAttribute(randomDataHate,""); let repLikeButton = create("div","button",false,repActionLikes);likeButton.setAttribute(randomDataHate,""); let repLikeCount = create("span","count",rep.likes.length || "",repLikeButton);repLikeCount.setAttribute(randomDataHate,""); repLikeButton.appendChild(document.createTextNode(" ")); repLikeButton.innerHTML += svgAssets.likeNative; repLikeButton.title = rep.likes.map(a => a.name).join("\n"); if(rep.likes.some(like => like.name === whoAmI)){ repLikeButton.classList.add("liked"); }; repLikeButton.onclick = function(){ authAPIcall( "mutation($id:Int){ToggleLike(id:$id,type:ACTIVITY_REPLY){id}}", {id: rep.id}, function(data2){ if(!data2){ authAPIcall(//try again once if it fails "mutation($id:Int){ToggleLike(id:$id,type:ACTIVITY_REPLY){id}}", {id: rep.id}, function(data3){} ) } } ); if(rep.likes.some(like => like.name === whoAmI)){ rep.likes.splice(rep.likes.findIndex(user => user.name === whoAmI),1); repLikeButton.classList.remove("liked"); repLikeButton.classList.remove("hohILikeThis"); if(rep.likes.length > 0){ repLikeButton.querySelector(".count").innerText = rep.likes.length; } else{ repLikeButton.querySelector(".count").innerText = ""; }; } else{ rep.likes.push({name: whoAmI}); repLikeButton.classList.add("liked"); repLikeButton.classList.add("hohILikeThis"); repLikeButton.querySelector(".count").innerText = rep.likes.length; }; repLikeButton.title = rep.likes.map(a => a.name).join("\n"); }; let repActionTime = create("div",["action","time"],false,cornerWrapper);repActionTime.setAttribute(rnd,""); let repTime = nativeTimeElement(rep.createdAt);repActionTime.appendChild(repTime);repTime.setAttribute(randomData,""); let replyMarkdown = create("div","reply-markdown",false,reply);replyMarkdown.setAttribute(rnd,""); let markdown = create("div","markdown",false,replyMarkdown);markdown.setAttribute(rnd,""); markdown.innerHTML = rep.text; }); }) } ); }; hasReplies.oninput = isFollowing.oninput = function(){ if(hasReplies.checked || isFollowing.checked){ feedLocation.classList.add("hohReplaceFeed"); feedContent.style.display = "block"; feedHeader.style.display = "block"; while(feedContent.childElementCount){ feedContent.lastChild.remove(); }; if(hasReplies.checked && isFollowing.checked){ query = ` query($mediaId: Int,$page: Int){ Page(page: $page){ activities(mediaId: $mediaId,hasReplies:true,isFollowing:true,sort:ID_DESC){ ... on ListActivity{ id status progress createdAt user{ name avatar{ medium } } media{ title{ userPreferred } coverImage{medium} } replies{ id text(asHtml: true) createdAt user{ name avatar{ medium } } likes{ name } } likes{ name } } } } }`; } else if(hasReplies.checked){ query = ` query($mediaId: Int,$page: Int){ Page(page: $page){ activities(mediaId: $mediaId,hasReplies:true,sort:ID_DESC){ ... on ListActivity{ id status progress createdAt user{ name avatar{ medium } } media{ title{ userPreferred } coverImage{medium} } replies{ id text(asHtml: true) createdAt user{ name avatar{ medium } } likes{ name } } likes{ name } } } } }`; } else{ query = ` query($mediaId: Int,$page: Int){ Page(page: $page){ activities(mediaId: $mediaId,isFollowing:true,sort:ID_DESC){ ... on ListActivity{ id status progress createdAt user{ name avatar{ medium } } media{ title{ userPreferred } coverImage{medium} } replies{ id text(asHtml: true) createdAt user{ name avatar{ medium } } likes{ name } } likes{ name } } } } }`; }; buildFeed(1); } else{ feedLocation.classList.remove("hohReplaceFeed"); feedContent.style.display = "none"; feedHeader.style.display = "none"; } } } function enhanceForum(){//purpose: reddit-style comment three collapse button if(!document.URL.match(/^https:\/\/anilist\.co\/forum\/thread\/.*/)){ return; } let comments = Array.from(document.getElementsByClassName("comment-wrap")); comments.forEach(function(comment){ if(!comment.hasOwnProperty("hohVisited")){ comment.hohVisited = true; let hider = create("span","hohForumHider","[-]"); hider.onclick = function(){ let parentComment = hider.parentNode.parentNode; if(hider.innerText === "[-]"){ hider.innerText = "[+]"; parentComment.children[1].style.display = "none"; parentComment.parentNode.classList.add("hohCommentHidden"); if(parentComment.parentNode.children.length > 1){ parentComment.parentNode.children[1].style.display = "none"; } } else{ hider.innerText = "[-]"; parentComment.children[1].style.display = "block"; parentComment.parentNode.classList.remove("hohCommentHidden"); if(parentComment.parentNode.children.length > 1){ parentComment.parentNode.children[1].style.display = "block"; } } }; hider.onmouseenter = function(){ hider.parentNode.parentNode.parentNode.classList.add("hohCommentSelected"); } hider.onmouseleave = function(){ hider.parentNode.parentNode.parentNode.classList.remove("hohCommentSelected"); } comment.children[0].children[0].insertBefore( hider, comment.children[0].children[0].children[0] ); } }); setTimeout(enhanceForum,100); } 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){ if(!document.URL.match(/^https:\/\/anilist\.co\/anime\/.*/)){ return; }; let dubNoticeLocation = document.querySelector(".sidebar"); if(!dubNoticeLocation){ setTimeout(function(){ dubCallback(data); },200); return; } if(data.data.Media.characters.edges.reduce( (actors,a) => actors + a.voiceActors.length,0 )){//any voice actors for this language? if(document.getElementById("dubNotice")){ return; } let dubNotice = create("p","#dubNotice",useScripts.dubMarkerLanguage + " dub available"); dubNoticeLocation.insertBefore(dubNotice,dubNoticeLocation.firstChild); } }; generalAPIcall(query,variables,dubCallback,"hohDubInfo" + variables.id + variables.language); } function addSubTitleInfo(){ if(!document.URL.match(/^https:\/\/anilist\.co\/(anime|manga)\/.*/)){ return; } else if(document.querySelector(".hohExtraBox")){ document.querySelector(".hohExtraBox").remove(); }; let sidebar = document.querySelector(".sidebar"); if(!sidebar){ setTimeout(addSubTitleInfo,200); return; }; let title = document.querySelector(".content > h1"); let extraBox = create("div","hohExtraBox"); title.parentNode.insertBefore(extraBox,title.nextElementSibling); let infoNeeded = {}; Array.from(sidebar.querySelectorAll(".data-set .type")).forEach(function(pair){ if(pair.innerText === "Native"){ infoNeeded.native = pair.nextElementSibling.innerText; } if(pair.innerText === "Romaji"){ infoNeeded.romaji = pair.nextElementSibling.innerText; } if(pair.innerText === "English"){ infoNeeded.english = pair.nextElementSibling.innerText; } else if(pair.innerText === "Format"){ infoNeeded.format = pair.nextElementSibling.innerText; } else if(pair.innerText === "Release Date" || pair.innerText === "Start Date"){ infoNeeded.year = pair.nextElementSibling.innerText.match(/\d{4}/)[0]; } else if(pair.innerText === "Studios"){ infoNeeded.studios = pair.nextElementSibling.innerText.replace(/\n/g,", "); }; }); let subTitle = create("p","value","",extraBox,"margin:2px;font-style:italic;"); if(useScripts.titleLanguage === "NATIVE"){ if(infoNeeded.romaji && infoNeeded.romaji !== infoNeeded.native){ subTitle.innerText = infoNeeded.romaji; } else if(infoNeeded.english && infoNeeded.english !== infoNeeded.native){ subTitle.innerText = infoNeeded.english; } } else if(useScripts.titleLanguage === "ENGLISH"){ if(infoNeeded.native && infoNeeded.native !== infoNeeded.english){ subTitle.innerText = infoNeeded.native; } else if(infoNeeded.romaji && infoNeeded.romaji !== infoNeeded.english){ subTitle.innerText = infoNeeded.romaji; } } else{ if( infoNeeded.native && infoNeeded.native.replace(//convert fullwidth to regular before comparing /[\uff01-\uff5e]/g, function(ch){ return String.fromCharCode(ch.charCodeAt(0) - 0xfee0) } ) !== infoNeeded.romaji ){ subTitle.innerText = infoNeeded.native; } } if(infoNeeded.year){ create("span","value",infoNeeded.year,extraBox,"margin-right:10px;"); } if(infoNeeded.format && infoNeeded.format !== "Manga"){ create("span","value",infoNeeded.format,extraBox,"margin-right:10px;"); } if(infoNeeded.studios){ create("span","value",infoNeeded.studios,extraBox); } } function enhanceStaff(){ if(!document.URL.match(/^https:\/\/anilist\.co\/staff\/.*/)){ return; } if(document.querySelector(".hohFavCount")){ return; }; const variables = {id: document.URL.match(/\/staff\/(\d+)\/?/)[1]}; const query = "query($id: Int!){Staff(id: $id){favourites}}"; let favCallback = function(data){ if(!document.URL.match(/^https:\/\/anilist\.co\/staff\/.*/)){ return; } let favCount = document.querySelector(".favourite .count"); if(favCount){ favCount.parentNode.onclick = function(){ if(favCount.parentNode.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; } }; if(data.data.Staff.favourites === 0 && favButton[0].classList.contains("isFavourite")){//safe to assume favCount.innerText = data.data.Staff.favourites + 1; } else{ favCount.innerText = data.data.Staff.favourites; } } else{ setTimeout(function(){favCallback(data)},200); } }; generalAPIcall(query,variables,favCallback,"hohStaffFavs" + variables.id,60*60*1000); } function replaceStaffRoles(){ let URLstuff = location.pathname.match(/^\/staff\/(\d+)\/?.*/); if(!URLstuff){ return; }; let possibleGarbage = document.getElementById("hoh-media-roles"); if(possibleGarbage){ if(possibleGarbage.dataset.staffId === URLstuff[1]){ return; } else{ possibleGarbage.remove(); let possibleFilterBar = document.querySelector(".hohFilterBar"); if(possibleFilterBar){ possibleFilterBar.remove(); }; } }; let insertParent = document.querySelector(".media-roles"); let insertParentCharacters = document.querySelector(".character-roles"); if(!insertParent && !insertParentCharacters){ setTimeout(replaceStaffRoles,200); return; }; let substitution = false; const randomOverData = "data-v-9cd4d61c";//"data-v-09607311" if(!insertParent){ insertParent = create("div",["media-roles","container","substitution"],false,insertParentCharacters.parentNode); insertParent.setAttribute(randomOverData,""); insertParent.setAttribute("data-v-7ef3dcfc",""); substitution = true; } else{ insertParent.classList.add("substitution"); }; insertParent.parentNode.classList.add("substitution"); let hohCharacterRolesBox = create("div","#hoh-character-roles"); let hohCharacterRolesHeader = create("h4",false,"Character Voice Roles",hohCharacterRolesBox); hohCharacterRolesHeader.style.display = "none"; let hohCharacterRoles = create("div","grid-wrap",false,hohCharacterRolesBox); hohCharacterRoles.setAttribute(randomOverData,""); hohCharacterRoles.style.margin = "10px"; let hohMediaRoles = create("div","#hoh-media-roles"); hohMediaRoles.dataset.staffId = URLstuff[1]; let hohMediaRolesAnimeHeader = create("h4",false,"Anime Staff Roles",hohMediaRoles); hohMediaRolesAnimeHeader.style.display = "none"; let hohMediaRolesAnime = create("div","grid-wrap",false,hohMediaRoles); hohMediaRolesAnime.setAttribute(randomOverData,""); hohMediaRolesAnime.style.margin = "10px"; let hohMediaRolesMangaHeader = create("h4",false,"Manga Staff Roles",hohMediaRoles); hohMediaRolesMangaHeader.style.display = "none"; let hohMediaRolesManga = create("div","grid-wrap",false,hohMediaRoles); hohMediaRolesManga.setAttribute(randomOverData,""); hohMediaRolesManga.style.margin = "10px"; //sort let hohMediaSort = create("div",["container","hohFilterBar"]); hohMediaSort.setAttribute("data-v-7ef3dcfc",""); let sortText = create("span",false,"Sort",hohMediaSort); let sortSelect = create("select",false,false,hohMediaSort); sortSelect.style.marginLeft = "5px"; let filterSelect = create("input",false,false,hohMediaSort); filterSelect.setAttribute("list","staffRoles"); filterSelect.placeholder = "Filter"; let dataList = create("datalist",false,false,hohMediaSort); dataList.id = "staffRoles"; let digestStats = create("span",false,false,hohMediaSort,"margin-left:100px;"); let sortOptionAlpha = create("option",false,"Alphabetical",sortSelect); sortOptionAlpha.value = "alphabetical"; let sortOptionChrono = create("option",false,"Chronological",sortSelect); sortOptionChrono.value = "chronological"; let sortOptionPopularity = create("option",false,"Popularity",sortSelect); sortOptionPopularity.value = "popularity"; let sortOptionLength = create("option",false,"Length",sortSelect); sortOptionLength.value = "length"; let sortOptionScore = create("option",false,"Score",sortSelect); sortOptionScore.value = "score"; if(useScripts.accessToken){ let sortOptionMyScore = create("option",false,"My Score",sortSelect); sortOptionMyScore.value = "myScore"; } let autocomplete = new Set(); sortSelect.value = useScripts.staffRoleOrder; hohMediaSort.style.marginBottom = "10px"; hohMediaSort.style.marginTop = "3px"; //end sort let initPerformed = false; let UIinit = function(){ initPerformed = true; insertParent.parentNode.insertBefore(hohMediaSort,insertParentCharacters); insertParent.insertBefore(hohMediaRoles,insertParent.children[0]); insertParentCharacters.insertBefore(hohCharacterRolesBox,insertParentCharacters.children[0]); }; let animeRolesList = []; let mangaRolesList = []; let voiceRolesList = []; let listRenderer = function(){ if(!initPerformed){ UIinit(); }; useScripts.staffRoleOrder = sortSelect.value; useScripts.save(); if(sortSelect.value === "alphabetical"){ animeRolesList.sort(function(a,b){return a.title.localeCompare(b.title)}); mangaRolesList.sort(function(a,b){return a.title.localeCompare(b.title)}); voiceRolesList.sort(function(a,b){return a.title.localeCompare(b.title)}); } else if(sortSelect.value === "chronological"){ let yearSorter = function(a,b){ if(!a.startDate.year){ return 1; }; if(a.startDate.year === b.startDate.year){ if(a.startDate.month === b.startDate.month){ if(a.startDate.day === b.startDate.day){ return 1; } else{ return a.startDate.day - b.startDate.day; }; } else{ return a.startDate.month - b.startDate.month; }; } else{ return a.startDate.year - b.startDate.year; }; }; animeRolesList.sort(yearSorter); mangaRolesList.sort(yearSorter); voiceRolesList.sort(yearSorter); } else if(sortSelect.value === "popularity"){ animeRolesList.sort(function(b,a){return a.popularity - b.popularity}); mangaRolesList.sort(function(b,a){return a.popularity - b.popularity}); voiceRolesList.sort(function(b,a){return a.popularity - b.popularity}); } else if(sortSelect.value === "score"){ animeRolesList.sort(function(b,a){return a.score - b.score}); mangaRolesList.sort(function(b,a){return a.score - b.score}); voiceRolesList.sort(function(b,a){return a.score - b.score}); } else if(sortSelect.value === "length"){ animeRolesList.sort(function(b,a){ if(a.episodes === b.episodes){ return a.duration - b.duration } else{ return a.episodes - b.episodes }; }); voiceRolesList.sort(function(b,a){ if(a.episodes === b.episodes){ return a.duration - b.duration } else{ return a.episodes - b.episodes }; }); mangaRolesList.sort(function(b,a){ if(a.chapters === b.chapters){ return a.volumes - b.volumes } else{ return a.chapters - b.chapters }; }); } else if(sortSelect.value === "myScore"){ let scoreSorter = function(b,a){ let scoreTier = (a.myStatus ? a.myStatus.scoreRaw : 0) - (b.myStatus ? b.myStatus.scoreRaw : 0); if(scoreTier !== 0){ return scoreTier; } let progressTier = (a.myStatus ? a.myStatus.progress : -1) - (b.myStatus ? b.myStatus.progress : -1); if(progressTier !== 0){ return progressTier; } return a.popularity - b.popularity; } animeRolesList.sort(scoreSorter); mangaRolesList.sort(scoreSorter); voiceRolesList.sort(scoreSorter); } const randomData = "data-v-2e73eee5"; if(animeRolesList.length){ hohMediaRolesAnimeHeader.style.display = "inline"; } else{ hohMediaRolesAnimeHeader.style.display = "none"; } if(mangaRolesList.length){ hohMediaRolesMangaHeader.style.display = "inline"; } else{ hohMediaRolesMangaHeader.style.display = "none"; } if(voiceRolesList.length){ hohCharacterRolesHeader.style.display = "inline"; } else{ hohCharacterRolesHeader.style.display = "none"; } let createRoleCard = function(media,type){ let roleCard = create("div",["role-card","view-media"]); roleCard.setAttribute(randomData,""); roleCard.style.position = "relative"; let mediaA = create("div","media",false,roleCard); mediaA.setAttribute(randomData,""); let cover = create("a","cover",false,mediaA); cover.href = "/" + type + "/" + media.id + "/" + safeURL(media.title); cover.style.backgroundImage = "url(" + media.image + ")"; cover.setAttribute(randomData,""); let content = create("a","content",false,mediaA); content.href = "/" + type + "/" + media.id + "/" + safeURL(media.title); content.setAttribute(randomData,""); let name = create("div","name",media.title,content); name.setAttribute(randomData,""); let role = create("div","role",media.role.join(", "),content); role.setAttribute(randomData,""); if(media.myStatus){ let statusDot = create("div",["hohStatusDot","hohStatusDotRight"],false,roleCard); statusDot.style.background = distributionColours[media.myStatus.status]; statusDot.title = media.myStatus.status.toLowerCase(); }; return roleCard; }; let sumDuration = 0; let sumChapters = 0; let sumVolumes = 0; let sumScores = 0; let amount = 0; while(hohCharacterRoles.childElementCount){ hohCharacterRoles.lastChild.remove(); }; for(var i=0;i 0){ if(data.media.type === "ANIME"){ rewatchSuffix = " [rewatch"; } else{ rewatchSuffix = " [reread"; } if(data.repeat === 1){ rewatchSuffix += "]"; } else{ rewatchSuffix += " " + data.repeat + "]"; } }; if(data.score){ if(status.innerText.match(/^completed/i)){ scoreInfo.innerHTML = scoreSuffix; create("span",false,noteSuffix,scoreInfo); create("span",false,rewatchSuffix,scoreInfo); } else{ scoreInfo.innerHTML = scoreSuffix; create("span",false,noteSuffix,scoreInfo); }; scoreInfo.style.display = "inline"; }; }; const variables = { userName: status.parentNode.children[0].innerText, mediaId: +mediaId[1] }; const query = ` query($userName: String,$mediaId: Int){ MediaList( userName: $userName, mediaId: $mediaId ){ score mediaId notes repeat media{type} user{ name mediaListOptions{scoreFormat} } } }`; //generalAPIcall(query,variables,callback,"hohCompletedScores" + variables.mediaId + variables.userName,60*1000) bigQuery.push({ query: query, variables: variables, callback: callback, cacheKey: "hohCompletedScores" + variables.mediaId + variables.userName, duration: 60*1000 }); }; } else if(status.children.length === 2 && !status.classList.contains("form")){ status.children[1].remove(); }; }); queryPacker(bigQuery); }; function enhanceTags(){//show tag definition in drop down menu when adding tags if(!location.pathname.match(/^\/(anime|manga)\/.*/)){ return; }; setTimeout(enhanceTags,400); let possibleTagContainers = document.getElementsByClassName("el-select-dropdown__list"); let bestGuess = false; 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; }; let superBody = document.getElementsByClassName("el-dialog__body")[0]; let descriptionTarget = create("span","#hohDescription"); superBody.insertBefore(descriptionTarget,superBody.children[2]); for(var i=0;i