diff --git a/api/icon.js b/api/icon.js index 045821a..41db63b 100644 --- a/api/icon.js +++ b/api/icon.js @@ -4,36 +4,8 @@ const fs = require('fs'); const path = require('path'); const icons = require('../icons/gameSheet.json'); const colors = require('../misc/colors.json'); -const queryMapper = { - ship: { - form: 'ship', - ind: 22 - }, - ball: { - form: 'player_ball', - ind: 23 - }, - ufo: { - form: 'bird', - ind: 24 - }, - wave: { - form: 'dart', - ind: 25 - }, - robot: { - form: 'robot', - ind: 26 - }, - spider: { - form: 'spider', - ind: 43 - }, - cursed: { - form: 'spider', - ind: 43 - } -} +const forms = require('../icons/forms.json') + function recolor(img, col) { return img.scan(0, 0, img.bitmap.width, img.bitmap.height, function (x, y, idx) { if (img.bitmap.data.slice(idx, idx+3).every(function(val) {return val >= 20 && val <= 255})) { // If it's not "black, i.e. we want to recolor it" @@ -54,6 +26,7 @@ function fromIcons(filename) { return `./icons/${filename}`; } let cache = {}; + module.exports = async (app, req, res) => { let username = req.params.text @@ -83,7 +56,7 @@ module.exports = async (app, req, res) => { account[response2[i]] = response2[i + 1] } - let { form, ind } = queryMapper[req.query.form] || {}; + let { form, ind } = forms[req.query.form] || {}; form = form || 'player'; ind = ind || 21; diff --git a/assets/css/level.css b/assets/css/level.css index 4c8df64..6815977 100644 --- a/assets/css/level.css +++ b/assets/css/level.css @@ -619,6 +619,18 @@ input::-webkit-inner-spin-button { height: 5.5%; } +.githubChad { + display: inline-block; + width: 30%; + height: 20%; + margin: 1% 0%; +} + +.githubChad h2 { + margin-bottom: 3%; + font-size: 4vh; +} + .analysis { height: 20%; width: 90%; diff --git a/servers.code-workspace b/browser.code-workspace similarity index 100% rename from servers.code-workspace rename to browser.code-workspace diff --git a/html/filters.html b/html/filters.html index f0bc200..ebfd25e 100644 --- a/html/filters.html +++ b/html/filters.html @@ -150,7 +150,7 @@ $('.levelSearch').click(function() { if (url.endsWith('?type=0')) url = url.slice(0, -7) - window.location.href = url + window.location.href = url.replace(/\?type=0&/, "?") }) diff --git a/html/home.html b/html/home.html index c30418b..ae0e519 100644 --- a/html/home.html +++ b/html/home.html @@ -16,121 +16,6 @@
@@ -197,6 +82,44 @@ function loadCredits() { $('#credits').show() } +fetch(`./api/credits`).then(res => res.json()).then(res => { + + res.credits.forEach((x, y) => { + $('#credits').append(``) + }) + + $('#credits').append(``) + + res.contributors.forEach((x, y) => { + $('#githubbers').append(`
+

${x[0]}

+
+
`) + }) + + $('#credits').append(`
+
`) + +}) + $(document).keydown(function(k) { if ($('#credits').is(':hidden')) return diff --git a/icons/forms.json b/icons/forms.json new file mode 100644 index 0000000..a0145e4 --- /dev/null +++ b/icons/forms.json @@ -0,0 +1,30 @@ +{ + "ship": { + "form": "ship", + "ind": 22 + }, + "ball": { + "form": "player_ball", + "ind": 23 + }, + "ufo": { + "form": "bird", + "ind": 24 + }, + "wave": { + "form": "dart", + "ind": 25 + }, + "robot": { + "form": "robot", + "ind": 26 + }, + "spider": { + "form": "spider", + "ind": 43 + }, + "cursed": { + "form": "spider", + "ind": 43 + } +} \ No newline at end of file diff --git a/index.js b/index.js index 9c77c02..efb16cb 100644 --- a/index.js +++ b/index.js @@ -128,6 +128,10 @@ app.get("/api/mappacks", async function(req, res) { res.send(require('./misc/mapPacks.json')) }) +app.get("/api/credits", function(req, res) { + res.send(require('./misc/credits.json')) +}) + app.get("/iconkit", function(req, res) { res.sendFile(__dirname + "/html/iconkit.html") }) diff --git a/misc/credits.json b/misc/credits.json new file mode 100644 index 0000000..f3eac01 --- /dev/null +++ b/misc/credits.json @@ -0,0 +1,72 @@ +{ + "credits": [ + { + "header": "Programming/Website", + "name": "Colon", + "youtube": ["https://youtube.com/channel/UCFDsxSlQXpLLpVScy2NmbcQ", "youtube"], + "twitter": ["https://twitter.com/TheRealGDColon", "twitter"], + "github": ["https://github.com/GDColon", "github"] + }, + + + { + "header": "Level Analyzing Help", + "name": "Alten", + "youtube": ["https://youtube.com/channel/UC9M8hLqh2yZIPSDvpyL7o8g", "youtube"], + "twitter": ["https://twitter.com/gd_alten", "twitter"], + "github": ["https://github.com/Altenhh", "github"] + }, + + { + "header": "Level Analyzing Help", + "name": "AlFas", + "youtube": ["https://youtube.com/user/Alex100077", "youtube"], + "twitter": ["https://twitter.com/AlFas6237", "twitter"], + "github": ["https://github.com/AlFasGD", "github"] + }, + + { + "header": "Accurate Leaderboard", + "name": "SMJSGaming", + "youtube": ["https://youtube.com/channel/UCwEsWDs9kGN2vvoiNTJKdaQ", "youtube"], + "twitter": ["https://instagram.com/smjs_gaming", "twitter"], + "github": ["https://github.com/SMJSGaming", "github"] + }, + + { + "header": "API Help", + "name": "Alex1304", + "youtube": ["https://youtube.com/channel/UC0hFAVN-GAbZYuf_Hfk1Iog", "youtube"], + "twitter": ["https://twitter.com/gd_alex1304", "twitter"], + "github": ["https://github.com/Alex1304", "github"] + }, + + { + "header": "Web Design Help", + "name": "Ucrash", + "youtube": ["https://youtube.com/channel/UCfPgDZBhCodHIFo6OOVcH2A", "youtube"], + "twitter": ["https://twitter.com/GDUcrash", "twitter"], + "github": ["https://github.com/GDUcrash", "github"] + }, + + { + "header": "Demon List API", + "name": "stardust1971", + "youtube": ["https://youtube.com/user/stardust19710", "youtube"], + "twitter": ["https://twitter.com/stadust1971", "twitter"], + "github": ["https://pointercrate.com", "demonButton"] + }, + { + "header": "Everything Else", + "name": "RobTop", + "youtube": ["https://youtube.com/channel/UCz_yk8mDSAnxJq0ar66L4sw", "youtube"], + "twitter": ["https://twitter.com/RobTopGames", "twitter"], + "github": ["https://www.facebook.com/geometrydash", "facebook"] + } + ], + + "contributors": [ + ["101arrowz", "genius991"], + ["Qufyy", "qufy"] + ] +} \ No newline at end of file