This commit is contained in:
Isaac Marovitz
2024-10-12 18:30:16 +02:00
parent 8f4654877c
commit 6ef1695d0d
4 changed files with 25 additions and 6 deletions

View File

@@ -9,7 +9,7 @@
<div class="flex flex-row p-3 gap-3 text-sm rounded bg-neutral-700 hover:bg-neutral-600 shadow-sm">
<img class="h-20 w-20" src={game.image} alt="{game.name} Icon" />
<div class="flex flex-col">
<div class="flex flex-col text-left">
<h1 class="font-bold">{game.name}</h1>
<p>{game.publisher}</p>
<p>{game.version}</p>
@@ -20,5 +20,6 @@
<div class="flex flex-col text-right">
<p>{game.serial}</p>
<p>{fileSize}</p>
<p>{game.region.toString()}</p>
</div>
</div>

View File

@@ -2,17 +2,34 @@ export class Game {
name: string;
image: string;
publisher: string;
region: Region;
version: string;
serial: string;
// Size in bytes
size: number;
constructor(name: string, image: string, publisher: string, version: string, serial: string, size: number) {
constructor(name: string,
image: string,
publisher: string,
region: Region,
version: string,
serial: string,
size: number) {
this.name = name;
this.image = image;
this.publisher = publisher;
this.region = region;
this.version = version;
this.serial = serial;
this.size = size;
}
}
export enum Region {
USA = "USA",
Europe = "Europe",
Japan = "Japan",
Asia = "Asia",
World = "World",
Unknown = "Unknown"
}

View File

@@ -1,11 +1,11 @@
<script lang="ts">
import Header from "$components/Header.svelte";
import Footer from "$components/Footer.svelte";
import { Game } from "$models/Game";
import { Game, Region } from "$models/Game";
import GameLibrary from "$components/GameLibrary.svelte";
let sonicGame = new Game("Sonic Mania", "./icon0.png", "SEGA", "1.03", "CUSA07023", 197927919);
let weAreDoomedGame = new Game("WE ARE DOOMED", "./icon1.png", "Vertex Pop Inc.", "1.00", "CUSA02394", 32903780);
let sonicGame = new Game("Sonic Mania", "./icon0.png", "SEGA", Region.USA,"1.03", "CUSA07023", 197927919);
let weAreDoomedGame = new Game("WE ARE DOOMED", "./icon1.png", "Vertex Pop Inc.", Region.Europe, "1.00", "CUSA02394", 32903780);
let games = [sonicGame, weAreDoomedGame];
let filteredGames: Game[] = [];

View File

@@ -17,7 +17,8 @@
"$helpers/*": ["./src/helpers/*"],
"$models/*": ["./src/models/*"],
}
}
},
"include": ["src/**/*"]
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
// except $lib which is handled by https://kit.svelte.dev/docs/configuration#files
//