diff --git a/src/app.html b/src/app.html index c2d3729..b101b5f 100644 --- a/src/app.html +++ b/src/app.html @@ -1,5 +1,5 @@ - +
diff --git a/src/lib/config.ts b/src/lib/config.ts new file mode 100644 index 0000000..9bc92a1 --- /dev/null +++ b/src/lib/config.ts @@ -0,0 +1,13 @@ +import type { GamesObj } from './types'; + +export const siteName = 'Stuff.Kasterpalu'; + +export const baseURL = 'https://stuff.kasterpalu.ee'; + +export const games: GamesObj = { + '/pakubiiti': { + name: 'Paku biiti', + image: '', + description: 'Sorteeri kolme suvalise muusika albumi pealkiri, artistid ja pilt.' + } +}; diff --git a/src/lib/types.ts b/src/lib/types.ts index 1ef0567..da34e6a 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -10,3 +10,11 @@ export type Player = { highscore: number; playing: boolean; }; + +export type Game = { + name: string; + image: string; + description: string; +}; + +export type GamesObj = Record
Lohista kokku õiged albumi nimed,
diff --git a/src/routes/(games)/+layout.server.ts b/src/routes/(games)/+layout.server.ts
new file mode 100644
index 0000000..57b1185
--- /dev/null
+++ b/src/routes/(games)/+layout.server.ts
@@ -0,0 +1,20 @@
+import type { LayoutServerData } from './$types';
+import { games } from '$lib/config';
+
+export const load: LayoutServerData = async ({ url }) => {
+ if (!url?.pathname) {
+ return;
+ }
+
+ const game = games[url.pathname];
+
+ if (!game) {
+ return;
+ }
+
+ return {
+ name: game.name,
+ description: game.description,
+ image: game.image
+ };
+};
diff --git a/src/routes/(games)/+layout.svelte b/src/routes/(games)/+layout.svelte
new file mode 100644
index 0000000..2a4bf53
--- /dev/null
+++ b/src/routes/(games)/+layout.svelte
@@ -0,0 +1,23 @@
+
+
+ Minimängud ja muud huvitavat
stuff.kasterpalu.ee