From eb341ca6ae062ed243cb8447bd9a0042394c1fd3 Mon Sep 17 00:00:00 2001 From: masquevil Date: Sun, 7 Jul 2024 22:42:49 +0800 Subject: [PATCH] =?UTF-8?q?[timer]=20=E8=AE=A1=E6=97=B6=E5=99=A8=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=89=8B=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/timer/AppView.vue | 23 ++++++++++++++++++----- src/apps/timer/speak.ts | 1 - 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/apps/timer/AppView.vue b/src/apps/timer/AppView.vue index 26ffba0..a75ff1a 100644 --- a/src/apps/timer/AppView.vue +++ b/src/apps/timer/AppView.vue @@ -4,7 +4,7 @@ import { useIntervalFn } from '@vueuse/core'; import speak from './speak'; const settingMinute = ref(); -const settingSecond = ref(0); +const settingSecond = ref(); const workingTime = ref(0); const speedUpSecond = ref(); const stopTip = ref(); @@ -48,11 +48,11 @@ const { isActive, pause, resume } = useIntervalFn( speak(stopTip.value || '计时结束', { rate: speakSpeeds.normal }); pause(); } else if (workingTime.value % 60 === 0) { - speak(`剩余${speekWorkingTime.value}`, { rate: speakSpeeds.fast }); + speak(`剩余${speekWorkingTime.value}`, { rate: speakSpeeds.normal }); } else if (workingTime.value === 30) { - speak(`${speekWorkingTime.value}`, { rate: speakSpeeds.fast }); + speak(`剩余${speekWorkingTime.value}`, { rate: speakSpeeds.normal }); } else if (workingTime.value === 10) { - speak(`${speekWorkingTime.value}`, { rate: speakSpeeds.fast }); + speak(`${speekWorkingTime.value}`, { rate: speakSpeeds.normal }); } else if (workingTime.value <= 3) { speak(`${workingTime.value}`, { rate: speakSpeeds.fast }); } @@ -195,7 +195,9 @@ function onStop() { } .timer { - --timer-height: calc(100vh - 100px - 48px); + --timer-wide-height: calc(100vh - 100px - 48px); + --timer-compact-height: calc(80vw - 40px); + --timer-height: min(var(--timer-wide-height), var(--timer-compact-height)); margin-bottom: 12px; width: 100%; @@ -230,4 +232,15 @@ function onStop() { align-items: center; gap: 8px; } + +@media screen and (max-width: 720px) { + .action-row { + flex-direction: column; + align-items: stretch; + gap: 12px; + } + .action-card { + max-width: 100%; + } +} diff --git a/src/apps/timer/speak.ts b/src/apps/timer/speak.ts index cbe19b7..882ebdc 100644 --- a/src/apps/timer/speak.ts +++ b/src/apps/timer/speak.ts @@ -25,7 +25,6 @@ export default function speak(text: string, config: VoiceConfig = {}) { // 选择语音 const listArr = window.speechSynthesis.getVoices(); const preferredVoice = listArr.find((item) => item.name === 'Google 普通话(中国大陆)'); - console.log('xxx', preferredVoice, listArr); if (preferredVoice) { instance.voice = preferredVoice; }