Change style background

Change style background for website http://valvrareteam.com/

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Change style background
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Change style background for website http://valvrareteam.com/
// @author       Nguyen Huu Tien
// @include      http://valvrareteam.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var interval = setInterval(function(){
        if(window.jQuery) {
            clearInterval(interval);
            jQuery(document).ready(function($){
                var $fbComment = $('.fb-comments');

                var handleStyles = {
                    black: function() {
                        $('.article, .single_post').css({backgroundColor: 'black', color: 'white'});
                        $fbComment.find('> span').css({backgroundColor: 'black', color: 'white'});
                    },
                    white: function() {
                        $('.article, .single_post').css({backgroundColor: 'white', color: 'black'});
                        $fbComment.find('> span').css({backgroundColor: 'black', color: 'white'});
                    },
                };
                var $body = $('body');

                var $controllerContainer = $('<div title="Skin" class="controller-container"><div style="background-color: black;" data-handle-style-name="black" class="styles style-black"></div><div style="background-color: white;" data-handle-style-name="white" class="styles style-white"></div></div>');
                $controllerContainer.css({
                    position: 'fixed',
                    width: 30,
                    right: 5,
                    top: 50,
                    border: 'black solid 1px',
                    zIndex: 1000,
                    backgroundColor: '#19B753',
                    padding: 2
                });
                var $handleStylesElement = $controllerContainer.find('.styles');
                $handleStylesElement.css({
                    width: '100%',
                    height: 20,
                    cursor: 'pointer'
                });

                $handleStylesElement.on('click', function(){
                    var handle = handleStyles[$(this).data('handle-style-name')];
                    if(typeof handle === 'function') {
                        handle();
                    }
                });

                $controllerContainer.appendTo($body);

                handleStyles.white();
                $('#content_box h1.title').css({color: '#339966'});
                var interval = setInterval(function() {
                    var $span = $fbComment.find('> span');
                    if($span.length) {
                        $span.css({backgroundColor: 'black', color: 'white'});
                        clearInterval(interval);
                    }
                }, 100);
            });
        }

    }, 500);

})();