GravityTales CleanUp

Removes unnecessary elements from GravityTales to create a more pleasant reading experience.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         GravityTales CleanUp
// @namespace    http://gravitytales.com
// @include      http://gravitytales.com/novel/*
// @description  Removes unnecessary elements from GravityTales to create a more pleasant reading experience.
// @version      1.0.2
// @grant        none
// ==/UserScript==

function removeElementsByClass(className){
  var elements = document.getElementsByClassName(className);
  while(elements.length > 0){
    elements[0].parentNode.removeChild(elements[0]);
  }
}

function removeElementsByTag(tagName){
  var elements = document.getElementsByTagName(tagName);
  while(elements.length > 0){
    elements[0].parentNode.removeChild(elements[0]);
  }
}

removeElementsByClass('side-nav');
removeElementsByClass('header');
removeElementsByClass('comments');
removeElementsByClass('navbar');
removeElementsByTag('footer'); 

document.getElementsByClassName('main-content')[0].setAttribute('style', 'position:relative;left:15%;');
document.querySelector('head').innerHTML += '<style>.cc_banner{display:none;}</style>';

setTimeout(function(){ removeElementsByClass('cc_banner'); }, 1000);