mwy2.0
This commit is contained in:
@@ -2,11 +2,9 @@
|
||||
import { RefreshCw } from 'lucide-vue-next'
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import { fetchMemories, fetchStatus, type Memory, type StatusPayload } from '../api/client'
|
||||
import { NETEASE_PLAYER_SRC } from '../config/neteasePlayer'
|
||||
import MessageForm from '../components/MessageForm.vue'
|
||||
import NepalChapterBand from '../components/NepalChapterBand.vue'
|
||||
import NepalPageContainer from '../components/NepalPageContainer.vue'
|
||||
import NeteaseEmbed from '../components/NeteaseEmbed.vue'
|
||||
import TogetherCounter from '../components/TogetherCounter.vue'
|
||||
|
||||
const status = ref<StatusPayload | null>(null)
|
||||
@@ -20,19 +18,6 @@ const serverOffsetMs = ref(0)
|
||||
let statusPoll: ReturnType<typeof setInterval> | undefined
|
||||
|
||||
const siteTitle = computed(() => status.value?.site_title ?? 'Nepal Journey: Our Story')
|
||||
const bgmEnabled = computed(() => status.value?.bgm_enabled ?? true)
|
||||
const neteaseSrc = NETEASE_PLAYER_SRC
|
||||
const showNetease = computed(() => {
|
||||
if (!bgmEnabled.value || !neteaseSrc) return false
|
||||
try {
|
||||
let u = neteaseSrc.trim()
|
||||
if (u.startsWith('//')) u = `https:${u}`
|
||||
const url = new URL(u)
|
||||
return url.protocol === 'https:' && url.hostname.toLowerCase() === 'music.163.com'
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
const showAppChrome = computed(() => !busy.value && status.value !== null)
|
||||
|
||||
@@ -99,7 +84,7 @@ const counterMilestones = computed(() =>
|
||||
v-if="showAppChrome && status"
|
||||
class="sticky top-0 z-40 border-b border-lokta-deep/10 bg-gradient-to-r from-lokta-cream/90 via-paper/90 to-lokta-teal/15 backdrop-blur-md"
|
||||
>
|
||||
<div class="mx-auto max-w-3xl space-y-3 px-4 py-3 sm:px-6">
|
||||
<div class="mx-auto max-w-3xl px-4 py-3 sm:px-6">
|
||||
<div class="min-w-0">
|
||||
<p class="truncate font-brush text-2xl text-lokta-deep sm:text-3xl">
|
||||
{{ siteTitle }}
|
||||
@@ -109,15 +94,7 @@ const counterMilestones = computed(() =>
|
||||
:server-offset-ms="serverOffsetMs"
|
||||
:milestones="counterMilestones"
|
||||
/>
|
||||
|
||||
</div>
|
||||
<NeteaseEmbed v-if="showNetease" :src="neteaseSrc" />
|
||||
<p
|
||||
v-else-if="bgmEnabled && !neteaseSrc"
|
||||
class="rounded-lg border border-dashed border-lokta-deep/20 bg-white/50 px-3 py-2 text-xs text-ink-muted"
|
||||
>
|
||||
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=2054353432&auto=1&height=66"></iframe>
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user