ncl-cedarville-freshmen.user.js
edited
1// ==UserScript==
2// @name Leaderboard Username Highlighter
3// @namespace http://tampermonkey.net/
4// @version 1.0
5// @description Highlight specific usernames with rainbow colors and add AKA labels
6// @author You
7// @match https://cyberskyline.com/world/*
8// @grant none
9// ==/UserScript==
10
11(function() {
12 'use strict';
13
14 // Username mappings
15 const userMappings = {
16 'cu_taciturnaxolotl': 'Kieran Klukas',
17 'DF Omen': 'Daniel Frank',
18 'cu_noxe': "Ben Mast",
19 'cu_cL4UDIOS': "Will Guido",
20 'CU_Kroma': "Soren Brumbach",
21 'cu_JoshuaCordova': 'Joshua Cordova',
22 'cu_RetiredCapybara': 'Josh Hochstedler',
23 };
24
25 // Teal and Orange color palette (expanded)
26 const colors = [
27 '#662400', // Dark Brown-Orange
28 '#B33F00', // Burnt Orange
29 '#FF6B1A', // Bright Orange
30 '#006663', // Deep Teal
31 '#00B3AD', // Bright Teal
32 '#8B2E00', // Rusty Orange
33 '#FF8533', // Light Orange
34 '#FFA04D', // Peach Orange
35 '#004D4A', // Dark Teal
36 '#008F8A', // Medium Teal
37 '#00D4CC', // Cyan Teal
38 '#4D1F00', // Very Dark Orange
39 '#E05500', // Medium Orange
40 '#FF9B66', // Soft Orange
41 '#003330', // Very Dark Teal
42 '#00665F', // Dark-Medium Teal
43 '#1AFFEC', // Light Cyan
44 '#994400', // Terracotta
45 '#CC5500', // Burnt Sienna
46 '#00998F', // Jade Teal
47 ];
48
49 // Shuffle colors to ensure variety
50 function shuffleArray(array) {
51 const shuffled = [...array];
52 for (let i = shuffled.length - 1; i > 0; i--) {
53 const j = Math.floor(Math.random() * (i + 1));
54 [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
55 }
56 return shuffled;
57 }
58
59 const shuffledColors = shuffleArray(colors);
60 let colorIndex = 0;
61
62 // Store colors for each user to keep them consistent and unique
63 const userColors = {};
64 Object.keys(userMappings).forEach(username => {
65 if (!userColors[username]) {
66 userColors[username] = shuffledColors[colorIndex % shuffledColors.length];
67 colorIndex++;
68 }
69 });
70
71 // Function to highlight usernames
72 function highlightUsernames() {
73 // Find all table cells that might contain usernames
74 const cells = document.querySelectorAll('td');
75
76 cells.forEach(cell => {
77 const text = cell.textContent.trim();
78
79 // Check if this cell contains one of our target usernames
80 if (userMappings.hasOwnProperty(text)) {
81 const aka = userMappings[text];
82 const color = userColors[text];
83
84 // Apply styling
85 cell.style.backgroundColor = color;
86 cell.style.color = 'white';
87 cell.style.fontWeight = 'bold';
88 cell.style.padding = '5px';
89 cell.style.borderRadius = '3px';
90
91 // Force white color on all child elements (including gradient spans)
92 const allChildren = cell.querySelectorAll('*');
93 allChildren.forEach(child => {
94 child.style.color = 'white';
95 });
96
97 // Add AKA label if not already added
98 if (!cell.querySelector('.aka-label')) {
99 const akaSpan = document.createElement('span');
100 akaSpan.className = 'aka-label';
101 akaSpan.textContent = ` (AKA ${aka})`;
102 akaSpan.style.fontSize = '0.9em';
103 akaSpan.style.fontStyle = 'italic';
104 akaSpan.style.color = 'white';
105 cell.appendChild(akaSpan);
106 }
107 }
108 });
109 }
110
111 // Run on page load
112 highlightUsernames();
113
114 // Watch for dynamic content changes
115 const observer = new MutationObserver(highlightUsernames);
116 observer.observe(document.body, {
117 childList: true,
118 subtree: true
119 });
120})();