-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlaylistComponent.svelte
More file actions
37 lines (33 loc) · 920 Bytes
/
PlaylistComponent.svelte
File metadata and controls
37 lines (33 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<script>
// @ts-nocheck
import { getImageUrl } from "../scripts/api";
import { navigateTo } from "../scripts/routeService.js";
// @ts-nocheck
export let playlist = null;
async function viewPlaylist() {
navigateTo(`/Playlist`, { playlistId : playlist.id });
}
</script>
<div class="playlist-component">
{#if playlist}
<button on:click={viewPlaylist} class="playlist-item btn w-100 border border-3" style="--url: url({getImageUrl(playlist.thumbnailPath)}); {true ? "border-color: #5bbd99 !important;" : ""}">
<h3>{playlist.name}</h3>
<p>{playlist.description}</p>
</button>
{:else}
<p>No playlist available.</p>
{/if}
</div>
<style>
.playlist-item {
background-image: var(--url);
background-size: cover;
background-position: center;
font-weight: bolder;
color: white;
height: 10rem;
}
.playlist-component {
margin-top: 10px;
}
</style>