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'
|
|
|
|
|
|
|
|
type DemoCredits = {
|
|
|
|
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 '
|
|
|
|
}
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
content: '.';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
li + li {
|
|
|
|
&::before {
|
|
|
|
content: ', ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|