Finally fixed the gross font!!!
It doesn't look terrible anymore!!!
This commit is contained in:
parent
dad81cf3be
commit
597589cbbc
10 changed files with 67 additions and 48 deletions
|
@ -4,12 +4,16 @@ const Level = require('../classes/Level.js')
|
|||
|
||||
module.exports = async (app, req, res, api, ID, analyze) => {
|
||||
|
||||
if (req.offline) {
|
||||
if (!api && levelID < 0) return res.redirect('/')
|
||||
function rejectLevel() {
|
||||
if (!api) return res.redirect('search/' + req.params.id)
|
||||
else return res.send("-1")
|
||||
}
|
||||
|
||||
if (req.offline) {
|
||||
if (!api && levelID < 0) return res.redirect('/')
|
||||
rejectLevel()
|
||||
}
|
||||
|
||||
let levelID = ID || req.params.id
|
||||
if (levelID == "daily") levelID = -1
|
||||
else if (levelID == "weekly") levelID = -2
|
||||
|
@ -20,14 +24,14 @@ module.exports = async (app, req, res, api, ID, analyze) => {
|
|||
if (err || !body || body == '-1' || body.startsWith("<")) {
|
||||
if (analyze && api && req.server.downloadsDisabled) return res.send("-3")
|
||||
else if (!api && levelID < 0) return res.redirect(`/?daily=${levelID * -1}`)
|
||||
else if (!api) return res.redirect('search/' + req.params.id)
|
||||
else return res.send("-1")
|
||||
else rejectLevel()
|
||||
}
|
||||
|
||||
let authorData = body.split("#")[3] // daily/weekly only, most likely
|
||||
|
||||
let levelInfo = app.parseResponse(body)
|
||||
let level = new Level(levelInfo, req.server, true)
|
||||
if (!level.id) return rejectLevel()
|
||||
|
||||
let foundID = app.accountCache[req.id][Object.keys(app.accountCache[req.id]).find(x => app.accountCache[req.id][x][1] == level.playerID)]
|
||||
if (foundID) foundID = foundID.filter(x => x != level.playerID)
|
||||
|
|
15
api/level.js
15
api/level.js
|
@ -4,28 +4,24 @@ const Level = require('../classes/Level.js')
|
|||
|
||||
module.exports = async (app, req, res, api, analyze) => {
|
||||
|
||||
if (req.offline) {
|
||||
function rejectLevel() {
|
||||
if (!api) return res.redirect('search/' + req.params.id)
|
||||
else return res.send("-1")
|
||||
}
|
||||
|
||||
if (req.offline) return rejectLevel()
|
||||
|
||||
let levelID = req.params.id
|
||||
if (levelID == "daily") return app.run.download(app, req, res, api, 'daily', analyze)
|
||||
else if (levelID == "weekly") return app.run.download(app, req, res, api, 'weekly', analyze)
|
||||
else if (levelID.match(/[^0-9]/)) {
|
||||
if (!api) return res.redirect('search/' + req.params.id)
|
||||
else return res.send("-1")
|
||||
}
|
||||
else if (levelID.match(/[^0-9]/)) return rejectLevel()
|
||||
else levelID = levelID.replace(/[^0-9]/g, "")
|
||||
|
||||
if (analyze || req.query.hasOwnProperty("download")) return app.run.download(app, req, res, api, levelID, analyze)
|
||||
|
||||
req.gdRequest('getGJLevels21', { str: levelID, type: 0 }, function (err, resp, body) {
|
||||
|
||||
if (err || !body || body == '-1' || body.startsWith("<") || body.startsWith("##")) {
|
||||
if (!api) return res.redirect('search/' + req.params.id)
|
||||
else return res.send("-1")
|
||||
}
|
||||
if (err || !body || body == '-1' || body.startsWith("<") || body.startsWith("##")) return rejectLevel()
|
||||
|
||||
let preRes = body.split('#')[0].split('|', 10)
|
||||
let author = body.split('#')[1].split('|')[0].split(':')
|
||||
|
@ -34,6 +30,7 @@ module.exports = async (app, req, res, api, analyze) => {
|
|||
|
||||
let levelInfo = app.parseResponse(preRes.find(x => x.startsWith(`1:${levelID}`)) || preRes[0])
|
||||
let level = new Level(levelInfo, req.server, false, author).getSongInfo(song)
|
||||
if (!level.id) return rejectLevel()
|
||||
|
||||
if (req.isGDPS) level.gdps = (req.onePointNine ? "1.9/" : "") + req.endpoint
|
||||
if (level.author != "-") app.userCache(req.id, level.accountID, level.playerID, level.author)
|
||||
|
|
|
@ -117,6 +117,7 @@ module.exports = async (app, req, res) => {
|
|||
let songSearch = songs.find(y => y['~1'] == x[35]) || []
|
||||
|
||||
let level = new Level(x, req.server).getSongInfo(songSearch)
|
||||
if (!level.id) return
|
||||
level.author = authorList[x[6]] ? authorList[x[6]][0] : "-";
|
||||
level.accountID = authorList[x[6]] ? authorList[x[6]][1] : "0";
|
||||
|
||||
|
|
BIN
assets/achievements/shardBonus.png
Normal file
BIN
assets/achievements/shardBonus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
|
@ -78,11 +78,22 @@ img, .noSelect {
|
|||
|
||||
.smaller {
|
||||
font-size: 5vh;
|
||||
text-shadow: -0.2vh -0.2vh 0vh #000, 0.2vh -0.2vh 0vh #000, -0.2vh 0.2vh 0vh #000, 0.2vh 0.2vh 0vh #000, 0.3vh 0.4vh 0vh rgba(0,0,0,0.4);
|
||||
-webkit-text-stroke-width: 0.20vh;
|
||||
-webkit-text-stroke-color: black;
|
||||
text-shadow: 0.35vh 0.35vh 0vh rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.slightlySmaller {
|
||||
font-size: 6vh;
|
||||
-webkit-text-stroke-width: 0.25vh;
|
||||
-webkit-text-stroke-color: black;
|
||||
text-shadow: 0.35vh 0.35vh 0vh rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.biggerShadow {
|
||||
-webkit-text-stroke-width: 0.3vh;
|
||||
-webkit-text-stroke-color: black;
|
||||
text-shadow: 0.5vh 0.5vh 0vh rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.bigger {
|
||||
|
@ -154,43 +165,47 @@ p {
|
|||
word-break: break-word;
|
||||
}
|
||||
|
||||
h1 {
|
||||
h1, h2, h3 {
|
||||
font-family: Pusab, Arial;
|
||||
font-weight: normal;
|
||||
margin: 0% 0%;
|
||||
font-size: 6vh;
|
||||
font-family: Pusab, Arial;
|
||||
letter-spacing: -0.01em;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: white;
|
||||
letter-spacing: 0.02em;
|
||||
font-size: 6vh;
|
||||
line-height: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-shadow: -0.275vh -0.275vh 0vh #000, 0.275vh -0.275vh 0vh #000, -0.275vh 0.275vh 0vh #000, 0.275vh 0.275vh 0vh #000, 0.5vh 0.6vh 0vh rgba(0,0,0,0.4);
|
||||
-webkit-text-size-adjust: 100%;
|
||||
line-height: 100%;
|
||||
-webkit-text-stroke-width: 0.25vh;
|
||||
-webkit-text-stroke-color: black;
|
||||
text-shadow: 0.375vh 0.375vh 0vh rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-weight: normal;
|
||||
margin: 0 0;
|
||||
font-size: 8vh;
|
||||
font-family: Pusab, Arial;
|
||||
color: rgb(255, 200, 0);
|
||||
letter-spacing: 0.02em;
|
||||
text-shadow: -0.275vh -0.275vh 0vh #000, 0.275vh -0.275vh 0vh #000, -0.275vh 0.275vh 0vh #000, 0.275vh 0.275vh 0vh #000, 0.5vh 0.5vh 0vh rgba(0,0,0,0.4);
|
||||
font-size: 8vh;
|
||||
-webkit-text-stroke-width: 0.265vh;
|
||||
-webkit-text-stroke-color: black;
|
||||
text-shadow: 0.35vh 0.35vh 0.1vh rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
h3, input[type=text], input[type=password], input[type=number], .h3Size {
|
||||
font-weight: normal;
|
||||
margin: 0 0;
|
||||
font-size: 3.5vh;
|
||||
font-family: Pusab, Arial;
|
||||
color: white;
|
||||
letter-spacing: 0.02em;
|
||||
text-shadow: -0.15vh -0.15vh 0vh #000, 0.15vh -0.15vh 0vh #000, -0.15vh 0.15vh 0vh #000, 0.15vh 0.15vh 0vh #000;
|
||||
-webkit-text-stroke-width: 0.14vh;
|
||||
-webkit-text-stroke-color: black;
|
||||
text-shadow: 0.2vh 0.2vh 0.02vh rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
-webkit-text-stroke-width: inherit;
|
||||
-webkit-text-stroke-color: inherit;
|
||||
text-shadow: inherit;
|
||||
}
|
||||
|
||||
hr {
|
||||
|
@ -207,6 +222,7 @@ input[type=text], input[type=password], input[type=number] {
|
|||
margin-top: 1%;
|
||||
width: 65%;
|
||||
font-size: 5vh;
|
||||
font-family: Pusab, Arial;
|
||||
}
|
||||
|
||||
input[type=checkbox], .changeDaWorld {
|
||||
|
@ -443,8 +459,9 @@ input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
|
|||
|
||||
#filterStuff div h1, .smallerer {
|
||||
font-size: 4vh;
|
||||
text-shadow: -0.2vh -0.2vh 0vh #000, 0.2vh -0.2vh 0vh #000, -0.2vh 0.2vh 0vh #000, 0.2vh 0.2vh 0vh #000, 0.3vh 0.4vh 0vh rgba(0,0,0,0.4);
|
||||
}
|
||||
-webkit-text-stroke-width: 0.18vh;
|
||||
-webkit-text-stroke-color: black;
|
||||
text-shadow: 0.3vh 0.3vh 0vh rgba(0, 0, 0, 0.3);}
|
||||
|
||||
.sideButton {
|
||||
margin-bottom: 30%;
|
||||
|
@ -665,7 +682,6 @@ input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
|
|||
text-align: left;
|
||||
padding-top: 1.5vh;
|
||||
padding-left: 1.5vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.compact {
|
||||
|
@ -679,8 +695,9 @@ input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
|
|||
width: fit-content;
|
||||
vertical-align: top;
|
||||
font-size: 3.7vh;
|
||||
text-shadow: -0.15vh -0.15vh 0vh #000, 0.15vh -0.15vh 0vh #000, -0.15vh 0.15vh 0vh #000, 0.15vh 0.15vh 0vh #000, 0.3vh 0.3vh 0vh rgba(0,0,0,0.4);
|
||||
}
|
||||
-webkit-text-stroke-width: 0.14vh;
|
||||
-webkit-text-stroke-color: black;
|
||||
text-shadow: 0.2vh 0.2vh 0.02vh rgba(0, 0, 0, 0.3);}
|
||||
|
||||
.commentText {
|
||||
margin-top: 1.6vh;
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 249 KiB After Width: | Height: | Size: 160 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 48 KiB |
|
@ -8,12 +8,11 @@ let demonTypes = { 3: "Easy", 4: "Medium", 5: "Insane", 6: "Extreme" }
|
|||
|
||||
class Level {
|
||||
constructor(levelInfo, server, download, author = []) {
|
||||
if (!levelInfo[1]) return;
|
||||
this.name = levelInfo[2];
|
||||
this.id = levelInfo[1];
|
||||
this.name = levelInfo[2] || "-";
|
||||
this.id = levelInfo[1] || 0;
|
||||
this.description = Buffer.from((levelInfo[3] || ""), "base64").toString() || "(No description provided)";
|
||||
this.author = author[1] || "-"
|
||||
this.playerID = levelInfo[6]
|
||||
this.playerID = levelInfo[6] || 0
|
||||
this.accountID = author[2] || 0
|
||||
this.difficulty = difficulty[levelInfo[9]] || "Unrated"
|
||||
this.downloads = +levelInfo[10] || 0
|
||||
|
@ -22,20 +21,21 @@ class Level {
|
|||
this.length = length[levelInfo[15]] || "XL"
|
||||
this.stars = +levelInfo[18] || 0
|
||||
this.orbs = orbs[levelInfo[18]] || 0
|
||||
this.diamonds = levelInfo[18] < 2 ? 0 : parseInt(levelInfo[18]) + 2
|
||||
this.diamonds = !levelInfo[18] || (levelInfo[18]) < 2 ? 0 : parseInt(levelInfo[18]) + 2
|
||||
this.featured = levelInfo[19] > 0
|
||||
this.epic = levelInfo[42] > 0
|
||||
this.gameVersion = levelInfo[13] > 17 ? (levelInfo[13] / 10).toFixed(1) : levelInfo[13] == 11 ? "1.8" : levelInfo[13] == 10 ? "1.7" : "Pre-1.7"
|
||||
if (levelInfo[28]) this.uploaded = levelInfo[28] + (server.timestampSuffix || "")
|
||||
if (levelInfo[29]) this.updated = levelInfo[29] + (server.timestampSuffix || "")
|
||||
if (download) { this.editorTime = +levelInfo[46] || 0; this.totalEditorTime = +levelInfo[47] || 0 }
|
||||
if (levelInfo[46]) this.editorTime = +levelInfo[46] || 0
|
||||
if (levelInfo[47]) this.totalEditorTime = +levelInfo[47] || 0
|
||||
if (levelInfo[27]) this.password = levelInfo[27];
|
||||
this.version = +levelInfo[5];
|
||||
this.version = +levelInfo[5] || 0;
|
||||
this.copiedID = levelInfo[30] || "0"
|
||||
this.twoPlayer = levelInfo[31] > 0
|
||||
this.officialSong = +levelInfo[35] ? 0 : parseInt(levelInfo[12]) + 1
|
||||
this.customSong = +levelInfo[35] || 0
|
||||
this.coins = +levelInfo[37]
|
||||
this.coins = +levelInfo[37] || 0
|
||||
this.verifiedCoins = levelInfo[38] > 0
|
||||
this.starsRequested = +levelInfo[39] || 0
|
||||
this.ldm = levelInfo[40] > 0
|
||||
|
|
|
@ -113,7 +113,7 @@ function append(reset=true) {
|
|||
$('#searchBox').append(`<div class="flex searchresult leaderboardSlot" style="height: 18%; width: 92%; padding-left: 3%; padding-top: 0%; overflow: hidden">
|
||||
<div class="flex" style="width: 8%; margin-right: 2%"><img src="${iconImg}></div>
|
||||
<div>
|
||||
<h2 title="${x.trueID}" smaller inline" style="font-size: 4.5vh; margin-top: 1vh; color: rgb(${gameColors[x.game]})">${x.name}</h2>
|
||||
<h2 title="${x.trueID}" class="smallerer" style="font-size: 4.5vh; margin-top: 1vh; color: rgb(${gameColors[x.game]})">${x.name}</h2>
|
||||
<p style="margin-top: 2vh; color:${completed ? "yellow" : "white"}">${completed ? x.achievedDescription : x.description}</p>
|
||||
</div>
|
||||
</div>`)
|
||||
|
|
|
@ -136,8 +136,8 @@ Fetch(`./api/credits`).then(res => {
|
|||
$('#credits').append(`<div id="credits${y+1}" class="subCredits" style="display: none;">
|
||||
<img class="gdButton" src="../assets/arrow-left.png" width="60vh" style="${y == 0 ? "display: none; " : ""}position: absolute; top: 45%; right: 75%" tabindex="0" onclick="page -= 1; loadCredits()">
|
||||
<div class="brownBox center supercenter" style="width: 80vh; height: 43%; padding-top: 1.5%; padding-bottom: 3.5%;">
|
||||
<h1>${x.header}</h1><br>
|
||||
<h2 style="margin-bottom: 1.5%" class="gdButton"><a href="https://gdbrowser.com/u/${x.ign || x.name}">${x.name}</h2></a>
|
||||
<h1>${x.header}</h1>
|
||||
<h2 style="margin-bottom: 1.5%; margin-top: 1.5%" class="gdButton biggerShadow"><a href="https://gdbrowser.com/u/${x.ign || x.name}">${x.name}</h2></a>
|
||||
<img class="creditsicon" icon="./icon/${x.ign || x.name}?forceGD=1" height=30%; style="margin-bottom: 7%"><br>
|
||||
<a target=_blank href="${x.youtube[0]}"><img src="../assets/${x.youtube[1]}.png" width="11%" class="gdButton"></a>
|
||||
<a target=_blank href="${x.twitter[0]}"><img src="../assets/${x.twitter[1]}.png" width="11%" class="sideSpace gdButton"></a>
|
||||
|
|
Loading…
Reference in a new issue