add cards & tracks
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
<template>
|
||||
<article class="relative">
|
||||
<main
|
||||
class="absolute top-0 backdrop-blur-sm z-40 -mt-12 z-10 card w-56 h-80 p-3 bg-opacity-10 bg-white rounded-2xl shadow-lg flex flex-col overflow-hidden">
|
||||
class="backdrop-blur-sm border-2 -mt-12 z-10 card w-56 h-80 p-3 bg-opacity-40 hover:bg-opacity-80 hover:shadow-xl transition-all bg-white rounded-2xl shadow-lg flex flex-col overflow-hidden">
|
||||
<!-- Cover -->
|
||||
<figure class="flex-1 overflow-hidden rounded-t-xl">
|
||||
<figure @click="playerStore.playTrack(props.track)" class="flex-1 overflow-hidden rounded-t-xl cursor-pointer">
|
||||
<img :src="coverUrl" alt="Pochette de l'album" class="w-full h-full object-cover object-center" />
|
||||
</figure>
|
||||
|
||||
<!-- Body -->
|
||||
<div class="p-3 text-center bg-white rounded-b-xl">
|
||||
<div class="label">
|
||||
{{ props.track.order }}
|
||||
</div>
|
||||
<h2 class="text-base text-neutral-800 font-bold truncate">{{ props.track.title }}</h2>
|
||||
<p class="text-sm text-neutral-500 truncate">
|
||||
{{ props.track.artist.name }}
|
||||
@@ -17,11 +20,14 @@
|
||||
</main>
|
||||
|
||||
<footer
|
||||
class="absolute top-0 ml-32 backdrop-blur-sm -mt-12 z-10 card w-56 h-80 p-3 bg-opacity-10 bg-white rounded-2xl shadow-lg flex flex-col overflow-hidden">
|
||||
class="ml-32 backdrop-blur-sm -mt-12 z-10 card w-56 h-80 p-3 bg-opacity-10 bg-white rounded-2xl shadow-lg flex flex-col overflow-hidden">
|
||||
<!-- Back -->
|
||||
<div class="h-full flex p-16 text-center bg-slate-800 rounded-xl">
|
||||
<img src="/favicon.svg" />
|
||||
</div>
|
||||
<div class="label">
|
||||
{{ props.track.id }}
|
||||
</div>
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
@@ -29,7 +35,19 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Track } from '~~/types/types'
|
||||
import { usePlayerStore } from '~/store/player'
|
||||
|
||||
const props = defineProps<{ track: Track }>()
|
||||
const coverUrl = `https://f4.bcbits.com/img/${props.track.artist.coverId}_4.jpg`
|
||||
</script>
|
||||
const playerStore = usePlayerStore()
|
||||
const coverUrl = props.track.coverId.startsWith('http')
|
||||
? props.track.coverId
|
||||
: `https://f4.bcbits.com/img/${props.track.coverId}_4.jpg`;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.label {
|
||||
@apply rounded-full size-7 p-2 bg-esyellow leading-3 -mt-6;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user