Integrated Demon List!
This commit is contained in:
parent
4f1590b344
commit
de076fe990
5 changed files with 36 additions and 2 deletions
17
api/level.js
17
api/level.js
|
@ -91,6 +91,8 @@ module.exports = async (app, req, res, api, analyze) => {
|
|||
level.songID = "Level " + [parseInt(levelInfo[12]) + 1]
|
||||
}
|
||||
|
||||
function sendLevel() {
|
||||
|
||||
if (api) return res.send(level)
|
||||
|
||||
else return fs.readFile('./html/level.html', 'utf8', function(err, data) {
|
||||
|
@ -101,7 +103,20 @@ module.exports = async (app, req, res, api, analyze) => {
|
|||
html = html.replace(regex, app.clean(level[x]))
|
||||
})
|
||||
return res.send(html)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
//demon list stuff
|
||||
if (level.difficulty == "Extreme Demon") {
|
||||
request.get('https://www.pointercrate.com/api/v1/demons/', async function(err, resp, demonList) {
|
||||
let demons = JSON.parse(demonList)
|
||||
let foundDemon = demons.find(x => x.name.trim().toLowerCase() == level.name.trim().toLowerCase())
|
||||
if (foundDemon) level.demonList = foundDemon.position
|
||||
return sendLevel()
|
||||
})
|
||||
}
|
||||
|
||||
else return sendLevel()
|
||||
|
||||
})
|
||||
}
|
BIN
assets/Pusab.ttf
BIN
assets/Pusab.ttf
Binary file not shown.
BIN
assets/demonButton.png
Normal file
BIN
assets/demonButton.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -101,6 +101,20 @@
|
|||
</div>
|
||||
|
||||
<div id="credits7" class="subCredits" style="display: none;">
|
||||
<div class="brownBox center supercenter" style="width: 80vh; height: 43%; padding-top: 1.5%; padding-bottom: 3.5%;">
|
||||
<h1>Demon List API</h1><br>
|
||||
<h2 style="margin-bottom: 1.5%" class="gdButton"><a href="./profile/stardust1971">stardust1971</h2></a>
|
||||
<img src="./icon/stardust1971" height=30%; style="margin-bottom: 7%"><br>
|
||||
<a target=_blank href="https://www.youtube.com/user/stardust19710"><img src="../assets/youtube.png" width="11%" class="gdButton"></a>
|
||||
<a target=_blank href="https://twitter.com/stadust1971"><img src="../assets/twitter.png" width="11%" class="sideSpace gdButton"></a>
|
||||
<a target=_blank href="https://pointercrate.com/"><img src="../assets/demonButton.png" width="11%" class="sideSpace gdButton"></a>
|
||||
<br>
|
||||
</div>
|
||||
<img class="gdButton" id="creditPageUp" src="../assets/arrow-right.png" width="60vh" style="position: absolute; top: 45%; left: 75%" onclick="page += 1; loadCredits()">
|
||||
<img class="gdButton" id="creditPageUp" src="../assets/arrow-left.png" width="60vh" style="position: absolute; top: 45%; right: 75%" onclick="page -= 1; loadCredits()">
|
||||
</div>
|
||||
|
||||
<div id="credits8" class="subCredits" style="display: none;">
|
||||
<div class="brownBox center supercenter" style="width: 80vh; height: 43%; padding-top: 1.5%; padding-bottom: 3.5%;">
|
||||
<h1>Everything Else</h1><br>
|
||||
<h2 style="margin-bottom: 1.5%" class="gdButton"><a href="./profile/robtop">RobTop</h2></a>
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
<h1 class="smaller" id="difficultytext" style="transform:scale(0.9);">[[DIFFICULTY]]</h1>
|
||||
<h1 class="smaller inline stars" style="transform:scale(0.9)">[[STARS]]</h1> <img class="inline stars" src="../assets/star.png" height=4%; style="transform:translateY(-12%)"><br class="stars">
|
||||
<h1 class="smaller inline diamonds" style="transform:scale(0.9)">[[DIAMONDS]]</h1> <img class="inline diamonds" src="../assets/diamond.png" height=4%; style="transform:translateY(-12%)">
|
||||
<h1 class="smaller inline demonList" style="transform:scale(0.9); display: none;">#[[DEMONLIST]]</h1> <img class="inline demonList" src="../assets/demon.png" height=4.5%; style="transform:translateY(-7%); display: none; margin-left: 1.5%">
|
||||
<div id="coins" style="margin-top: 3%"></div>
|
||||
</div>
|
||||
|
||||
|
@ -178,7 +179,11 @@ if ([[COPIEDID]] == 0) $('#copiedBadge').hide()
|
|||
if (![[LARGE]]) $('#largeBadge').hide()
|
||||
if ([[ORBS]] == 0) $('.orbs').hide()
|
||||
if ([[STARS]] == 0) $('.stars').hide()
|
||||
if ([[DIAMONDS]] == 0) $('.diamonds').hide()
|
||||
if ([[DIAMONDS]] == 0 || !'[[DEMONLIST]]'.startsWith("[")) $('.diamonds').hide()
|
||||
|
||||
if (!'[[DEMONLIST]]'.startsWith("[")) $('.demonList').show()
|
||||
else $('.demonList').remove()
|
||||
|
||||
|
||||
if ("[[SONGID]]".startsWith("Level")) {
|
||||
$('#songInfo').text('[[SONGID]]')
|
||||
|
|
Loading…
Reference in a new issue