Skip to content

Instantly share code, notes, and snippets.

@CairX
Created July 16, 2015 18:43
Show Gist options
  • Save CairX/5a997e1df552a46f9b9e to your computer and use it in GitHub Desktop.
Save CairX/5a997e1df552a46f9b9e to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Animefreak Cleaner
// @namespace http://tcode.se/scripts
// @description Changes the visual style of Animefreak with the goal to make it less cluttered.
// @include http://www.animefreak.tv/watch/*episode-*
// @version 0.1
// @grant none
// @noframes
// ==/UserScript==
// Remove all current styling.
var styles = document.querySelectorAll('link,style,[style]');
for(i = styles.length; i--;) {
var a = styles[i];
a.style.cssText ? a.style.cssText='' : a.outerHTML='';
}
// New CSS.
var css = "html { font: 16px/1 Arial, sans-serif; padding: 0; margin: 0;}\
body { background: #f6f6f6; color: rgba(0, 0, 0, 0.25); padding: 0; margin: 0; text-align: center; }\
a { text-decoration: none; color: #f48fb1; }\
#utilities { display: flex; justify-content: space-between; align-items: center; margin: 0 3rem; }\
#submenu { margin: 0 3rem; border-bottom: 1px solid rgba(8, 8, 8, 0.05); }\
.links { display: flex; justify-content: flex-end; list-style: none; padding: 0; margin: 0; }\
.links a { padding: 1rem; display: inline-block; text-decoration: none; color: #b39ddb; }\
.wrapper { border-top: 1px solid rgba(255, 255, 255, 0.75); margin: 0 3rem; }\
#apDiv1, #edit-submit-1, .fivestar-widget, .book-navigation { display: none; }\
.node + .defaultblock { display: none; }\
.lsidebar { width: 50%; float:left; }\
.rsidebar { width: 50%; float:right; }\
.lsidebar > .defaultblock:first-child { display: none; }\
.lsidebar > .defaultblock:last-child { display: none; }\
#footer { display: none; }\
hr { border-width: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.75); border-top: 1px solid rgba(0, 0, 0, 0.05); }\
.content table:first-child, .content .messages:first-child { display: none; }\
#player iframe { display: block; margin: 1rem auto; }\
.content iframe:last-of-type { display: none; }\
h1, h2 { font-weight: normal; }";
// Add new styling.
var style = document.createElement("style");
style.innerHTML = css;
document.head.appendChild(style);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment