diff --git a/src/lib/components/ProjectItem.svelte b/src/lib/components/ProjectItem.svelte
index 1abce82..512199c 100644
--- a/src/lib/components/ProjectItem.svelte
+++ b/src/lib/components/ProjectItem.svelte
@@ -1,26 +1,89 @@
@@ -56,14 +149,18 @@
on:mouseleave={handleMouseLeave}
style="transform: {transform};"
>
-
-
+
+ {#if svgContent}
+
+ {@html svgContent}
+
+ {:else if logoUrl}
+

+ {/if}
{@html highlightedDescription}
@@ -101,19 +198,31 @@
flex-shrink: 0;
width: 80px;
height: 80px;
+ border-radius: $unit-2x;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: $unit-2x;
+ box-sizing: border-box;
- :global(.svg-container) {
- width: 80px !important;
- height: 80px !important;
- border-radius: $unit-2x;
+ .logo-image {
+ max-width: 100%;
+ max-height: 100%;
+ object-fit: contain;
+ }
+
+ .logo-svg {
display: flex;
align-items: center;
justify-content: center;
- }
+ width: 100%;
+ height: 100%;
+ transition: transform 0.15s ease-out;
- :global(svg) {
- width: 48px !important;
- height: 48px !important;
+ :global(svg) {
+ width: 48px;
+ height: 48px;
+ }
}
}
@@ -139,16 +248,6 @@
.project-logo {
width: 60px;
height: 60px;
-
- :global(.svg-container) {
- width: 60px !important;
- height: 60px !important;
- }
-
- :global(svg) {
- width: 36px !important;
- height: 36px !important;
- }
}
}
-
+
\ No newline at end of file
diff --git a/src/lib/components/ProjectList.svelte b/src/lib/components/ProjectList.svelte
index f3ff2ff..28ea86c 100644
--- a/src/lib/components/ProjectList.svelte
+++ b/src/lib/components/ProjectList.svelte
@@ -1,53 +1,12 @@
+ {#if projects.length === 0}
+
+ No projects found
+
+ {/if}
{#each projects as project, index}
-
+
{/each}
@@ -114,4 +85,11 @@
color: #d0290d;
}
}
-
+
+ .no-projects {
+ padding: $unit-3x;
+ text-align: center;
+ color: $grey-40;
+ font-family: 'cstd', 'Helvetica Neue', Arial, sans-serif;
+ }
+
\ No newline at end of file
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index e8b87b2..1e3ab66 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -1,5 +1,8 @@
-
+
diff --git a/src/routes/+page.ts b/src/routes/+page.ts
index 5fc27f9..7c8cff4 100644
--- a/src/routes/+page.ts
+++ b/src/routes/+page.ts
@@ -1,36 +1,34 @@
import type { PageLoad } from './$types'
import type { Album } from '$lib/types/lastfm'
+import type { Project } from '$lib/types/project'
export const load: PageLoad = async ({ fetch }) => {
try {
- // const [albums, steamGames, psnGames] = await Promise.all([
- const [albums] = await Promise.all([
- fetchRecentAlbums(fetch)
- // fetchRecentSteamGames(fetch),
- // fetchRecentPSNGames(fetch)
- ])
+ // Fetch albums first
+ let albums: Album[] = []
+ try {
+ albums = await fetchRecentAlbums(fetch)
+ } catch (albumError) {
+ console.error('Error fetching albums:', albumError)
+ }
+
+ // Fetch projects
+ let projectsData = { projects: [] as Project[], pagination: null }
+ try {
+ projectsData = await fetchProjects(fetch)
+ } catch (projectError) {
+ console.error('Error fetching projects:', projectError)
+ }
- // const response = await fetch('/api/giantbomb', {
- // method: 'POST',
- // body: JSON.stringify({ games: psnGames }),
- // headers: {
- // 'Content-Type': 'application/json'
- // }
- // })
-
- // const games = await response.json()
return {
- albums
- // games: games,
- // steamGames: steamGames,
- // psnGames: psnGames
+ albums,
+ projects: projectsData.projects || []
}
} catch (err) {
- console.error('Error fetching data:', err)
+ console.error('Error in load function:', err)
return {
albums: [],
- games: [],
- error: err instanceof Error ? err.message : 'An unknown error occurred'
+ projects: []
}
}
}
@@ -57,3 +55,11 @@ async function fetchRecentPSNGames(fetch: typeof window.fetch): Promise
{
+ const response = await fetch('/api/projects?status=published')
+ if (!response.ok) {
+ throw new Error(`Failed to fetch projects: ${response.status}`)
+ }
+ return await response.json()
+}