From 9cbddb0770c03f36c5c2581920fa58699e3b2508 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Thu, 25 Dec 2025 02:52:00 +0800 Subject: [PATCH] feat(stage-web,docs): enable apple mobile web app capable meta tag https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html#//apple_ref/doc/uid/TP40008193-SW3 --- apps/stage-web/index.html | 1 + apps/stage-web/src/composables/theme-color.ts | 3 ++- docs/.vitepress/config.ts | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/stage-web/index.html b/apps/stage-web/index.html index 017ac3d82..96743ea18 100644 --- a/apps/stage-web/index.html +++ b/apps/stage-web/index.html @@ -8,6 +8,7 @@ + diff --git a/apps/stage-web/src/composables/theme-color.ts b/apps/stage-web/src/composables/theme-color.ts index db51f39da..27391eb2c 100644 --- a/apps/stage-web/src/composables/theme-color.ts +++ b/apps/stage-web/src/composables/theme-color.ts @@ -65,6 +65,7 @@ export function useBackgroundThemeColor({ selectedOption: Ref sampledColor: Ref }) { + const visibility = useDocumentVisibility() const { themeColorsHue, themeColorsHueDynamic } = useSettings() let samplingToken = 0 @@ -85,7 +86,7 @@ export function useBackgroundThemeColor({ // Keep theme-color reasonably fresh for animated wave backgrounds without doing per-frame work. const { pause, resume } = useIntervalFn(() => { - if (useDocumentVisibility().value !== 'visible') + if (visibility.value !== 'visible') return if (selectedOption.value?.kind === BackgroundKind.Wave && themeColorsHueDynamic) void updateThemeColor() diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index b0541dcb6..24d9113f0 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -47,6 +47,7 @@ export default defineConfig({ ['link', { rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg', sizes: 'any' }], ['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png', sizes: '180x180' }], ['meta', { name: 'apple-mobile-web-app-title', content: projectName }], + ['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }], ['meta', { name: 'author', content: `${teamMembers.map(c => c.name).join(', ')} and ${projectName} contributors` }], ['meta', { name: 'keywords', content: '' }], ['meta', { property: 'og:title', content: projectName }],