Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Swap featured and hall of fame 🦀 #254

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions html/analyze.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ <h1 class="topMargin2">Level Data</h1>
let colorList = Object.keys(res.colors)

let portals = res.portals.split(", ").map(x => x.split(" "))
let coins = res.coins.split(", ").map(x => x.split(" "))

function commafy(num) { return (+num || 0).toString().replace(/(\d)(?=(\d\d\d)+$)/g, "$1,") }

Expand Down Expand Up @@ -196,6 +197,14 @@ <h1 class="topMargin2">Level Data</h1>
})
}

coins.forEach(x => {
if (!x || x[0] == "") {
$('#coinText').remove()
$('#coins').remove()
}
else $('#coins').append(`<div class="inline coinDiv"><img height="40%" src='../assets/${res.coinsVerified ? "silvercoin" : "browncoin"}.png'><h3>${x[1]}</h3></div>`)
})

triggerList.forEach(x => {
if (x == "total") $('#triggerText').text(`Triggers (${commafy(res.triggers[x])})`)
else $('#triggers').append(`<div class="inline triggerDiv"><img height="50%" src='../assets/objects/triggers/${x}.png'><h3 style="padding-top: 7%">x${commafy(res.triggers[x])}</h3></div>`)
Expand Down
6 changes: 3 additions & 3 deletions html/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ <h1 class="smaller" style="margin-bottom: 1%">Note</h1>
<td><a tabindex="1" href="./search/*?type=saved"><img class="menubutton menu-saved" src="../assets/category-saved.png" title="Saved Levels"></a></td>
<td><a tabindex="1" href="./daily"><img class="menubutton menu-daily" src="../assets/category-daily.png" title="Daily Level"></a></td>
<td style="display: block" id="menu_weekly"><a tabindex="1" href="./weekly"><img class="menubutton menu-weekly" src="../assets/category-weekly.png" title="Weekly Demon"></a></td>
<td style="display: none" id="menu_featured"><a tabindex="1" href="./search/*?type=featured"><img class="menubutton menu-featured" src="../assets/category-featured.png" title="Featured"></a></td>
<td style="display: none" id="menu_hof"><a tabindex="1" href="./search/*?type=hof"><img class="menubutton menu-hof" src="../assets/category-hof.png" title="Hall of Fame"></a></td>
<td><a tabindex="1" href="./gauntlets"><img class="menubutton menu-gauntlets" src="../assets/category-gauntlets.png" title="Gauntlets"></a></td>
</tr>
<tr class="menuButtonList">
<td><a tabindex="1" href="./leaderboard"><img class="menubutton menu-leaderboard" src="../assets/category-scores.png" title="Scores"></a></td>
<!-- <img src="./assets/exclamation.png" style="position: absolute; height: 18%; left: 3.5%; bottom: 23%; pointer-events: none; z-index: 50;"> -->
<td><a tabindex="1" href="./search/*?type=hof"><img class="menubutton menu-hof" src="../assets/category-hof.png" title="Hall Of Fame"></a></td>
<td><a tabindex="1" href="./search/*?type=featured"><img class="menubutton menu-featured" src="../assets/category-featured.png" title="Featured"></a></td>
<td><a tabindex="1" href="./mappacks"><img class="menubutton menu-mappacks" src="../assets/category-packs.png" title="Map Packs"></a></td>
<td><a tabindex="1" href="./search"><img class="menubutton menu-search" src="../assets/category-search.png" title="Search"></a></td>
</tr>
Expand All @@ -77,7 +77,7 @@ <h1 class="smaller" style="margin-bottom: 1%">Note</h1>
</div>

<div style="position:absolute; bottom: 17%; right: 7%; width: 9%; text-align: right; pointer-events: none">
<img src="../assets/privateservers.png" width=85%;">
<img src="../assets/privateservers.png" width=85%;>
</div>

<div style="position:absolute; bottom: 2.5%; right: 1.5%; text-align: right; width: 18%;">
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ app.get("/", function(req, res) {
html = html.replace('id="dl" style="display: none', 'style="display: block')
.replace('No active <span id="noLevel">daily</span> level!', '[Blocked by RobTop]')
}
if (html.includes('menuDisabled" src="../assets/category-weekly')) { // if weekly disabled, replace with featured
if (html.includes('menuDisabled" src="../assets/category-weekly')) { // if weekly disabled, replace with hall of fame
html = html.replace('block" id="menu_weekly', 'none" id="menu_weekly')
.replace('none" id="menu_featured', 'block" id="menu_featured')
.replace('none" id="menu_hof', 'block" id="menu_hof')
}
return res.status(200).send(html)
})
Expand Down