Skip to content

Commit

Permalink
style: better and generic scale
Browse files Browse the repository at this point in the history
  • Loading branch information
nekomeowww committed Dec 4, 2024
1 parent 1ce61d7 commit 247e2a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/stage/src/components/Live2DViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function setScale(model: Ref<Live2DModel<InternalModel> | undefined>) {
let offsetFactor = 2
if (isMobile.value) {
offsetFactor = 3.5
offsetFactor = 2.5
}
const heightScale = canvasHeight.value * 0.95 / model.value.height * offsetFactor
Expand Down
24 changes: 12 additions & 12 deletions packages/stage/src/components/MainStage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const nowSpeakingAvatarBorderOpacityMin = 30
const nowSpeakingAvatarBorderOpacityMax = 100
const { elevenLabsApiKey, openAiApiBaseURL, openAiApiKey } = storeToRefs(useSettings())
const openAIModel = useLocalStorage<{ id: string, name?: string }>('openai-model', { id: 'openai/gpt-3.5-turbo', name: 'OpenAI GPT3.5 Turbo' })
const openAIModel = useLocalStorage<{ id: string, name?: string }>('settings/llm/openai/model', { id: 'openai/gpt-3.5-turbo', name: 'OpenAI GPT3.5 Turbo' })
const stageView = useLocalStorage('settings/stage/view/model-renderer', '2d')
const {
streamSpeech,
Expand All @@ -36,7 +37,6 @@ const {
const { audioContext, calculateVolume } = useAudioContext()
const { process } = useMarkdown()
const selectedStageView = ref<string>('2d')
const listening = ref(false)
const live2DViewerRef = ref<{ setMotion: (motionName: string) => Promise<void> }>()
const supportedModels = ref<{ id: string, name?: string }[]>([])
Expand Down Expand Up @@ -282,13 +282,13 @@ onUnmounted(() => {
>
<label
h-fit cursor-pointer
:class="[selectedStageView === '2d' ? 'bg-zinc-300 text-zinc-900 dark:bg-zinc-200 dark:text-zinc-800' : '']"
:class="[stageView === '2d' ? 'bg-zinc-300 text-zinc-900 dark:bg-zinc-200 dark:text-zinc-800' : '']"
rounded-md px-4 py-2
>
<input
v-model="selectedStageView"
:checked="selectedStageView === '2d'"
:aria-checked="selectedStageView === '2d'"
v-model="stageView"
:checked="stageView === '2d'"
:aria-checked="stageView === '2d'"
name="stageView"
type="radio"
role="radio"
Expand All @@ -299,13 +299,13 @@ onUnmounted(() => {
</label>
<label
h-fit cursor-pointer
:class="[selectedStageView === '3d' ? 'bg-zinc-300 text-zinc-900 dark:bg-zinc-200 dark:text-zinc-800' : '']"
:class="[stageView === '3d' ? 'bg-zinc-300 text-zinc-900 dark:bg-zinc-200 dark:text-zinc-800' : '']"
rounded-md px-4 py-2
>
<input
v-model="selectedStageView"
:checked="selectedStageView === '3d'"
:aria-checked="selectedStageView === '3d'"
v-model="stageView"
:checked="stageView === '3d'"
:aria-checked="stageView === '3d'"
name="stageView"
type="radio"
role="radio"
Expand All @@ -319,14 +319,14 @@ onUnmounted(() => {
</div>
<div flex="~ row 1" relative w-full items-end gap-2>
<Live2DViewer
v-if="selectedStageView === '2d'"
v-if="stageView === '2d'"
ref="live2DViewerRef"
:mouth-open-size="mouthOpenSize"
model="/assets/live2d/models/hiyori_pro_zh/runtime/hiyori_pro_t11.model3.json"
w="50%" min-w="50% <lg:full" min-h="100 sm:100" h-full flex-1
/>
<ThreeViewer
v-else-if="selectedStageView === '3d'"
v-else-if="stageView === '3d'"
/>
<div
class="relative <lg:(absolute bottom-0 from-zinc-800/80 to-zinc-800/0 bg-gradient-to-t p-2)"
Expand Down

0 comments on commit 247e2a5

Please sign in to comment.