diff --git a/package-lock.json b/package-lock.json index 4c28b25..bed3362 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polaris", - "version": "1.2.1", + "version": "1.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "polaris", - "version": "1.2.1", + "version": "1.3.2", "license": "GNU-3.0-or-later", "dependencies": { "@tomphttp/bare-server-node": "^2.0.1", diff --git a/package.json b/package.json index bb19736..5b46205 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polaris", - "version": "1.2.1", + "version": "1.3.2", "description": "The professional unblocked games site.", "main": "server/index.js", "type": "module", diff --git a/server/utils/rewriter.js b/server/utils/rewriter.js index 35b6123..ff508bd 100644 --- a/server/utils/rewriter.js +++ b/server/utils/rewriter.js @@ -23,7 +23,7 @@ const templateParser = (data) => { .map(data => { if (data) { if (data.startsWith('{{') && data.split(':')[data.split(':').length - 2].endsWith('}}')) { - if (config.allowDangerousTemplateInsert) { + if (config.options.allowDangerousTemplateInsert) { if (Boolean(eval(String(data.split(':')[data.split(':').length - 2]).slice(2, -2)))) return data; else return undefined; } else return undefined; diff --git a/static/assets/JSON/changelog.json b/static/assets/JSON/changelog.json index 66a4b73..a60d9ce 100644 --- a/static/assets/JSON/changelog.json +++ b/static/assets/JSON/changelog.json @@ -1,4 +1,28 @@ [ + { + "date": "2/28/2024", + "simpleDescription": "Added 2 games" + }, + { + "date": "2/27/2024", + "simpleDescription": "Added 4 games and removed Buckshot Roulette" + }, + { + "date": "2/26/2024", + "simpleDescription": "Added Buckshot Roulette" + }, + { + "date": "2/24/2024", + "simpleDescription": "Added a random game button" + }, + { + "date": "2/23/2024", + "simpleDescription": "Added 6 games and changed popular games" + }, + { + "date": "2/22/2024", + "simpleDescription": "Added 17 games (200+ games 🎉), and removed 1 game" + }, { "date": "2/21/2024", "simpleDescription": "Fixed more games, added 15 games, and added 2 new themes" diff --git a/static/assets/JSON/games.json b/static/assets/JSON/games.json index fded791..8d4e519 100644 --- a/static/assets/JSON/games.json +++ b/static/assets/JSON/games.json @@ -47,7 +47,7 @@ }, { "name": "Aquapark.io", - "target": "https://player.work/aquapark-slides/index.html", + "target": "https://html5.gamedistribution.com/rvvASMiM/ce67b95f0db44d66b8b0dc48ade7ce1a/index.html", "image": "https://teen.media/assets/aqua.jpeg" }, { @@ -67,7 +67,7 @@ }, { "name": "Asphalt Retro", - "target": "//html5.gamedistribution.com/rvvASMiM/2c122cee7ef04222a962449e32a34e98/?gd_sdk_referrer_url=https://gamedistribution.com/games/asphalt-retro", + "target": "https://html5.gamedistribution.com/rvvASMiM/2c122cee7ef04222a962449e32a34e98/?gd_sdk_referrer_url=https://gamedistribution.com/games/asphalt-retro", "image": "/cdn/images/asr.jpg" }, { @@ -92,12 +92,12 @@ }, { "name": "Basket Random", - "target": "//html5.gamedistribution.com/rvvASMiM/bf1268dccb5d43e7970bb3edaa54afc8/?gd_sdk_referrer_url=https://gamedistribution.com/games/basket-random", + "target": "https://html5.gamedistribution.com/rvvASMiM/bf1268dccb5d43e7970bb3edaa54afc8/?gd_sdk_referrer_url=https://gamedistribution.com/games/basket-random", "image": "https://img.gamedistribution.com/bf1268dccb5d43e7970bb3edaa54afc8-512x512.jpeg" }, { "name": "Basketball Stars", - "target": "//html5.gamedistribution.com/rvvASMiM/69d78d071f704fa183d75b4114ae40ec/?gd_sdk_referrer_url=https://gamedistribution.com/games/basketball-stars", + "target": "https://html5.gamedistribution.com/rvvASMiM/69d78d071f704fa183d75b4114ae40ec/?gd_sdk_referrer_url=https://gamedistribution.com/games/basketball-stars", "image": "https://img.gamedistribution.com/69d78d071f704fa183d75b4114ae40ec-512x512.jpeg" }, { @@ -112,7 +112,7 @@ }, { "name": "BitLife", - "target": "//html5.gamedistribution.com/rvvASMiM/rvvASMiM/2e44fb60fd3f4606b1b06c17a2b9d60d/index.html", + "target": "https://html5.gamedistribution.com/rvvASMiM/rvvASMiM/2e44fb60fd3f4606b1b06c17a2b9d60d/index.html", "image": "https://play-lh.googleusercontent.com/fUM-UyywXxjC8soxAZdIlxJrlRRXmql8wkE426SHzft4lJycSKVd2jCYQQX1BEG9Xw=w240-h480-rw" }, { @@ -173,8 +173,7 @@ { "name": "COD Mobile", "target": "https://nowgg.nl/play/activision-publishing-inc/7935/call-of-duty.html", - "image": "https://static.wikia.nocookie.net/callofduty/images/f/f4/App_Icon_CODM_Global.jpg/revision/latest?cb=20200507033012", - "popular": true + "image": "https://static.wikia.nocookie.net/callofduty/images/f/f4/App_Icon_CODM_Global.jpg/revision/latest?cb=20200507033012" }, { "name": "Counter Strike", @@ -234,17 +233,12 @@ { "name": "Drive Mad", "target": "/cdn/3kh0/drive-mad/index.html", - "image": "/cdn/images/dmd.jpg" - }, - { - "name": "Fortnite", - "target": "https://nowgg.nl/play/epic-games/7308/fortnite", - "image": "https://upload.wikimedia.org/wikipedia/commons/7/7c/Fortnite_F_lettermark_logo.png", + "image": "/cdn/images/dmd.jpg", "popular": true }, { "name": "Fireboy and Watergirl", - "target": "//html5.gamedistribution.com/rvvASMiM/a55c9cc9c21e4fc683c8c6857f3d0c75/?gd_sdk_referrer_url=https://gamedistribution.com/games/fireboy-and-watergirl-1-forest-temple", + "target": "https://html5.gamedistribution.com/rvvASMiM/a55c9cc9c21e4fc683c8c6857f3d0c75/?gd_sdk_referrer_url=https://gamedistribution.com/games/fireboy-and-watergirl-1-forest-temple", "image": "https://img.gamedistribution.com/a55c9cc9c21e4fc683c8c6857f3d0c75-512x512.jpeg" }, { @@ -299,7 +293,7 @@ }, { "name": "Janissary Battles", - "target": "//html5.gamedistribution.com/rvvASMiM/8b55f4f729be4e70b6155f27d2e04690/?gd_sdk_referrer_url=https://gamedistribution.com/games/janissary-battles", + "target": "https://html5.gamedistribution.com/rvvASMiM/8b55f4f729be4e70b6155f27d2e04690/?gd_sdk_referrer_url=https://gamedistribution.com/games/janissary-battles", "image": "/cdn/images/janissary.png" }, { @@ -350,8 +344,7 @@ { "name": "Minecraft", "target": "/cdn/3kh0/minecraft-15/index.html", - "image": "/cdn/images/mc.jpeg", - "popular": true + "image": "/cdn/images/mc.jpeg" }, { "name": "Missiles", @@ -395,7 +388,7 @@ }, { "name": "osu!", - "target": "https://skoolgq.github.io/skool-osu", + "target": "/cdn/3kh0/osu/index.html", "image": "/cdn/images/osu.png" }, { @@ -467,7 +460,7 @@ }, { "name": "Rotate", - "target": "//html5.gamedistribution.com/rvvASMiM/0faa4468d18e4f7aa2e0161b4fefa193/?gd_sdk_referrer_url=https://gamedistribution.com/games/rotate", + "target": "https://html5.gamedistribution.com/rvvASMiM/0faa4468d18e4f7aa2e0161b4fefa193/?gd_sdk_referrer_url=https://gamedistribution.com/games/rotate", "image": "https://img.gamedistribution.com/0faa4468d18e4f7aa2e0161b4fefa193-512x512.jpeg" }, { @@ -492,19 +485,19 @@ }, { "name": "Soccer Random", - "target": "//html5.gamedistribution.com/rvvASMiM/308d826f20034d7b972f25258c8d0a44/?gd_sdk_referrer_url=https://gamedistribution.com/games/soccer-random", + "target": "https://html5.gamedistribution.com/rvvASMiM/308d826f20034d7b972f25258c8d0a44/?gd_sdk_referrer_url=https://gamedistribution.com/games/soccer-random", "image": "https://img.gamedistribution.com/308d826f20034d7b972f25258c8d0a44-512x512.jpeg" }, { "name": "Stickman Archero Fight", - "target": "//html5.gamedistribution.com/rvvASMiM/3f4c166817ad4fd4b5b05d9adba22fcd/?gd_sdk_referrer_url=https://www.gamegab.com/play/16561/Stickman-Archero-Fight/", - "image": "https://www5.minijuegosgratis.com/v3/games/thumbnails/241942_7_sq.jpg" + "target": "https://html5.gamedistribution.com/rvvASMiM/3f4c166817ad4fd4b5b05d9adba22fcd/?gd_sdk_referrer_url=https://www.gamegab.com/play/16561/Stickman-Archero-Fight/", + "image": "https://www5.minijuegosgratis.com/v3/games/thumbnails/241942_7_sq.jpg", + "popular": true }, { "name": "Stumble Guys", "target": "https://www.stumbleguys.com/play", - "image": "https://play-lh.googleusercontent.com/Oci7f4WR0JShbn-n5hnwubbXaMssleb2b1Dv7AMOzFFcgstIdC9kg-E3LHx3em8RCaLf", - "popular": true + "image": "https://play-lh.googleusercontent.com/Oci7f4WR0JShbn-n5hnwubbXaMssleb2b1Dv7AMOzFFcgstIdC9kg-E3LHx3em8RCaLf" }, { "name": "Subway Surfers", @@ -543,32 +536,32 @@ }, { "name": "Vex 3", - "target": "//html5.gamedistribution.com/rvvASMiM/762c932b4db74c6da0c1d101b2da8be6/?gd_sdk_referrer_url=https://gamedistribution.com/games/vex-3", + "target": "https://html5.gamedistribution.com/rvvASMiM/762c932b4db74c6da0c1d101b2da8be6/?gd_sdk_referrer_url=https://gamedistribution.com/games/vex-3", "image": "https://is1-ssl.mzstatic.com/image/thumb/Purple128/v4/87/06/4e/87064e7a-c9fd-7135-6ba3-f321f013e01e/mzl.kqcjsyop.png/512x512bb.jpg" }, { "name": "Vex 4", - "target": "//html5.gamedistribution.com/rvvASMiM/80e6a5ae477f4d4fbcd1ea293d10087d/?gd_sdk_referrer_url=https://gamedistribution.com/games/vex-4", + "target": "https://html5.gamedistribution.com/rvvASMiM/80e6a5ae477f4d4fbcd1ea293d10087d/?gd_sdk_referrer_url=https://gamedistribution.com/games/vex-4", "image": "https://mobimg.b-cdn.net/v2/fetch/1d/1d957ad4cb8024ec9b63d54d6c61235b.png" }, { "name": "Vex 5", - "target": "//html5.gamedistribution.com/rvvASMiM/f120262ab72743039fbce88c1f370df8/?gd_sdk_referrer_url=https://gamedistribution.com/games/vex-5", + "target": "https://html5.gamedistribution.com/rvvASMiM/f120262ab72743039fbce88c1f370df8/?gd_sdk_referrer_url=https://gamedistribution.com/games/vex-5", "image": "https://img.gamedistribution.com/f120262ab72743039fbce88c1f370df8-512x512.jpeg" }, { "name": "Vex 6", - "target": "//html5.gamedistribution.com/rvvASMiM/4925e12574364121a48c61c35f649c36/?gd_sdk_referrer_url=https://gamedistribution.com/games/vex-6", + "target": "https://html5.gamedistribution.com/rvvASMiM/4925e12574364121a48c61c35f649c36/?gd_sdk_referrer_url=https://gamedistribution.com/games/vex-6", "image": "/cdn/images/vex-6.png" }, { "name": "Vex 7", - "target": "//html5.gamedistribution.com/rvvASMiM/rvvASMiM/0c454c9562d249d28ba3a2b50564042c/index.html?gd_sdk_referrer_url=https%3A%2F%2Ftr.y8.com%2Fgames%2Fvex_7&key=y8&value=default&gd_zone_config=eyJwYXJlbnRVUkwiOiJodHRwczovL3RyLnk4LmNvbS9nYW1lcy92ZXhfNyIsInBhcmVudERvbWFpbiI6InRyLnk4LmNvbSIsInRvcERvbWFpbiI6InRyLnk4LmNvbSIsImhhc0ltcHJlc3Npb24iOmZhbHNlLCJsb2FkZXJFbmFibGVkIjp0cnVlLCJob3N0IjoiaHRtbDUuZ2FtZWRpc3RyaWJ1dGlvbi5jb20iLCJ2ZXJzaW9uIjoiMS41LjE2In0%253D", + "target": "https://html5.gamedistribution.com/rvvASMiM/rvvASMiM/0c454c9562d249d28ba3a2b50564042c/index.html?gd_sdk_referrer_url=https%3A%2F%2Ftr.y8.com%2Fgames%2Fvex_7&key=y8&value=default&gd_zone_config=eyJwYXJlbnRVUkwiOiJodHRwczovL3RyLnk4LmNvbS9nYW1lcy92ZXhfNyIsInBhcmVudERvbWFpbiI6InRyLnk4LmNvbSIsInRvcERvbWFpbiI6InRyLnk4LmNvbSIsImhhc0ltcHJlc3Npb24iOmZhbHNlLCJsb2FkZXJFbmFibGVkIjp0cnVlLCJob3N0IjoiaHRtbDUuZ2FtZWRpc3RyaWJ1dGlvbi5jb20iLCJ2ZXJzaW9uIjoiMS41LjE2In0%253D", "image": "https://img.gamedistribution.com/0c454c9562d249d28ba3a2b50564042c-512x512.jpg" }, { "name": "Volley Random", - "target": "//html5.gamedistribution.com/rvvASMiM/b6f03bdc505e4d78a17379a5a83e206b/?gd_sdk_referrer_url=https://gamedistribution.com/games/volley-random", + "target": "https://html5.gamedistribution.com/rvvASMiM/b6f03bdc505e4d78a17379a5a83e206b/?gd_sdk_referrer_url=https://gamedistribution.com/games/volley-random", "image": "https://img.gamedistribution.com/b6f03bdc505e4d78a17379a5a83e206b-512x512.jpeg" }, { @@ -594,7 +587,8 @@ { "name": "Funny Shooter 2", "target": "https://rawcdn.githack.com/nightrose-labs/quartz/master/1/6af3cc65-32f9-4f3d-a66c-6c8882a7c5df/index.html", - "image": "https://raw.githubusercontent.com/nightrose-labs/quartz/master/thumb/6af3cc65-32f9-4f3d-a66c-6c8882a7c5df.jpg" + "image": "https://raw.githubusercontent.com/nightrose-labs/quartz/master/thumb/6af3cc65-32f9-4f3d-a66c-6c8882a7c5df.jpg", + "popular": true }, { "name": "Amongus", @@ -698,7 +692,7 @@ }, { "name": "Tunnel Rush Mania", - "target": "//html5.gamemonetize.co/2fp4sd31llh6u6vjxe1wxbx8meapsgop/", + "target": "https://html5.gamemonetize.co/2fp4sd31llh6u6vjxe1wxbx8meapsgop/", "image": "https://play-lh.googleusercontent.com/tl2qr3PCg-vpzloUgjMAY9eXz9y58Gdmb77_d9RbmrWoQu8rIvj4Fn3eCurqBoWsY84" }, { @@ -911,11 +905,6 @@ "target": "/cdn/3kh0/station-141/index.html", "image": "https://img.itch.zone/aW1nLzU4ODM5NjMucG5n/original/75wxYs.png" }, - { - "name": "Station Meltdown", - "target": "/cdn/3kh0/station-meltdown/index.html", - "image": "https://gamaverse.com/c/i/y/station-meltdown.jpg" - }, { "name": "Rolling Forests", "target": "/cdn/3kh0/rolling-forests/index.html", @@ -924,6 +913,161 @@ { "name": "Veloce", "target": "/cdn/3kh0/veloce/index.html", - "image": "/cdn/3kh0/rolling-forests/icon.png" + "image": "https://img.itch.zone/aW1nLzI1NjI0MjgucG5n/original/qN6zkD.png" + }, + { + "name": "Polybranch", + "target": "/cdn/3kh0/polybranch/index.html", + "image": "/cdn/3kh0/polybranch/img/pic1.png" + }, + { + "name": "Stick Archers", + "target": "/cdn/3kh0/stick-archers/index.html", + "image": "/cdn/3kh0/stick-archers/splash.jpg" + }, + { + "name": "Soccer Skills", + "target": "/cdn/3kh0/soccer-skills/index.html", + "image": "/cdn/3kh0/soccer-skills/splash.png" + }, + { + "name": "Stick Merge", + "target": "/cdn/3kh0/stick-merge/index.html", + "image": "/cdn/3kh0/stick-merge/splash.png" + }, + { + "name": "Subway Surfers New York", + "target": "/cdn/3kh0/subway-surfers-ny/index.html", + "image": "/cdn/3kh0/subway-surfers-ny/NewYorkIcon.png" + }, + { + "name": "Henry Stickmin: Escaping The Prision", + "target": "/cdn/3kh0/escapingtheprison/index.html", + "image": "/cdn/3kh0/escapingtheprison/escapingtheprison.jpg" + }, + { + "name": "Knife Master", + "target": "/cdn/3kh0/knife-master/index.html", + "image": "/cdn/3kh0/knife-master/512x512.jpg" + }, + { + "name": "Monster Tracks", + "target": "/cdn/3kh0/monster-tracks/index.html", + "image": "https://3kh0.github.io/images/monster-tracks.jpg" + }, + { + "name": "Madalin Stunt Cars 2", + "target": "/cdn/3kh0/madalin-stunt-cars-2/index.html", + "image": "/cdn/3kh0/madalin-stunt-cars-2/img/logo.jpg" + }, + { + "name": "Madalin Stunt Cars 3", + "target": "/cdn/3kh0/madalin-stunt-cars-3/index.html", + "image": "/cdn/3kh0/madalin-stunt-cars-3/img/index.jpg" + }, + { + "name": "Henry Stickmin: Fleeing The Complex", + "target": "/cdn/3kh0/fleeingthecomplex/index.html", + "image": "https://3kh0.github.io/images/fleeing.jpeg" + }, + { + "name": "Grey Box", + "target": "/cdn/3kh0/greybox/index.html", + "image": "/cdn/3kh0/greybox/ico.png" + }, + { + "name": "Cars Simulator", + "target": "/cdn/3kh0/cars-simulator/index.html", + "image": "/cdn/3kh0/cars-simulator/splash.png" + }, + { + "name": "Cell Machine", + "target": "/cdn/3kh0/cell-machine/index.html", + "image": "/cdn/3kh0/cell-machine/img/te9nDu.png" + }, + { + "name": "Stickman Survival", + "target": "/cdn/3kh0/Stickman-Survival/index.html", + "image": "/cdn/3kh0/Stickman-Survival/Icon.png" + }, + { + "name": "Avalanche", + "target": "/cdn/3kh0/avalanche/index.html", + "image": "/cdn/3kh0/avalanche/avalanche.png" + }, + { + "name": "Ducklife", + "target": "/cdn/3kh0/ducklife1/index.html", + "image": "/cdn/3kh0/ducklife1/ducklife.png" + }, + { + "name": "Ducklife 2", + "target": "/cdn/3kh0/ducklife2/index.html", + "image": "/cdn/3kh0/ducklife2/ducklife2.png" + }, + { + "name": "Pool/Billiards Classic", + "target": "https://13582048327635951979.playables.usercontent.goog/v/assets/index.html", + "image": "https://play-lh.googleusercontent.com/KAyIN39YIUSorZxZ8iDtwO12C4V90ZSdi3tO7RUfxPxqGOhF6BYXv5VpAxlvfUWozI18" + }, + { + "name": "Alien Shooter", + "target": "https://16702553337040190672.playables.usercontent.goog/v/assets/index.html", + "image": "https://www2.minijuegosgratis.com/v3/games/thumbnails/241062_7_sq.jpg" + }, + { + "name": "Amaze!", + "target": "https://580820627722902829.playables.usercontent.goog/v/assets/index.html", + "image": "https://play-lh.googleusercontent.com/hypAu2hPcTpg-FkZr7CjrWDspK_9Nm3UKvPWln9zaFUnIr-m6WQvEZ2baAaG0ufzrg" + }, + { + "name": "Angry Birds: Showdown", + "target": "https://6381249690777614785.playables.usercontent.goog/v/assets/index.html", + "image": "https://static.wikia.nocookie.net/angrybirdsfanon/images/0/0a/Angry_Birds_Showdown_App_Icon_%28Alpha%29.png/revision/latest?cb=20190801034150" + }, + { + "name": "Basketball FRVR", + "target": "https://11024365036548115513.playables.usercontent.goog/v/assets/index.html", + "image": "https://img.poki.com/cdn-cgi/image/quality=78,width=600,height=600,fit=cover,f=auto/5aae527bebe68094c3d3276387150197.png" + }, + { + "name": "Cannon Balls 3D", + "target": "https://14726002176993811037.playables.usercontent.goog/v/assets/index.html", + "image": "https://gameforge.com/de-DE/littlegames/includes/images/games/7_5ea03e7e3fe27.jpg" + }, + { + "name": "Radius Raid", + "target": "https://jackrugile.com/radius-raid/", + "image": "/cdn/images/radiusraid.jpg" + }, + { + "name": "The Chroma Incident", + "target": "https://js13kgames.com/games/the-chroma-incident/index.html", + "image": "/cdn/images/thechromaincident.png" + }, + { + "name": "Dino Run 3d", + "target": "https://russell2259.github.io/dino3d/", + "image": "/cdn/images/dino3d.jpg" + }, + { + "name": "Burrito Bison: Launcha Libre", + "target": "https://rawcdn.githack.com/GameHub88/Yexex-Assets/main/bb/index.html", + "image": "https://play-lh.googleusercontent.com/vpTgm9u7-GzZP_MceTWpDi0HbinXd_4phCoTwf4ZspFL-115FtNRdo_SU1p-khLDnLA" + }, + { + "name": "Yohoho.io", + "target": "https://rawcdn.githack.com/GameHub88/Yexex-Assets/main/yohoho/index.html", + "image": "https://lh3.googleusercontent.com/BulAgT61Ocg2r5obu2apG_IOYUi3t16vdmBwy0uAgmiOatFUfcRVuRKFPGSsz0kRJN8N" + }, + { + "name": "Jacksmith", + "target": "https://moonlight.silvereen.net/src/static/games/jacksmith/index.html", + "image": "https://img.poki.com/cdn-cgi/image/quality=78,width=600,height=600,fit=cover,f=auto/ebe99c6629baa3ea5f4d9c13f36a37bb.png" + }, + { + "name": "Sans Fight Simulator", + "target": "https://jcw87.github.io/c2-sans-fight/", + "image": "https://img.itch.zone/aW1nLzE2MDEzODIucG5n/original/oNevX4.png" } ] \ No newline at end of file diff --git a/static/assets/JSON/quotes.json b/static/assets/JSON/quotes.json deleted file mode 100644 index 19ede5f..0000000 --- a/static/assets/JSON/quotes.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - { - "quote": "The first quote??!" - } -] \ No newline at end of file diff --git a/static/assets/css/main.css b/static/assets/css/main.css index c842cc3..de165ea 100644 --- a/static/assets/css/main.css +++ b/static/assets/css/main.css @@ -89,26 +89,68 @@ body::-webkit-scrollbar-corner { .search { margin-bottom: 20px; + display: flex; + input { - width: 60vh; - height: 7vh; + width: 40vh; + height: 7.5vh; border-radius: 2vh; font-size: 3vh; cursor: text; - margin-right: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; + transition: all 0.5s ease; + margin: 0px; + padding: 0px; + margin-right: 2.5px; + margin-left: calc(50vw - calc(44vh + 45px)); + } + + input:focus { + width: 50vh; + margin-left: calc(50vw - calc(54vh + 45px)); + } + + input::placeholder { + transition: opacity 0.3s ease; + } + + input:focus::placeholder { + opacity: 0; } select { - height: calc(7vh + 2px); + height: 7.5vh; border-radius: 2vh; font-size: 3vh; background: var(--sidebar-bg); margin-left: 0px; border-top-left-radius: 0px; border-bottom-left-radius: 0px; + margin: 0px; + } + + button { + text-align: center; + box-shadow: 0.5vh 0.5vh 1vh 0vh var(--shadow-color); + cursor: pointer; + height: 7.5vh; + background: var(--sidebar-bg); + color: var(--text); + margin-left: 0px; + border-radius: 0px; + padding: 0px; + margin: 0px; + outline: none; + border: none; + margin-right: 2.5px; + padding-left: 10px; + padding-right: 10px; + } + + button i { + font-size: 3vh; } } @@ -250,10 +292,6 @@ select { margin-top: 2vh; } -button:hover { - opacity: 0.8; -} - .switch { position: relative; display: inline-block; diff --git a/static/assets/img/wide/stickman-archero-fight.png b/static/assets/img/wide/stickman-archero-fight.png new file mode 100644 index 0000000..2e1d2c7 Binary files /dev/null and b/static/assets/img/wide/stickman-archero-fight.png differ diff --git a/static/assets/js/eastereggs.js b/static/assets/js/eastereggs.js index 89a91c4..bc16e46 100644 --- a/static/assets/js/eastereggs.js +++ b/static/assets/js/eastereggs.js @@ -7,8 +7,9 @@ /** * @typedef easterEgg * @type {object} - * @property {'keybind' | 'click'} easterEgg.type + * @property {'keybind' | 'date'} easterEgg.type * @property {string} easterEgg.phrase + * @property {string} easterEgg.date * @property {number} easterEgg.clickCount * @property {object} easterEgg.element * @property {object} easterEgg.variables @@ -55,6 +56,31 @@ const utils = { return { remove: () => window.removeEventListener(listener) }; + }, + /** + * @param {string} date + * @param {easterEgg['run']} script + */ + createDate: async (date, script) => { + date = date.split('/'); + + if (date.length === 3) { + const day = date[1] === '*' ? new Date().getDate() : date[1]; + const month = date[0] === '*' ? new Date().getMonth() : date[0]; + const year = date[2] === '*' ? new Date().getFullYear() : date[2]; + + if (!utils.easterEggActive && (new Date().getDate() === day && new Date().getMonth() === month && new Date().getFullYear() === year)) { + try { + await script({ + remove: () => window.removeEventListener('keydown', listener, true) + }); + + utils.easterEggActive = false; + } catch (e) { + utils.easterEggActive = false; + } + } + } else throw new Error('Invalid date'); } }; @@ -386,10 +412,24 @@ easterEggs.push({ }) }); +easterEggs.push({ + type: 'date', + date: '4/1/*', + run: () => { + // April fools =) + } +}); + export default () => easterEggs.forEach(easterEgg => { if (easterEgg.type === 'keybind') { utils.createKeybind(easterEgg.phrase, easterEgg.run); + try { + easterEgg.preload(); + } catch (e) { } + } else if (easterEgg.type === 'date') { + utils.createDate(easterEgg.date, easterEgg.run); + try { easterEgg.preload(); } catch (e) { } diff --git a/static/assets/js/games.js b/static/assets/js/games.js index ccae4ae..f6ab7a4 100644 --- a/static/assets/js/games.js +++ b/static/assets/js/games.js @@ -173,6 +173,16 @@ const load = () => { }); }) .catch(e => new PolarisError('Failed to load games')); + + document.querySelector('#randomGame').addEventListener('click', () => { + const games = document.querySelectorAll('.games>.game'); + + if (games.length > 0) { + const randomGame = games[Math.floor(Math.random() * games.length)]; + + randomGame.click(); + } + }); }; export default { diff --git a/static/assets/js/main.js b/static/assets/js/main.js index 27f0ebe..6d3022d 100644 --- a/static/assets/js/main.js +++ b/static/assets/js/main.js @@ -130,7 +130,7 @@ if (location.pathname === '/') { fetch('/api/games') .then(res => res.json()) .then(games => { - const gameName = 'Run 3'; + const gameName = 'Stickman Archero Fight'; const game = games.all.filter(g => g.name === gameName)[0]; document.querySelector('.featured').addEventListener('click', () => { @@ -149,7 +149,7 @@ if (location.pathname === '/') { }, 1000); }); - document.querySelector('.featured').src = '/assets/img/wide/run3.png'; + document.querySelector('.featured').src = '/assets/img/wide/stickman-archero-fight.png'; }).catch(e => new PolarisError('Failed to load featured game.')); const logHeight = () => { diff --git a/static/games.html b/static/games.html index a49f277..4a56ff7 100644 --- a/static/games.html +++ b/static/games.html @@ -34,12 +34,16 @@ -

All Games

+

All Games (200+ 🎉)