Add 4 new games, add vertical property to metada, and update games page

This commit is contained in:
wearrrrr 2024-07-28 21:13:43 -05:00
parent e7aa57adcb
commit 33e80ef1eb
7 changed files with 44 additions and 9 deletions

View file

@ -1,5 +1,6 @@
const id = window.location.pathname.split("/").pop(); const id = window.location.pathname.split("/").pop();
if (id && RufflePlayer) { if (id && RufflePlayer) {
document.title = `Flash Game - ${id}`;
window.addEventListener("load", loadRuffle); window.addEventListener("load", loadRuffle);
} else { } else {
document.querySelector("#loader").classList.add("hidden"); document.querySelector("#loader").classList.add("hidden");

@ -1 +1 @@
Subproject commit e3170261ecfbd6073322b3cfa500729936b5fa2e Subproject commit a4e5ff6876b65963183777c0fbb77c73632e3093

View file

@ -57,6 +57,13 @@
"slug": "bloons", "slug": "bloons",
"flash": true "flash": true
}, },
"bitlife": {
"name": "BitLife",
"image": "/games/bitlife/logo.png",
"slug": "bitlife",
"unity": true,
"vertical": true
},
"cannon-basketball-4": { "cannon-basketball-4": {
"name": "Cannon Basketball 4", "name": "Cannon Basketball 4",
"image": "/games/cannon-basketball-4/logo.png", "image": "/games/cannon-basketball-4/logo.png",
@ -243,6 +250,11 @@
"image": "/games/moto-x3m-winter/logo.png", "image": "/games/moto-x3m-winter/logo.png",
"slug": "moto-x3m-winter" "slug": "moto-x3m-winter"
}, },
"pvz": {
"name": "Plants vs Zombies",
"image": "/games/pvz/logo.png",
"slug": "pvz"
},
"retro-bowl": { "retro-bowl": {
"name": "Retro Bowl", "name": "Retro Bowl",
"image": "/games/retro-bowl/logo.png", "image": "/games/retro-bowl/logo.png",
@ -279,6 +291,11 @@
"image": "/games/superhot/logo.png", "image": "/games/superhot/logo.png",
"slug": "superhot" "slug": "superhot"
}, },
"temple-run-2": {
"name": "Temple Run 2",
"image": "/games/temple-run-2/logo.png",
"slug": "temple-run-2"
},
"there-is-no-game": { "there-is-no-game": {
"name": "There is No Game", "name": "There is No Game",
"image": "/games/there-is-no-game/logo.png", "image": "/games/there-is-no-game/logo.png",

View file

@ -82,10 +82,6 @@ const { title, optionalPreloads } = Astro.props;
<WelcomeLogging /> <WelcomeLogging />
<Footer /> <Footer />
<style is:global> <style is:global>
:root {
--background-color: black;
--text-color: #fff;
}
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@ -288,6 +284,10 @@ const { title, optionalPreloads } = Astro.props;
} }
</style> </style>
<style is:global> <style is:global>
:root {
--background-color: black;
--text-color: #fff;
}
[data-theme="alu"] { [data-theme="alu"] {
--background-color: #211d29; --background-color: #211d29;
--background-highlight: #35314a; --background-highlight: #35314a;

View file

@ -21,14 +21,22 @@ const gameData = isValidGameKey(game) ? gamesList[game] : null;
if (!gameData) { if (!gameData) {
return Astro.redirect("/en/games/"); return Astro.redirect("/en/games/");
} }
let classList: string = "";
if (gameData.vertical) {
classList += "vertical ";
}
classList = classList.trim();
--- ---
<Layout title="Game"> <Layout title=`${gameData.name} | Alu`>
<div id="main-content"> <div id="main-content">
<div class="game-container"> <div class="game-container">
{ {
gameData.unity ? ( gameData.unity ? (
<iframe scrolling="no" src={`/game/unity/${gameData.slug}`} title={gameData.name} id="game-frame" /> <iframe scrolling="no" id="game-frame" class={classList} src={`/game/unity/${gameData.slug}`} title={gameData.name} id="game-frame" />
) : gameData.flash ? ( ) : gameData.flash ? (
<iframe scrolling="no" src={`/game/flash/${gameData.slug}`} title={gameData.name} id="game-frame" /> <iframe scrolling="no" src={`/game/flash/${gameData.slug}`} title={gameData.name} id="game-frame" />
) : ( ) : (
@ -49,6 +57,11 @@ if (!gameData) {
</Layout> </Layout>
<style> <style>
.vertical {
height: 70vh !important;
width: 30% !important;
aspect-ratio: auto !important;
}
#main-content { #main-content {
margin-top: 2rem; margin-top: 2rem;
} }
@ -57,6 +70,9 @@ if (!gameData) {
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
background: var(--dropdown-background-color);
width: 80%;
margin: 0 auto;
margin-bottom: 4rem; margin-bottom: 4rem;
} }
#game-frame { #game-frame {
@ -70,7 +86,7 @@ if (!gameData) {
flex-direction: column; flex-direction: column;
gap: 1rem; gap: 1rem;
background-color: var(--background-highlight); background-color: var(--background-highlight);
width: 1350px; width: 100%;
padding: 1rem; padding: 1rem;
padding-top: 0; padding-top: 0;
} }

View file

@ -9,7 +9,7 @@ export const prerender = false;
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Radon Games</title> <title>Game</title>
<script src="https://cdn.jsdelivr.net/npm/@ruffle-rs/ruffle@0.1.0-nightly.2024.7.23/ruffle.min.js" is:inline></script> <script src="https://cdn.jsdelivr.net/npm/@ruffle-rs/ruffle@0.1.0-nightly.2024.7.23/ruffle.min.js" is:inline></script>
<script type="module" src="/flash/instantiateFlash.js" is:inline defer></script> <script type="module" src="/flash/instantiateFlash.js" is:inline defer></script>
<link rel="stylesheet" href="/unity/index.css" /> <link rel="stylesheet" href="/unity/index.css" />

1
src/types.d.ts vendored
View file

@ -60,6 +60,7 @@ type GameMetadata = {
slug: string; slug: string;
unity?: boolean; unity?: boolean;
flash?: boolean; flash?: boolean;
vertical?: boolean;
}; };
type GameList = { type GameList = {