teams style

styling teams according to the connected account

当前为 2020-09-28 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         teams style
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  styling teams according to the connected account
// @author       CoStiC
// @match        https://teams.microsoft.com/*
// @grant        none
// @require https://greasyfork.org/scripts/394721-w84kel/code/w84Kel.js?version=763614
// ==/UserScript==

(function() {
    'use strict';

    waitForKeyElements("#personDropdown", item => getUser(item))
})();

function getUser() {
    let userContainer = arguments[0].querySelector("[upn]");
    let user = userContainer.getAttribute("upn");
    teamsStyling(user);
}

function teamsStyling(user) {
    let hbar = document.querySelectorAll(".app-header-bar")[0],
        navbar = document.querySelector("app-bar");;
    switch (user) {
        case "[email protected]":
            hbar.style.background = "#009aa3";
            navbar.style.background = "#007076";
            break;
        case "[email protected]":
            hbar.style.background = "#ffc928";
            navbar.style.background = "#003da5";
            break;
        case "[email protected]" :
            hbar.style.background = "#de1823";
            navbar.style.background = "#f67200";
            break;
    }
}