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 LinkList from "$lib/link-list.svelte";
import type { DevlogPost } from "$lib/devlog-posts";
import { posts } from "$lib/devlog-posts";
var lastIndex = -1;

View File

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