koel/resources/assets/js/components/meta/CreditsBlock.vue

46 lines
874 B
Vue
Raw Normal View History

2024-04-04 22:20:42 +00:00
<template>
<div v-koel-overflow-fade class="max-h-[9rem] overflow-auto" data-testid="demo-credits">
Music by
<ul class="inline">
<li v-for="credit in credits" :key="credit.name" class="inline">
<a :href="credit.url" target="_blank">{{ credit.name }}</a>
</li>
</ul>
</div>
</template>
2024-04-23 21:01:27 +00:00
<script lang="ts" setup>
2024-04-04 22:20:42 +00:00
import { orderBy } from 'lodash'
import { onMounted, ref } from 'vue'
import { http } from '@/services'
interface DemoCredits {
2024-04-04 22:20:42 +00:00
name: string
url: string
}
const credits = ref<DemoCredits[]>([])
onMounted(async () => {
credits.value = window.IS_DEMO ? orderBy(await http.get<DemoCredits[]>('demo/credits'), 'name') : []
})
</script>
2024-04-23 21:01:27 +00:00
<style lang="postcss" scoped>
2024-04-04 22:20:42 +00:00
li&:last-child {
&::before {
content: ', and ';
2024-04-04 22:20:42 +00:00
}
&::after {
content: '.';
}
}
li + li {
&::before {
content: ', ';
}
}
</style>