Advertisement
Guest User

cytube name colors

a guest
Apr 24th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Cytube Color Names
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://cytu.be/r/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. const colors = {
  12.     "trashbyte": "#ff00aa",
  13.     "Valfreyja": "#ffaaaa",
  14.     "Gappy": "#2ecc71",
  15.     "Clocks": "#127000",
  16.     "Kasran": "#5c5caa",
  17.     "VoxSomniator": "#c4b7fa",
  18.     "Emiable": "#76c8b9",
  19.     "NotGyro": "#2261f7",
  20.     "Forgebold": "#E67E22"
  21. };
  22.  
  23. (function() {
  24.     'use strict';
  25.  
  26.     let update_names = function() {
  27.         let usernames = document.querySelectorAll(".username");
  28.         for (const elem of usernames) {
  29.             for (const [user, color] of Object.entries(colors)) {
  30.                 if (elem.innerText === user+": ") {
  31.                     elem.style.color = color;
  32.                 }
  33.             }
  34.         }
  35.     };
  36.  
  37.     let update_userlist = function() {
  38.         let usernames = document.querySelectorAll("#userlist .userlist_op");
  39.         for (const elem of usernames) {
  40.             for (const [user, color] of Object.entries(colors)) {
  41.                 if (elem.innerText === user) {
  42.                     elem.style.cssText = `color: ${color} !important`;
  43.                 }
  44.             }
  45.         }
  46.     };
  47.  
  48.     setInterval(update_names, 100);
  49.     setInterval(update_userlist, 1000);
  50. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement