fix random games button and change featured image

This commit is contained in:
Russell2259
2024-02-25 04:35:18 +00:00
parent 3b35aa885b
commit f7eef1bce6
10 changed files with 62 additions and 41 deletions
+1 -1
View File
@@ -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;
+4
View File
@@ -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"
+1 -1
View File
@@ -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"
},
+36 -21
View File
@@ -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 {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

+11 -12
View File
@@ -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
+1 -1
View File
@@ -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 = () => {
+8 -4
View File
@@ -29,25 +29,29 @@
</script>
<div class="content centered">
<h1 style="font-size: 4vh;">Popular Games</h1>
<h1 style="font-size: 6vh;">Games</h1>
<div class="popular-games">
</div>
<h1 style="font-size: 4vh;" class="gamesectionheader">All Games <small style="font-size: 2vh;">(200+ 🎉)</small><br><small style="font-size: 2vh;">Don't see your game in the popular section? Search for it in All Games.</small></h1>
<h1 style="font-size: 4vh;" class="gamesectionheader">All Games <small style="font-size: 2vh;">(200+ 🎉)</small></h1>
<div class="search">
<input type="text" id="searchInput" placeholder="Search Games">
<!--<button class="randomGame"><i class="fa-solid fa-dice"></i></button>-->
<button id="randomGame" title="Play a random game">
<i class="fa-solid fa-dice"></i>
</button>
<select id="searchSort">
<select id="searchSort" title="Sort the games">
<option value="none" selected>Don't Sort</option>
<option value="newest">Newest</option>
<option value="abc">Alphabetical</option>
</select>
</div>
<br>
<!--el:ad_horizontal-->
<div class="games">
-1
View File
@@ -1,6 +1,5 @@
<script src="https://unpkg.com/eruda@latest/eruda.js"></script>
<script>
alert('a');
eruda.init();
</script>