2022-04-15 14:24:30 +00:00
|
|
|
<template>
|
2024-04-04 22:20:42 +00:00
|
|
|
<div
|
|
|
|
v-if="shown"
|
|
|
|
class="bg-k-bg-primary text-[0.9rem] px-6 py-4 flex text-k-text-secondary z-10 space-x-3"
|
|
|
|
data-testid="support-bar"
|
|
|
|
>
|
|
|
|
<p class="flex-1">
|
2022-04-15 14:24:30 +00:00
|
|
|
Loving Koel? Please consider supporting its development via
|
2022-04-24 08:29:14 +00:00
|
|
|
<a href="https://github.com/users/phanan/sponsorship" rel="noopener" target="_blank">GitHub Sponsors</a>
|
2022-04-15 14:24:30 +00:00
|
|
|
and/or
|
2022-04-24 08:29:14 +00:00
|
|
|
<a href="https://opencollective.com/koel" rel="noopener" target="_blank">OpenCollective</a>.
|
2022-04-15 14:24:30 +00:00
|
|
|
</p>
|
2022-11-29 10:18:58 +00:00
|
|
|
<button type="button" @click.prevent="close">Hide</button>
|
2024-04-04 22:20:42 +00:00
|
|
|
<span class="block after:content-['•'] after:block" />
|
2022-11-29 10:18:58 +00:00
|
|
|
<button type="button" @click.prevent="stopBugging">
|
2022-07-07 18:05:46 +00:00
|
|
|
Don't bug me again
|
|
|
|
</button>
|
2022-04-15 14:24:30 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
<script lang="ts" setup>
|
2022-04-15 14:24:30 +00:00
|
|
|
import isMobile from 'ismobilejs'
|
2022-10-30 23:13:57 +00:00
|
|
|
import { ref, watch } from 'vue'
|
2022-05-07 10:14:35 +00:00
|
|
|
import { preferenceStore } from '@/stores'
|
2024-01-08 16:59:05 +00:00
|
|
|
import { useKoelPlus } from '@/composables'
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-10-30 23:13:57 +00:00
|
|
|
const delayUntilShow = 30 * 60 * 1000 // 30 minutes
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2022-04-15 17:00:08 +00:00
|
|
|
const shown = ref(false)
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2024-01-08 16:59:05 +00:00
|
|
|
const { isPlus } = useKoelPlus()
|
2022-10-30 23:13:57 +00:00
|
|
|
const setUpShowBarTimeout = () => setTimeout(() => (shown.value = true), delayUntilShow)
|
|
|
|
const close = () => shown.value = false
|
2022-04-15 17:00:08 +00:00
|
|
|
|
|
|
|
const stopBugging = () => {
|
2024-01-23 22:50:50 +00:00
|
|
|
preferenceStore.set('support_bar_no_bugging', true)
|
2022-04-15 17:00:08 +00:00
|
|
|
close()
|
|
|
|
}
|
|
|
|
|
2022-10-30 23:13:57 +00:00
|
|
|
watch(preferenceStore.initialized, initialized => {
|
|
|
|
if (!initialized) return
|
2024-01-23 22:50:50 +00:00
|
|
|
if (preferenceStore.state.support_bar_no_bugging || isMobile.any) return
|
2024-01-15 22:26:50 +00:00
|
|
|
if (isPlus.value) return
|
2024-01-05 16:46:58 +00:00
|
|
|
|
2022-10-30 23:13:57 +00:00
|
|
|
setUpShowBarTimeout()
|
|
|
|
}, { immediate: true })
|
2022-04-15 14:24:30 +00:00
|
|
|
</script>
|
|
|
|
|
2024-04-04 20:13:35 +00:00
|
|
|
<style lang="postcss" scoped>
|
2024-04-04 22:20:42 +00:00
|
|
|
a {
|
|
|
|
@apply text-k-text-primary hover:text-k-accent;
|
|
|
|
}
|
2022-04-15 14:24:30 +00:00
|
|
|
|
2024-04-04 22:20:42 +00:00
|
|
|
button {
|
|
|
|
@apply text-k-text-primary text-[0.9rem] hover:text-k-accent;
|
2022-04-15 14:24:30 +00:00
|
|
|
}
|
|
|
|
</style>
|