diff --git a/assets/javascript/index.js b/assets/javascript/index.js index fca6fb6..fece60f 100644 --- a/assets/javascript/index.js +++ b/assets/javascript/index.js @@ -1,7 +1,12 @@ +const url = new URL(window.location.toLocaleString()); +const sectionList = document.getElementsByClassName("section"); + const nnRuler = "cool_tellow"; const nnCoRuler = "ColoradoCrusade"; const electionDate = "2025-6-30"; +const memberList = ["Omtegu", "pupik923", "cool_tellow", "JoeTheDauntless", "black_frieza", "Jinx64_", "eldiego", "Gero06", "Spencer1019", "mrcreeperg4", "TiredToonz", "idan1503", "Wormzy333", "ColoradoCrusade", "spenten", "Geogaddiiii", "Austcd30", "MyNameIsRasheed", "MrSteam84", "TwoGoodFiveme", "ara2009", "Ransterr", "ItzFriez6312", "ArzoAblaze", "jssjsjjssj", "toiletteeth", "B8arn", "FredDerp", "Georgequank", "hunterg2i", "KarmaIsDepressed", "Mini", "ChilliChillt", "ServerLite", "proper_cat", "Master__Kief", "ItzBiblcle", "MrAss_asd", "Burningskull562", "se2p", "mindlord", "ItIsYeFish", "pivozavr2004", "latcyy", "LuckKir", "oggghrkwneh", "MiHoub", "David", "lkarch", "MegaByteX", "ScaryCowCow4", "Glanthrial", "Deskfan45", "nielubiecie321", "BoomFox_Official", "DrDews", "DrNubXP", "hagluciak19", "SavageUser", "Fireballiceball", "JakeRedstone", "kaiookk1", "My_ChairSlipped", "j63k", "jurckurc", "workingontrying", "KevinDurantgoat", "Creeperpaste", "Islando_Commando", "Migzotic", "Teasoup", "F8fnir", "JorgenMister", "isnikoda", "TrustedHawk1855", "Revivey", "BleonIlazi", "AgentTammy", "Losangelesquest", "jeorm", "CrafterSteve98", "ilikemacandcheez", "NotRawZach", "herrydicc", "Hendway", "Pugino", "TeeDoesStuff", "TomAndBon", "SJET_Inc", "Urogalo", "arrochista", "JakePaulcraft", "WetBed43", "grammarissue", "pappoy76", "BurgerMan_27", "ilhanerdem2015", "BashurverseMC", "Batteryacids", "freddyw", "Acid0verl0ad", "CerealBoiz", "Q_QIndustries", "minerkat2011", "Capital3", "Assult_penguin", "NexSol", "DrWild", "nnnnn", "Jerry_juju", "hanxing", "Juasonxd", "Mikey_herobrine", "FluffyFoxFae", "Karmatical0", "ItsMxt", "Yen45", "Olat", "FredMCGamer", "capitanatomico", "DanielRobert15", "Hefeng_Song", "Leozero_", "MyGmail", "SkyNotBlue", "eldiegoat", "huntermkk", "ItsVollx", "sonictank1", "Miyazaki", "Beanzo0", "VolxyzMC", "tvoreal", "sushi_king86", "KAMILE33", "pascal_machet", "barton1357TF2", "Yungyoungin1", "kleeorg", "SnailRibs", "yourstruly71", "Csorroflegma", "ahhhhhhhh1587", "Lofeee", "mmakart", "adebuilder", "Jetteriter", "mud4dum", "Jesper2011", "GREENAPPLE", "guinea_pig_doody", "CreeperX200", "AudemusJura", "cutekttn", "bartur4", "Feruxia", "Kurzov", "MONKEYMAN346776", "breadcool", "Zaku1626", "keyboardan", "tetunnel", "ItTommy22Toad", "FulgencioBatista", "inoxisane", "q0iat", "Levinder", "aidenjamesmcl"]; + function getCookie(cookieName) { var name = cookieName + "="; var decodedCookie = decodeURIComponent(document.cookie); @@ -27,10 +32,9 @@ function calculateCountdown(endingDate) { } function switchSection(sectionName, button) { - var i, section, navButton; - section = document.getElementsByClassName("section"); - for (i = 0; i < section.length; i++) { - section[i].style.display = "none"; + var i, navButton; + for (i = 0; i < sectionList.length; i++) { + sectionList[i].style.display = "none"; } navButton = document.getElementsByClassName("navButton"); @@ -48,7 +52,7 @@ function switchSection(sectionName, button) { button.style.color = "black"; } -function onPageLoad() { +function loadRulersAndElectionCountdown() { console.log(nnRuler); document.getElementById("ruler").innerText = nnRuler; document.getElementById("rulerImage").src = "https://minotar.net/armor/body/" + nnRuler + "/100.png"; @@ -65,11 +69,29 @@ function onPageLoad() { } else { document.getElementById("electionCountdown").innerText = "The next election is in " + Math.ceil(calculateCountdown(electionDate)) + " days!"; } +} - console.log(document.cookie); - if (getCookie("section") === "") { - document.getElementById("electionButton").click(); +function loadMemberList() { + for (let member = 0; member < memberList.length; member++) { + const memberListItem = document.createElement("p"); + memberListItem.innerHTML = memberList[member]; + + document.getElementById("memberList").appendChild(memberListItem); + } +} + +function onPageLoad() { + loadRulersAndElectionCountdown() + loadMemberList() + + if (url.searchParams.has("section")) { + console.log("URL parameter found, forcing section to " + url.searchParams.get("section") + "."); + document.getElementById(url.searchParams.get("section") + "Button").click(); + } else if (getCookie("section") === "") { + console.log("A wild user appears! Defaulting to first section, \"" + sectionList[0].id + "\".") + document.getElementById(sectionList[0].id + "Button").click(); } else { + console.log("Section cookie found, restoring section to \"" + getCookie("section") + "\"."); document.getElementById(getCookie("section") + "Button").click(); } } diff --git a/assets/stylesheets/index.css b/assets/stylesheets/index.css index 254c1df..d4c4269 100644 --- a/assets/stylesheets/index.css +++ b/assets/stylesheets/index.css @@ -1,9 +1,3 @@ -@media(max-width:1400px) { - .navButton { - - } -} - @font-face { font-family: 'minecraft'; src: url('/assets/fonts/MinecraftRegular.otf') format('opentype'); @@ -40,9 +34,6 @@ body { overflow-x: hidden; } - - - .card { margin: auto; border-left: 6px solid #eee; @@ -51,7 +42,6 @@ body { margin-bottom: 20px; box-shadow: 2px 2px 8px rgba(0,0,0,0.1); width: 370px; - height: 322px; } .card p { @@ -65,6 +55,7 @@ body { #cardContainer { padding-top: 20px; + width: 100%; } #splash { @@ -93,6 +84,7 @@ body { #navbar { position: fixed; width: 100%; + background-color: black; } .navButton { @@ -101,8 +93,7 @@ body { border: none; border-top: 3px solid black; cursor: pointer; - font-size: 2.4vw; - width: 20%; + font-size: 2vw; background-color: black; color: white; } diff --git a/index.html b/index.html index 3b8ecf6..8b4066f 100755 --- a/index.html +++ b/index.html @@ -12,23 +12,24 @@ -
-

placeholder

+
+

Info

-
+

Ruler


Steve

Player Render
-
+

Co-Ruler


Steve

Player Render @@ -40,14 +41,21 @@

Election Countdown

-
-

placeholder

+
+

Constitution

-
-

placeholder

+
+
+
+

Member List


+
+
-
-

placeholder

+
+

News Notice

+
+
+

History