albums are now clickable

This commit is contained in:
2025-08-21 18:59:29 +02:00
parent 54fa1234c6
commit cd4d3b512a
2 changed files with 15 additions and 8 deletions

View File

@@ -4,7 +4,6 @@
import Gallery from "$lib/lists/gallery-entry.svelte"; import Gallery from "$lib/lists/gallery-entry.svelte";
import LinkList from "$lib/link-list.svelte"; import LinkList from "$lib/link-list.svelte";
import type { DevlogPost } from "$lib/devlog-posts";
import { posts } from "$lib/devlog-posts"; import { posts } from "$lib/devlog-posts";
var lastIndex = -1; var lastIndex = -1;

View File

@@ -3,8 +3,16 @@
import Content from "$lib/content.svelte"; import Content from "$lib/content.svelte";
import { albums, type AlbumEntry } from "$lib/likedalbums"; import { albums, type AlbumEntry } from "$lib/likedalbums";
let prnt = function(key: string) { let highlightedAlbum: AlbumEntry = $state({
console.log(key) "artist": "",
"description": [],
"img": "",
"title": "",
"year": 0,
});
let albumClicked = function(key: string) {
highlightedAlbum = albums.get(key)!;
} }
</script> </script>
@@ -19,15 +27,15 @@
/> />
<Content> <Content>
<div class="album-showcase">
</div>
<div class="album-button-container"> <div class="album-button-container">
{#each albums.entries() as [key, album]} {#each albums.entries() as [key, album]}
{@render albumButton({ key, album })} {@render albumButton({ key, album })}
{/each} {/each}
</div> </div>
<div class="album-showcase">
{@render albumShowcase({ album: highlightedAlbum })}
</div>
</Content> </Content>
{#snippet albumShowcase({ {#snippet albumShowcase({
@@ -55,7 +63,7 @@
type="image" type="image"
src="{album.img}" src="{album.img}"
alt="Album art for {album.artist} {album.title}" alt="Album art for {album.artist} {album.title}"
on:click={() => prnt(key)} onclick={() => albumClicked(key)}
/> />
</div> </div>
{/snippet} {/snippet}