From 1161727520f0a32b17062cc7a2258159f590451a Mon Sep 17 00:00:00 2001 From: BloxerHD018 Date: Sat, 11 Oct 2025 11:35:21 +0100 Subject: [PATCH] Added Support for User Access Level in Account Page --- account/index.html | 1 + css/style.css | 9 +++++++++ js/accounts.js | 14 ++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/account/index.html b/account/index.html index d9c6d45..b087d06 100644 --- a/account/index.html +++ b/account/index.html @@ -52,6 +52,7 @@

Display Name

SFID: Username

+

Member

diff --git a/css/style.css b/css/style.css index b3e70f7..29fb899 100644 --- a/css/style.css +++ b/css/style.css @@ -283,6 +283,15 @@ code { margin: 0 16px; } +.access-level-base { + background-color: #047205; + border-style: solid; + border-color: #00a003; + border-radius: 8px; + border-width: 2px; + width: 90%; +} + .active { background-color: #a00b0b; border-color: #6d0606; diff --git a/js/accounts.js b/js/accounts.js index a2fcb5c..0d01209 100644 --- a/js/accounts.js +++ b/js/accounts.js @@ -1,3 +1,13 @@ +let userAccessLevels = { // Name | Text Colour | Background Colour | Border Colour + "-3": ["Banned", "#fff", "#2e2e2e", "#727272"], + "-2": ["Banned", "#fff", "#2e2e2e", "#727272"], + "-1": ["Banned", "#fff", "#2e2e2e", "#727272"], + "0": ["Member", "#fff", "#047205", "#00a003"], + "1": ["Tester", "#fff", "#0c98a2", "#01c9d7"], + "2": ["Moderator", "#000", "#00dc04", "#067708"], + "3": ["Admin", "#fff", "#920606", "#c80404"], +} + function loginError(message, code = null) { let errorStr; if (code) { @@ -82,6 +92,10 @@ function updateUserDataDisplay(data) { let miiLink = `https://mii.spfn.net/${data["pid"]}/main.png` document.getElementById("mii-img").src = miiLink; + + let level = userAccessLevels[data["account_level"]]; + document.getElementById("access-level").textContent = level[0]; + document.getElementById("access-level").style = `color: ${level[1]}; background-color: ${level[2]}; border-color: ${level[3]}`; } function logOut() {