Advertisement
Guest User

AP Theme 1.3.3

a guest
Dec 21st, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.60 KB | None | 0 0
  1. // ==UserScript==
  2. // @name AP Theme
  3. // @namespace AP
  4. // @include http://www.anime-planet.com/*
  5. // @version 1.3.3
  6. // @grant none
  7. // ==/UserScript==
  8. $(document) .ready(function () {
  9. /* Background */
  10. $('body').css('background', 'url(http://i61.tinypic.com/2vczyv4.jpg) no-repeat center top');
  11.  
  12. /* Links and Sub Headers */
  13. $('a, h3, h4, h5').css('color', '#5AA5C5 !important');
  14.  
  15. /* Headers */
  16. $('h1, h2').css('color', '#99CCFF');
  17.  
  18. /* Buttons */
  19. $('button, .button').css('color', '#FFFFFF').css('background-color', '#384D77');
  20.  
  21. /* Main logo */
  22. $('#siteLogo').css('color', '#99CCFF');
  23.  
  24. /* Line above top menu */
  25. $('#siteHeader').css('border-top-color', '#384D77').css('border-bottom-color', '#99CCFF').css('box-shadow', '0 0 10px #99CCFF')
  26.  
  27. /* main container and footer */
  28. $('#siteContainer, #siteFooter').css('border-color', '#99CCFF').css('box-shadow', '0 0 5px #99CCFF');
  29.  
  30. /* Love and Hate icons */
  31. $('.heartSwitch.love .heartOn').css('color', '#8DC63F');
  32. $('.heartSwitch.hate .heartOff').css('color', 'Red');
  33.  
  34. /* Add magnify glass + make search bar a little bigger */
  35. $('#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');
  36. $('.dropSearch').css('border', '1px solid #99CCFF').css('width', '200px').css('padding-left', '0px');
  37.  
  38. /* Correcting Social stuff back to original */
  39. $('.logo-fb').css('color', '#3B5998');
  40. $('.logo-tw').css('color', '#4099FF');
  41. $('.logo-ct').css('color', '#D94733');
  42.  
  43. /* Table font size */
  44. $('.tableAnime ul li, .tableManga ul li').css('font-size', 'small');
  45.  
  46. /* disable edit background overlay */
  47. $('.profileBackground .edit-background, .profileHeader .profile-avatar .edit').css('background', 'none');
  48.  
  49. /* tooltip header and reflexive menu color */
  50. 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>';
  51. $('head').append(style);
  52.  
  53. /* Add expand image on character previews */
  54. $('.tableAvatar a img').attr('title', function () {
  55. return '<img src=\'http://www.anime-planet.com' + this.getAttribute('src') + '\' style=\'max-width:360px\' />';
  56. });
  57. $('.tableAvatar a img').tooltip({
  58. content: function () {
  59. return this.getAttribute('title');
  60. },
  61. position: {
  62. my: 'right center',
  63. at: 'left top',
  64. collision: 'flipfit'
  65. },
  66. close: function (event, ui) {
  67. ui.tooltip.hover(function () {
  68. $(this).stop(true).fadeTo(100, 1)
  69. }, function () {
  70. $(this).fadeOut('100', function () {
  71. $(this) .remove()
  72. })
  73. })
  74. }
  75. });
  76.  
  77. /*$('.portrait img').tooltip({
  78. content: function () {
  79. return this.getAttribute('title');
  80. },
  81. position: {
  82. my: 'right top',
  83. at: 'left bottom',
  84. collision: 'none',
  85. viewport: $('#siteContainer')
  86. },
  87. close: function (event, ui) {
  88. ui.tooltip.hover(function () {
  89. $(this).stop(true).fadeTo(100, 1)
  90. }, function () {
  91. $(this).fadeOut('100', function () {
  92. $(this) .remove()
  93. })
  94. })
  95. }
  96. });*/
  97.  
  98.  
  99. /* Move anime tooltips to the left hand side */
  100. $(function () {
  101. $(".tooltip").each(function () {
  102. var extraClass = $(this).data("class");
  103. var atPosition = extraClass ? "left-11 top-52" : "left-11 top+50";
  104. $(this).tooltip({
  105. content: function () {
  106. return $(this).attr("title")
  107. },
  108. position: {
  109. my: "right top",
  110. at: /*atPosition*/'left bottom',
  111. collision: "flip"/*,
  112. using: function (position, feedback) {
  113. $(this).css(position);
  114. $(this).addClass(feedback.horizontal).addClass(extraClass)
  115. }*/
  116. },
  117. close: function (event, ui) {
  118. ui.tooltip.hover(function () {
  119. $(this).stop(true).fadeTo(100, 1)
  120. }, function () {
  121. $(this).fadeOut("100", function () {
  122. $(this).remove()
  123. })
  124. })
  125. }
  126. })
  127. })
  128. });
  129.  
  130. /*Highlight anime with unwatched episodes */
  131. $('.myListBar .episodes').css('background', function() {
  132. if(this.selectedIndex < (this.childElementCount-1) && (this.disabled == false)){return '#99CCFF';}
  133. });
  134.  
  135. /*VA table width fix */
  136. $('.voiceactors table').css('width', '100%');
  137. $('.voiceactors table thead').css('text-align', 'left');
  138.  
  139. /*Liked Disliked bar*/
  140. $(function () {
  141. setTimeout(A, 10);
  142. });
  143. function A() {
  144. var liked = parseInt(($('section .sidebarStats h3').eq(0).text().replace(',','').split(/\s+/))[0]);
  145. var disliked = parseInt(($('section .sidebarStats h3').eq(1).text().replace(',','').split(/\s+/))[0]);
  146. var total = liked + disliked;
  147. if (total > 0){
  148. $('section .sidebarStats').eq(0).prepend( "<div id='divLikedBar'></div>" );
  149. $(function() {
  150. $( "#divLikedBar" ).progressbar({
  151. max: total,
  152. value: liked
  153. });
  154. });
  155. $("#divLikedBar").css('background','#FF0000');
  156. $("#divLikedBar > div").css('background','#8DC63F');
  157. $(".ui-progressbar").css('overflow','visible').css('height', '20px');
  158. }
  159. }
  160. /* Old style no image */
  161. /*$('img').attr('src', function () {
  162. if (this.getAttribute('src') == '/inc/img/fallback/blank_main.jpg') {
  163. return '/images/characters/blank_char.gif';
  164. } else {
  165. return this.getAttribute('src');
  166. }
  167. });*/
  168.  
  169. /*Menu fix*/
  170. /*$('#siteHeader #siteNav > ul > li > a').css('font-size','1.1em');*/
  171. /*$('#siteHeader #siteNav > ul > li ul').css('top','54px');*/
  172.  
  173. $('.myListBar').css('white-space', 'normal');
  174.  
  175. /* Change default search by section */
  176. var typeSelector = document.querySelector('#siteSearch-select');
  177. if (typeSelector != null) {
  178. if (window.location.href.indexOf('http://www.anime-planet.com/manga') == 0) {
  179. typeSelector.value = "manga";
  180. }
  181. if (window.location.href.indexOf('http://www.anime-planet.com/characters') == 0) {
  182. typeSelector.value = "characters";
  183. }
  184. if (window.location.href.indexOf('http://www.anime-planet.com/people') == 0) {
  185. typeSelector.value = "people";
  186. }
  187. if (window.location.href.indexOf('http://www.anime-planet.com/users') == 0) {
  188. typeSelector.value = "users";
  189. }
  190. if (window.location.href.indexOf('http://www.anime-planet.com/forum') == 0) {
  191. typeSelector.value = "forum";
  192. }
  193. }
  194.  
  195. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement