From ba342424752435c0266eb67a724f175d7ef33f2e Mon Sep 17 00:00:00 2001 From: Mihkel Martin Kasterpalu Date: Fri, 31 Jan 2025 18:38:44 +0200 Subject: [PATCH] Move projects to index, games from index to /vinge Also move games, badges from config.ts and projects from project page defintion to /src/lib/data --- src/lib/config.ts | 36 ++--- src/lib/data/badges.ts | 9 ++ src/lib/data/games.ts | 21 +++ src/lib/data/projects.ts | 82 +++++++++++ src/routes/(games)/+layout.svelte | 23 --- src/routes/+layout.svelte | 5 +- src/routes/+page.svelte | 60 ++++---- src/routes/projektid/+page.svelte | 139 ------------------ .../{(games) => vinge}/+layout.server.ts | 7 +- src/routes/vinge/+layout.svelte | 21 +++ src/routes/vinge/+page.svelte | 49 ++++++ .../epochalypse/+page.svelte | 0 .../pakubiiti/+layout.svelte | 0 .../pakubiiti/+page.server.ts | 0 .../{(games) => vinge}/pakubiiti/+page.svelte | 0 15 files changed, 235 insertions(+), 217 deletions(-) create mode 100644 src/lib/data/badges.ts create mode 100644 src/lib/data/games.ts create mode 100644 src/lib/data/projects.ts delete mode 100644 src/routes/(games)/+layout.svelte delete mode 100644 src/routes/projektid/+page.svelte rename src/routes/{(games) => vinge}/+layout.server.ts (65%) create mode 100644 src/routes/vinge/+layout.svelte create mode 100644 src/routes/vinge/+page.svelte rename src/routes/{(games) => vinge}/epochalypse/+page.svelte (100%) rename src/routes/{(games) => vinge}/pakubiiti/+layout.svelte (100%) rename src/routes/{(games) => vinge}/pakubiiti/+page.server.ts (100%) rename src/routes/{(games) => vinge}/pakubiiti/+page.svelte (100%) diff --git a/src/lib/config.ts b/src/lib/config.ts index 0082522..77fbb8c 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -1,34 +1,16 @@ -import type { GamesObj, TagsObj } from './types'; - export const site = { - name: 'Stuff.Kasterpalu', + name: 'Mihkel Martin Kasterpalu', author: 'Mihkel Martin Kasterpalu', - description: 'Minimängud ja muud huvitavat.', + description: 'Portfoolio - Arendaja, Disainer, Muusik, DJ, Ettevõtja.', image: '/web-app-manifest-512x512.png' }; -export const baseURL = 'https://stuff.kasterpalu.ee'; - -export const games: GamesObj = { - '/epochalypse': { - name: 'Epochalypse', - image: '', - description: 'Varsti veel üks Y2K. Kui nostalgiline!' - }, - '/pakubiiti': { - name: 'Paku biiti', - image: '', - description: 'Sorteeri kolme suvalise muusika albumi pealkiri, artistid ja pilt.' - }, - '': { - name: 'Rohkem mänge soon™', - image: '', - description: '' - } +export const stuffSite = { + name: 'Kasterpalu Stuff', + author: 'Mihkel Martin Kasterpalu', + description: + 'Minimängud ja muud huvitavat. Kui mul tekkis lahe idee ja suutsin sellest midagi lahedat arendada siis näed seda ka siin.', + image: '/web-app-manifest-512x512.png' }; -export const badges: TagsObj = { - muusika: { name: 'Muusika', description: 'Tegelen siin muusikaga' }, - veeb: { name: 'Veebileht', description: 'Disainisin/kirjutasin veebilehe' }, - asutaja: { name: 'Asutaja', description: 'Olin osa selle loomisest' } -}; +export const baseURL = 'https://kasterpalu.ee'; diff --git a/src/lib/data/badges.ts b/src/lib/data/badges.ts new file mode 100644 index 0000000..8d8638a --- /dev/null +++ b/src/lib/data/badges.ts @@ -0,0 +1,9 @@ +import type { TagsObj } from '$lib/types'; + +const badges: TagsObj = { + muusika: { name: 'Muusika', description: 'Tegelen siin muusikaga' }, + veeb: { name: 'Veebileht', description: 'Disainisin/kirjutasin veebilehe' }, + asutaja: { name: 'Asutaja', description: 'Olin osa selle loomisest' } +}; + +export default badges; diff --git a/src/lib/data/games.ts b/src/lib/data/games.ts new file mode 100644 index 0000000..e268680 --- /dev/null +++ b/src/lib/data/games.ts @@ -0,0 +1,21 @@ +import type { GamesObj } from '$lib/types'; + +const games: GamesObj = { + epochalypse: { + name: 'Epochalypse', + image: '', + description: 'Varsti veel üks Y2K. Kui nostalgiline!' + }, + pakubiiti: { + name: 'Paku biiti', + image: '', + description: 'Sorteeri kolme suvalise muusika albumi pealkiri, artistid ja pilt.' + }, + '': { + name: 'Rohkem mänge soon™', + image: '', + description: '' + } +}; + +export default games; diff --git a/src/lib/data/projects.ts b/src/lib/data/projects.ts new file mode 100644 index 0000000..fccd726 --- /dev/null +++ b/src/lib/data/projects.ts @@ -0,0 +1,82 @@ +import type { Project } from '$lib/types'; +import badges from './badges'; + +import skpImg from '$lib/assets/skp.jpg?enhanced'; +import dysasterImg from '$lib/assets/dysaster.jpg?enhanced'; +import monospaceeImg from '$lib/assets/monospacee.jpg?enhanced'; +import saueauguImg from '$lib/assets/saueaugu.jpg?enhanced'; + +const projects: Project[] = [ + { + name: 'SUPIKÖÖGIPOSID', + image: { + src: skpImg, + credit: { + type: 'instagram', + author: 'Mimmu', + href: 'https://www.instagram.com/musamimmu/' + }, + alt: 'Pilt neljaliikmeliseslt räpibändist SUPIKÖÖGIPOISID. Pilt on tehtud pilves ilmaga õues. Pildil on 4 mees valgete triiksärkide, mustade lipsude ja mustade tagidega.' + }, + description: 'Räpikollektiiv. Alustasime 2019.', + link: 'https://skpoisid.bandcamp.com/', + tags: [badges['muusika']] + }, + { + name: 'Dysaster Collective', + image: { + src: dysasterImg, + credit: { + type: 'instagram', + author: 'Mattias Mägi', + href: 'https://www.instagram.com/mattias.mix/' + }, + alt: 'Sinakas digitaalne kollaž Dysaster Collective liigetest.' + }, + description: '2022 asutatud mitmekülgne loomekollektiiv.', + link: 'https://dysaster.ee', + tags: [badges['asutaja'], badges['veeb']] + }, + { + name: 'monospac.ee', + image: { + src: monospaceeImg, + credit: { + type: 'instagram', + author: 'Liisa Jõhvik', + href: 'https://www.instagram.com/liisajohvik.photo/' + }, + alt: 'DJ duo monospacee nende Silent Disco setil Tartu Uus Teater saalis aastal 2024. Pilt on külje pealt, esiplaanil DJ Mimmu ja ta tagant paistab DJ Rx. Nad on valgustatud punasesega, taustal häguselt näha siniselt valgustatud kolmandat DJd.' + }, + description: 'DJ duo kaasliikmega Rx.', + link: 'https://monospac.ee', + tags: [badges['muusika'], badges['veeb']] + }, + { + name: 'Saueagu Teatritalu', + image: { + src: saueauguImg, + alt: 'Suvine Saueaugu teatrihoone. All paistab roheline muru ja katuse tagant paistab paari pilvega sinine taevas.' + }, + description: 'Taluteater Läänemaal. Tegin veebilehe.', + link: 'https://saueaugu.ee', + tags: [badges['veeb']] + }, + { + name: 'Tartu Häkkerikoda', + image: { + src: '/assets/hakkerikoda.svg', + credit: { + type: 'web', + author: 'treierxyz', + href: 'https://treier.xyz' + }, + alt: 'Tartu Häkkerikoda logo' + }, + description: 'Makerspace Tartus. Liige ning osa veebilehe loojatest.', + link: 'https://hakkerikoda.ee', + tags: [badges['veeb']] + } +]; + +export default projects; diff --git a/src/routes/(games)/+layout.svelte b/src/routes/(games)/+layout.svelte deleted file mode 100644 index 9d21c6d..0000000 --- a/src/routes/(games)/+layout.svelte +++ /dev/null @@ -1,23 +0,0 @@ - - - - {title} - - - {#if data?.description} - - - {/if} - - {#if data?.image} - - {/if} - - -{@render children()} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index a32e023..cc6c797 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -40,6 +40,9 @@ Mihkel Martin Kasterpalu logo + + vinge värk + -
+
{@render children()}
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 1d5182e..218c80c 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,7 +1,35 @@ +{#snippet projectCard( + name: string, + description: string, + image: EnhancedImage, + tags: Tag[], + link: string +)} +
+ +
+
+

{name}

+

{description}

+
+ +
+
+{/snippet} + {site.name} @@ -16,31 +44,13 @@

Hei! Mina olen Mihkel

-

- Siin saidil on mu loodud minimängud ja muud huvitavat. Aitäh neal.fun inspo eest :] -

-

- Vaata ka mu - teisi projekte. +

+ Peale selle toreda saidi on mul veel palju hobisid

-
- {#each Object.entries(games) as [href, { image, name }]} - - - {name} - - + +
+ {#each projects as { name, description, image, tags, link }} + {@render projectCard(name, description, image, tags, link)} {/each}
diff --git a/src/routes/projektid/+page.svelte b/src/routes/projektid/+page.svelte deleted file mode 100644 index 86103ee..0000000 --- a/src/routes/projektid/+page.svelte +++ /dev/null @@ -1,139 +0,0 @@ - - -{#snippet projectCard( - name: string, - description: string, - image: EnhancedImage, - tags: Tag[], - link: string -)} -
- -
-
-

{name}

-

{description}

-
- -
-
-{/snippet} - - - Projektid | {site.name} - - - - - - - - -
-

- Muud projektid -

-

- Peale selle toreda saidi on mul veel palju hobisid -

-
- -
- {#each projects as { name, description, image, tags, link }} - {@render projectCard(name, description, image, tags, link)} - {/each} -
diff --git a/src/routes/(games)/+layout.server.ts b/src/routes/vinge/+layout.server.ts similarity index 65% rename from src/routes/(games)/+layout.server.ts rename to src/routes/vinge/+layout.server.ts index 911b523..cfc1503 100644 --- a/src/routes/(games)/+layout.server.ts +++ b/src/routes/vinge/+layout.server.ts @@ -1,12 +1,15 @@ import type { LayoutServerData } from './$types'; -import { games, site } from '$lib/config'; +import { site } from '$lib/config'; +import games from '$lib/data/games'; export const load: LayoutServerData = async ({ url }) => { if (!url?.pathname) { return; } - const game = games[url.pathname]; + const gameSlug = url.pathname.split('/').at(-1); + + const game = games[gameSlug]; if (!game) { return; diff --git a/src/routes/vinge/+layout.svelte b/src/routes/vinge/+layout.svelte new file mode 100644 index 0000000..e583d27 --- /dev/null +++ b/src/routes/vinge/+layout.svelte @@ -0,0 +1,21 @@ + + + + {title} + + + + + + + + +{@render children()} diff --git a/src/routes/vinge/+page.svelte b/src/routes/vinge/+page.svelte new file mode 100644 index 0000000..e55c21a --- /dev/null +++ b/src/routes/vinge/+page.svelte @@ -0,0 +1,49 @@ + + + + {site.name} + + + + + + + + +
+

Vinge värk

+

+ Minu loodud minimängud ja muud huvitavat. +

+

+ Aitäh + neal.fun inspo eest + :) +

+
+ +
+ {#each Object.entries(games) as [href, { image, name }]} + + + {name} + + + {/each} +
diff --git a/src/routes/(games)/epochalypse/+page.svelte b/src/routes/vinge/epochalypse/+page.svelte similarity index 100% rename from src/routes/(games)/epochalypse/+page.svelte rename to src/routes/vinge/epochalypse/+page.svelte diff --git a/src/routes/(games)/pakubiiti/+layout.svelte b/src/routes/vinge/pakubiiti/+layout.svelte similarity index 100% rename from src/routes/(games)/pakubiiti/+layout.svelte rename to src/routes/vinge/pakubiiti/+layout.svelte diff --git a/src/routes/(games)/pakubiiti/+page.server.ts b/src/routes/vinge/pakubiiti/+page.server.ts similarity index 100% rename from src/routes/(games)/pakubiiti/+page.server.ts rename to src/routes/vinge/pakubiiti/+page.server.ts diff --git a/src/routes/(games)/pakubiiti/+page.svelte b/src/routes/vinge/pakubiiti/+page.svelte similarity index 100% rename from src/routes/(games)/pakubiiti/+page.svelte rename to src/routes/vinge/pakubiiti/+page.svelte