albums are now clickable
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user