BlueCat Address Manager Color Change

Change the color of the UI in BlueCat Address Manager

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        BlueCat Address Manager Color Change
// @namespace   *
// @description Change the color of the UI in BlueCat Address Manager
// @include     */app*
// @version     3
// @author      Marius Galm
// @copyright   2018, Marius Galm
// @license     MIT
// @grant       none
// @icon        https://www.bluecatnetworks.com/wp-content/uploads/2018/03/cropped-bluecat-favicon-32x32.png
// ==/UserScript==

// -----------------------------------------------------------------------
// Please Adjust this to reflect the hostname of the URL you access
// -> Can be a full qualified name or hostname only

var redHost = "bam-01.n3k.de";
var greenHost = "bam-02";
// -----------------------------------------------------------------------


// CODE

if (document.readyState === "interactive" ) {
    if (window.location.hostname == redHost) {
        //red
        rotateTo("165");
    } else if (window.location.hostname == greenHost) {
        //green
        rotateTo("-85");
    }
}

function rotateTo(value) {
    var rotation=value;
    var links = document.getElementsByTagName("link");
    var linksList = Array.prototype.slice.call(links);
    linksList.forEach(function(link) {
        if (link.href.includes("/cached-style/proteus-silver.css")) {
            var sheet = link.sheet;
            var rule = ".tab-bar { filter: hue-rotate("+rotation+"deg)}";
            var rule2 = "#banner { position: sticky; top: -3px; filter: hue-rotate("+rotation+"deg)}";
            var rule3 = ".navigation-bar { position: sticky; top: 54px;}";
            sheet.insertRule(rule,0);
            sheet.insertRule(rule2,0);
            sheet.insertRule(rule3,0);
        }
    });
};