Change Standard Scrollbar

Changes default scrollbar to more simple one

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Change Standard Scrollbar
// @namespace    https://github.com/RedCommander735
// @version      1.1
// @description  Changes default scrollbar to more simple one
// @author       RedCommander735
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant        none
// @match        *://*/*
// @license      WTFPL
// @grant GM_addStyle
// ==/UserScript==

(function() {

    var c = window.getComputedStyle( document.body ,null).getPropertyValue('background-color');

    var rgb = c.match(/\d+/g);
    var color = 0;

    var o = Math.round(((parseInt(rgb[0]) * 299) + (parseInt(rgb[1]) * 587) + (parseInt(rgb[2]) * 114)) /1000);
    console.log(o);
    if(o > 125) {
        color = 0;
    }else{
        color = 255;
    }

        var css = (`
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: rgb(${color}, ${color}, ${color}, .3);
  filter: brightness(.1);
}
/* Handle */
::-webkit-scrollbar-thumb {
  background: rgb(${color}, ${color}, ${color}, .45);
  filter: brightness(.25);
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: rgb(${color}, ${color}, ${color}, .65);
  filter: brightness(.5);
}
`);

        if (typeof GM_addStyle !== "undefined") {
            GM_addStyle(css);
        } else {
            var styleNode = document.createElement("style");
            styleNode.appendChild(document.createTextNode(css));
            (document.querySelector("head") || document.documentElement).appendChild(styleNode);
        }
})();