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 3587ffe..d6e0a34 100644 --- a/static/assets/JSON/changelog.json +++ b/static/assets/JSON/changelog.json @@ -1,4 +1,8 @@ [ + { + "date": "2/24/2024", + "simpleDescription": "Added a random game button" + }, { "date": "2/23/2024", "simpleDescription": "Added 6 games and changed popular games" diff --git a/static/assets/JSON/games.json b/static/assets/JSON/games.json index c91c83d..9fee78e 100644 --- a/static/assets/JSON/games.json +++ b/static/assets/JSON/games.json @@ -1017,7 +1017,7 @@ "image": "https://www2.minijuegosgratis.com/v3/games/thumbnails/241062_7_sq.jpg" }, { - "name": "AMAZE!", + "name": "Amaze!", "target": "https://580820627722902829.playables.usercontent.goog/v/assets/index.html", "image": "https://play-lh.googleusercontent.com/hypAu2hPcTpg-FkZr7CjrWDspK_9Nm3UKvPWln9zaFUnIr-m6WQvEZ2baAaG0ufzrg" }, diff --git a/static/assets/css/main.css b/static/assets/css/main.css index f6f8d31..de165ea 100644 --- a/static/assets/css/main.css +++ b/static/assets/css/main.css @@ -89,53 +89,68 @@ body::-webkit-scrollbar-corner { .search { margin-bottom: 20px; + display: flex; + input { width: 40vh; - height: 7vh; + 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; } - .randomGame{ - height: calc(7vh + 2px); - font-size: 3vh; - background: var(--sidebar-bg); - margin-left: 0px; - border-radius: 0px; - box-shadow: 0.5vh 0.5vh 1vh 0vh var(--shadow-color); - transition: opacity 0.3s ease; - } - - .randomGame:hover i{ - opacity: 0.8; - } - 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; } } @@ -274,7 +289,7 @@ select { margin-right: 1vh; padding-left: 2vh; padding-right: 2vh; - margin-top: 2vh; + margin-top: 2vh; } .switch { diff --git a/static/assets/img/wide/stickman-archero-fight-cover.png b/static/assets/img/wide/stickman-archero-fight-cover.png deleted file mode 100644 index 1eeda4b..0000000 Binary files a/static/assets/img/wide/stickman-archero-fight-cover.png and /dev/null differ 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/games.js b/static/assets/js/games.js index 47d76b8..f6ab7a4 100644 --- a/static/assets/js/games.js +++ b/static/assets/js/games.js @@ -173,18 +173,17 @@ const load = () => { }); }) .catch(e => new PolarisError('Failed to load games')); -/* -const randomGame = () => { - const games = document.querySelectorAll('.games>.game'); - if (games.length > 0) { - const randomIndex = Math.floor(Math.random() * games.length); - const randomGame = games[randomIndex]; - - randomGame.click(); - } - }; - document.querySelector('.randomGame').addEventListener('click', randomGame);*/ -}; + + 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 { load diff --git a/static/assets/js/main.js b/static/assets/js/main.js index 57d2347..b7e69fc 100644 --- a/static/assets/js/main.js +++ b/static/assets/js/main.js @@ -149,7 +149,7 @@ if (location.pathname === '/') { }, 1000); }); - document.querySelector('.featured').src = '/assets/img/wide/stickman-archero-fight-cover.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 eeadf96..4a56ff7 100644 --- a/static/games.html +++ b/static/games.html @@ -29,25 +29,29 @@
-

Popular Games

+

Games

-

All Games (200+ 🎉)
Don't see your game in the popular section? Search for it in All Games.

+

All Games (200+ 🎉)

+
+
diff --git a/templates/development.html b/templates/development.html index 85aa8a9..2c73580 100644 --- a/templates/development.html +++ b/templates/development.html @@ -1,6 +1,5 @@ \ No newline at end of file