mirror of
https://github.com/koel/koel
synced 2024-12-25 12:03:06 +00:00
27 lines
748 B
Vue
27 lines
748 B
Vue
<template>
|
|
<div
|
|
:style="{ backgroundImage: thumbnailUrl ? `url(${thumbnailUrl})` : 'none' }"
|
|
class="pointer-events-none fixed z-[1000] overflow-hidden opacity-10 bg-cover bg-center top-0 left-0 h-full w-full"
|
|
data-testid="album-art-overlay"
|
|
/>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref, toRefs, watchEffect } from 'vue'
|
|
import { albumStore } from '@/stores'
|
|
import { logger } from '@/utils'
|
|
|
|
const props = defineProps<{ album: number }>()
|
|
const { album } = toRefs(props)
|
|
|
|
const thumbnailUrl = ref<string | null>(null)
|
|
|
|
watchEffect(async () => {
|
|
try {
|
|
thumbnailUrl.value = await albumStore.fetchThumbnail(album.value)
|
|
} catch (error: unknown) {
|
|
logger.error(error)
|
|
thumbnailUrl.value = null
|
|
}
|
|
})
|
|
</script>
|