bring server files into project.
This commit is contained in:
52
src/routes/games/+page.svelte
Normal file
52
src/routes/games/+page.svelte
Normal file
@ -0,0 +1,52 @@
|
||||
<script lang="ts">
|
||||
type GameData = {id: number, name: string, players: string[]}
|
||||
|
||||
const games: GameData[] = [
|
||||
{id: 1, name: "The Worst", players: ["Bob", "Ted", "George"]},
|
||||
{id: 2, name: "The Best", players: ["Shelly", "William", "Abby"]},
|
||||
{id: 3, name: "The One with the Treasure Chest", players: ["Jack"]},
|
||||
];
|
||||
</script>
|
||||
|
||||
<main>
|
||||
<h1>Let’s Play Ten Thousand</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>No.</td>
|
||||
<td>Name</td>
|
||||
<td>Players</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each games as game}
|
||||
{@render GameRow(game)}
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</main>
|
||||
|
||||
{#snippet GameRow (game: GameData)}
|
||||
<tr>
|
||||
<td>{game.id}</td>
|
||||
<td>{game.name}</td>
|
||||
<td>{game.players.length}</td>
|
||||
</tr>
|
||||
{/snippet}
|
||||
|
||||
<style>
|
||||
main {
|
||||
width: 60rem;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
td {
|
||||
border: solid black 1px;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user