From bd7d5d67b845175623313db907f7c08a6587d37c Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Sat, 20 Dec 2025 21:07:19 +0800 Subject: [PATCH] chore(ui,stage-ui,stage-pages): now support to display visualizer in both linear and log --- .../src/pages/settings/modules/beat-sync.vue | 28 ++++++++++++++----- .../gadgets/AudioSpectrumVisualizer.vue | 12 ++++++-- .../components/Form/SelectTab/SelectTab.vue | 3 +- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/packages/stage-pages/src/pages/settings/modules/beat-sync.vue b/packages/stage-pages/src/pages/settings/modules/beat-sync.vue index 27ca4b17f..72fcea5ea 100644 --- a/packages/stage-pages/src/pages/settings/modules/beat-sync.vue +++ b/packages/stage-pages/src/pages/settings/modules/beat-sync.vue @@ -12,7 +12,7 @@ import { updateBeatSyncParameters, } from '@proj-airi/stage-shared/beat-sync' import { Alert, AudioSpectrumVisualizer } from '@proj-airi/stage-ui/components' -import { Button, FieldCheckbox, FieldRange } from '@proj-airi/ui' +import { Button, FieldCheckbox, FieldRange, SelectTab } from '@proj-airi/ui' import { createTimeline } from 'animejs' import { nanoid } from 'nanoid' import { computed, onMounted, onUnmounted, ref, toRaw, watch } from 'vue' @@ -22,6 +22,11 @@ const state = ref() const frequencies = ref([]) const totalFreqHistory = ref([]) const isUpdatingFrequencies = ref(false) +const spectrumScale = ref<'linear' | 'logarithm'>('logarithm') +const spectrumScaleOptions = [ + { label: 'Linear', value: 'linear' as const, icon: 'i-solar:chart-2-bold-duotone' }, + { label: 'Logarithm', value: 'logarithm' as const, icon: 'i-solar:chart-bold-duotone' }, +] const { t } = useI18n() @@ -304,12 +309,21 @@ onUnmounted(() => { -
- +
+ +
+ +
diff --git a/packages/stage-ui/src/components/gadgets/AudioSpectrumVisualizer.vue b/packages/stage-ui/src/components/gadgets/AudioSpectrumVisualizer.vue index b5c7551c5..de0bb5ed8 100644 --- a/packages/stage-ui/src/components/gadgets/AudioSpectrumVisualizer.vue +++ b/packages/stage-ui/src/components/gadgets/AudioSpectrumVisualizer.vue @@ -1,8 +1,11 @@ diff --git a/packages/ui/src/components/Form/SelectTab/SelectTab.vue b/packages/ui/src/components/Form/SelectTab/SelectTab.vue index 29069bd30..3977a683d 100644 --- a/packages/ui/src/components/Form/SelectTab/SelectTab.vue +++ b/packages/ui/src/components/Form/SelectTab/SelectTab.vue @@ -36,7 +36,7 @@ const rootStyle = computed(() => ({ '--select-tab-count': String(itemCount.value), '--select-tab-active-index': String(Math.max(activeIndex.value, 0)), '--select-tab-padding': props.size === 'sm' ? '0px' : '0px', - '--select-tab-gap': '0.5rem', + '--select-tab-gap': '0.25rem', '--select-tab-indicator-opacity': activeIndex.value === -1 ? '0' : '1', })) @@ -49,6 +49,7 @@ const rootStyle = computed(() => ({ :class="[ 'select-tab', 'relative', 'flex', 'w-full', 'items-stretch', 'rounded-xl', + 'overflow-hidden', 'bg-white-400/6', 'dark:bg-neutral-900/70', 'transition-[border-color,box-shadow,opacity]', 'duration-200', 'ease-out', 'border-2', 'border-neutral-100', 'dark:border-neutral-800',