Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name AP Theme
- // @namespace AP
- // @include http://www.anime-planet.com/*
- // @version 1.3.3
- // @grant none
- // ==/UserScript==
- $(document) .ready(function () {
- /* Background */
- $('body').css('background', 'url(http://i61.tinypic.com/2vczyv4.jpg) no-repeat center top');
- /* Links and Sub Headers */
- $('a, h3, h4, h5').css('color', '#5AA5C5 !important');
- /* Headers */
- $('h1, h2').css('color', '#99CCFF');
- /* Buttons */
- $('button, .button').css('color', '#FFFFFF').css('background-color', '#384D77');
- /* Main logo */
- $('#siteLogo').css('color', '#99CCFF');
- /* Line above top menu */
- $('#siteHeader').css('border-top-color', '#384D77').css('border-bottom-color', '#99CCFF').css('box-shadow', '0 0 10px #99CCFF')
- /* main container and footer */
- $('#siteContainer, #siteFooter').css('border-color', '#99CCFF').css('box-shadow', '0 0 5px #99CCFF');
- /* Love and Hate icons */
- $('.heartSwitch.love .heartOn').css('color', '#8DC63F');
- $('.heartSwitch.hate .heartOff').css('color', 'Red');
- /* Add magnify glass + make search bar a little bigger */
- $('#siteSearch-input').css('background', 'url(http://i59.tinypic.com/so5xqg.png) no-repeat 2px 3px white').css('padding-left', '20px').css('width', '110px') .css('border-right', '1px solid #99CCFF');
- $('.dropSearch').css('border', '1px solid #99CCFF').css('width', '200px').css('padding-left', '0px');
- /* Correcting Social stuff back to original */
- $('.logo-fb').css('color', '#3B5998');
- $('.logo-tw').css('color', '#4099FF');
- $('.logo-ct').css('color', '#D94733');
- /* Table font size */
- $('.tableAnime ul li, .tableManga ul li').css('font-size', 'small');
- /* disable edit background overlay */
- $('.profileBackground .edit-background, .profileHeader .profile-avatar .edit').css('background', 'none');
- /* tooltip header and reflexive menu color */
- var style = '<style type="text/css">a h4,h5 a{color: #5AA5C5 !important} @media screen and (max-width: 767px), (max-device-width: 767px) and (orientation: portrait), (max-device-width: 499px) and (orientation: landscape){#siteHeader #siteNav, #siteHeader #siteNav > ul > li.pure-u ul,#siteHeader #siteUser .loggedIn .loggedInOptions div{background-color:#FFFFFF}}</style>';
- $('head').append(style);
- /* Add expand image on character previews */
- $('.tableAvatar a img').attr('title', function () {
- return '<img src=\'http://www.anime-planet.com' + this.getAttribute('src') + '\' style=\'max-width:360px\' />';
- });
- $('.tableAvatar a img').tooltip({
- content: function () {
- return this.getAttribute('title');
- },
- position: {
- my: 'right center',
- at: 'left top',
- collision: 'flipfit'
- },
- close: function (event, ui) {
- ui.tooltip.hover(function () {
- $(this).stop(true).fadeTo(100, 1)
- }, function () {
- $(this).fadeOut('100', function () {
- $(this) .remove()
- })
- })
- }
- });
- /*$('.portrait img').tooltip({
- content: function () {
- return this.getAttribute('title');
- },
- position: {
- my: 'right top',
- at: 'left bottom',
- collision: 'none',
- viewport: $('#siteContainer')
- },
- close: function (event, ui) {
- ui.tooltip.hover(function () {
- $(this).stop(true).fadeTo(100, 1)
- }, function () {
- $(this).fadeOut('100', function () {
- $(this) .remove()
- })
- })
- }
- });*/
- /* Move anime tooltips to the left hand side */
- $(function () {
- $(".tooltip").each(function () {
- var extraClass = $(this).data("class");
- var atPosition = extraClass ? "left-11 top-52" : "left-11 top+50";
- $(this).tooltip({
- content: function () {
- return $(this).attr("title")
- },
- position: {
- my: "right top",
- at: /*atPosition*/'left bottom',
- collision: "flip"/*,
- using: function (position, feedback) {
- $(this).css(position);
- $(this).addClass(feedback.horizontal).addClass(extraClass)
- }*/
- },
- close: function (event, ui) {
- ui.tooltip.hover(function () {
- $(this).stop(true).fadeTo(100, 1)
- }, function () {
- $(this).fadeOut("100", function () {
- $(this).remove()
- })
- })
- }
- })
- })
- });
- /*Highlight anime with unwatched episodes */
- $('.myListBar .episodes').css('background', function() {
- if(this.selectedIndex < (this.childElementCount-1) && (this.disabled == false)){return '#99CCFF';}
- });
- /*VA table width fix */
- $('.voiceactors table').css('width', '100%');
- $('.voiceactors table thead').css('text-align', 'left');
- /*Liked Disliked bar*/
- $(function () {
- setTimeout(A, 10);
- });
- function A() {
- var liked = parseInt(($('section .sidebarStats h3').eq(0).text().replace(',','').split(/\s+/))[0]);
- var disliked = parseInt(($('section .sidebarStats h3').eq(1).text().replace(',','').split(/\s+/))[0]);
- var total = liked + disliked;
- if (total > 0){
- $('section .sidebarStats').eq(0).prepend( "<div id='divLikedBar'></div>" );
- $(function() {
- $( "#divLikedBar" ).progressbar({
- max: total,
- value: liked
- });
- });
- $("#divLikedBar").css('background','#FF0000');
- $("#divLikedBar > div").css('background','#8DC63F');
- $(".ui-progressbar").css('overflow','visible').css('height', '20px');
- }
- }
- /* Old style no image */
- /*$('img').attr('src', function () {
- if (this.getAttribute('src') == '/inc/img/fallback/blank_main.jpg') {
- return '/images/characters/blank_char.gif';
- } else {
- return this.getAttribute('src');
- }
- });*/
- /*Menu fix*/
- /*$('#siteHeader #siteNav > ul > li > a').css('font-size','1.1em');*/
- /*$('#siteHeader #siteNav > ul > li ul').css('top','54px');*/
- $('.myListBar').css('white-space', 'normal');
- /* Change default search by section */
- var typeSelector = document.querySelector('#siteSearch-select');
- if (typeSelector != null) {
- if (window.location.href.indexOf('http://www.anime-planet.com/manga') == 0) {
- typeSelector.value = "manga";
- }
- if (window.location.href.indexOf('http://www.anime-planet.com/characters') == 0) {
- typeSelector.value = "characters";
- }
- if (window.location.href.indexOf('http://www.anime-planet.com/people') == 0) {
- typeSelector.value = "people";
- }
- if (window.location.href.indexOf('http://www.anime-planet.com/users') == 0) {
- typeSelector.value = "users";
- }
- if (window.location.href.indexOf('http://www.anime-planet.com/forum') == 0) {
- typeSelector.value = "forum";
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement