|
@@ -2,27 +2,41 @@
|
|
<div class="timerMeter">
|
|
<div class="timerMeter">
|
|
<div class="timeCon">
|
|
<div class="timeCon">
|
|
<div class="timeBox">
|
|
<div class="timeBox">
|
|
- <div class="timeInput mmTimeIpt" :class="{ timeFocus: mmFocus }">
|
|
|
|
|
|
+ <div class="timeInput mmTimeIpt">
|
|
<div
|
|
<div
|
|
class="timeInputBtn"
|
|
class="timeInputBtn"
|
|
v-if="timeType === 'countdown'"
|
|
v-if="timeType === 'countdown'"
|
|
:class="{ palyDisabled: playState === 'play' }"
|
|
:class="{ palyDisabled: playState === 'play' }"
|
|
>
|
|
>
|
|
- <img src="./img/upBtn.png" @click="handleMMTime(10)" />
|
|
|
|
- <img src="./img/upBtn.png" @click="handleMMTime(1)" />
|
|
|
|
|
|
+ <div @click="handleMMTime(10)">
|
|
|
|
+ <img src="./img/upBtn.png" />
|
|
|
|
+ </div>
|
|
|
|
+ <div @click="handleMMTime(1)">
|
|
|
|
+ <img src="./img/upBtn.png" />
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="timeInputBox">
|
|
<div class="timeInputBox">
|
|
<n-input-number
|
|
<n-input-number
|
|
:disabled="timeType === 'countup' || playState === 'play'"
|
|
:disabled="timeType === 'countup' || playState === 'play'"
|
|
- @blur="handlemmblur"
|
|
|
|
- @focus="handlemmfocus"
|
|
|
|
placeholder=""
|
|
placeholder=""
|
|
- v-model:value="mmValue"
|
|
|
|
|
|
+ :value="mmValue"
|
|
:format="(value: number | null)=>{
|
|
:format="(value: number | null)=>{
|
|
return value?(value<10?`0${value}`:value+''):'00'
|
|
return value?(value<10?`0${value}`:value+''):'00'
|
|
}"
|
|
}"
|
|
- :min="0"
|
|
|
|
- :max="59"
|
|
|
|
|
|
+ :input-props="{
|
|
|
|
+ maxLength: '2'
|
|
|
|
+ }"
|
|
|
|
+ @update:value="(num:number)=>{
|
|
|
|
+ if(num){
|
|
|
|
+ if(num<0){
|
|
|
|
+ mmValue=0
|
|
|
|
+ }else if(num>59){
|
|
|
|
+ mmValue=59
|
|
|
|
+ }else{
|
|
|
|
+ mmValue=num
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }"
|
|
:show-button="false"
|
|
:show-button="false"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
@@ -31,32 +45,50 @@
|
|
v-if="timeType === 'countdown'"
|
|
v-if="timeType === 'countdown'"
|
|
:class="{ palyDisabled: playState === 'play' }"
|
|
:class="{ palyDisabled: playState === 'play' }"
|
|
>
|
|
>
|
|
- <img src="./img/downBtn.png" @click="handleMMTime(-10)" />
|
|
|
|
- <img src="./img/downBtn.png" @click="handleMMTime(-1)" />
|
|
|
|
|
|
+ <div @click="handleMMTime(-10)">
|
|
|
|
+ <img src="./img/downBtn.png" />
|
|
|
|
+ </div>
|
|
|
|
+ <div @click="handleMMTime(-1)">
|
|
|
|
+ <img src="./img/downBtn.png" />
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<img class="midBg" src="./img/midBg.png" />
|
|
<img class="midBg" src="./img/midBg.png" />
|
|
- <div class="timeInput ssTimeIpt" :class="{ timeFocus: ssFocus }">
|
|
|
|
|
|
+ <div class="timeInput ssTimeIpt">
|
|
<div
|
|
<div
|
|
class="timeInputBtn"
|
|
class="timeInputBtn"
|
|
v-if="timeType === 'countdown'"
|
|
v-if="timeType === 'countdown'"
|
|
:class="{ palyDisabled: playState === 'play' }"
|
|
:class="{ palyDisabled: playState === 'play' }"
|
|
>
|
|
>
|
|
- <img src="./img/upBtn.png" @click="handleSSTime(10)" />
|
|
|
|
- <img src="./img/upBtn.png" @click="handleSSTime(1)" />
|
|
|
|
|
|
+ <div @click="handleSSTime(10)">
|
|
|
|
+ <img src="./img/upBtn.png" />
|
|
|
|
+ </div>
|
|
|
|
+ <div @click="handleSSTime(1)">
|
|
|
|
+ <img src="./img/upBtn.png" />
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="timeInputBox">
|
|
<div class="timeInputBox">
|
|
<n-input-number
|
|
<n-input-number
|
|
:disabled="timeType === 'countup' || playState === 'play'"
|
|
:disabled="timeType === 'countup' || playState === 'play'"
|
|
- @blur="handlessblur"
|
|
|
|
- @focus="handlessfocus"
|
|
|
|
placeholder=""
|
|
placeholder=""
|
|
- v-model:value="ssValue"
|
|
|
|
|
|
+ :value="ssValue"
|
|
:format="(value: number | null)=>{
|
|
:format="(value: number | null)=>{
|
|
return value?(value<10?`0${value}`:value+''):'00'
|
|
return value?(value<10?`0${value}`:value+''):'00'
|
|
}"
|
|
}"
|
|
- :min="0"
|
|
|
|
- :max="59"
|
|
|
|
|
|
+ :input-props="{
|
|
|
|
+ maxLength: '2'
|
|
|
|
+ }"
|
|
|
|
+ @update:value="(num:number)=>{
|
|
|
|
+ if(num){
|
|
|
|
+ if(num<0){
|
|
|
|
+ ssValue=0
|
|
|
|
+ }else if(num>59){
|
|
|
|
+ ssValue=59
|
|
|
|
+ }else{
|
|
|
|
+ ssValue=num
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }"
|
|
:show-button="false"
|
|
:show-button="false"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
@@ -65,8 +97,12 @@
|
|
v-if="timeType === 'countdown'"
|
|
v-if="timeType === 'countdown'"
|
|
:class="{ palyDisabled: playState === 'play' }"
|
|
:class="{ palyDisabled: playState === 'play' }"
|
|
>
|
|
>
|
|
- <img src="./img/downBtn.png" @click="handleSSTime(-10)" />
|
|
|
|
- <img src="./img/downBtn.png" @click="handleSSTime(-1)" />
|
|
|
|
|
|
+ <div @click="handleSSTime(-10)">
|
|
|
|
+ <img src="./img/downBtn.png" />
|
|
|
|
+ </div>
|
|
|
|
+ <div @click="handleSSTime(-1)">
|
|
|
|
+ <img src="./img/downBtn.png" />
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -131,22 +167,6 @@ onUnmounted(() => {
|
|
soundVIdeo.pause();
|
|
soundVIdeo.pause();
|
|
});
|
|
});
|
|
|
|
|
|
-// input 状态
|
|
|
|
-const mmFocus = ref(false);
|
|
|
|
-const ssFocus = ref(false);
|
|
|
|
-function handlemmblur() {
|
|
|
|
- mmFocus.value = false;
|
|
|
|
-}
|
|
|
|
-function handlessblur() {
|
|
|
|
- ssFocus.value = false;
|
|
|
|
-}
|
|
|
|
-function handlemmfocus() {
|
|
|
|
- mmFocus.value = true;
|
|
|
|
-}
|
|
|
|
-function handlessfocus() {
|
|
|
|
- ssFocus.value = true;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// 计时类型
|
|
// 计时类型
|
|
const timeType = ref<'countdown' | 'countup'>('countdown');
|
|
const timeType = ref<'countdown' | 'countup'>('countdown');
|
|
function handleChangeTimeType(type: 'countdown' | 'countup') {
|
|
function handleChangeTimeType(type: 'countdown' | 'countup') {
|
|
@@ -175,23 +195,23 @@ watch(timeNum, () => {
|
|
});
|
|
});
|
|
function handleMMTime(num: number) {
|
|
function handleMMTime(num: number) {
|
|
if (playState.value === 'play') return;
|
|
if (playState.value === 'play') return;
|
|
- let newMmValue = mmValue.value + num;
|
|
|
|
|
|
+ const newMmValue = mmValue.value + num;
|
|
if (newMmValue > 59) {
|
|
if (newMmValue > 59) {
|
|
- newMmValue = 59;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if (newMmValue < 0) {
|
|
if (newMmValue < 0) {
|
|
- newMmValue = 0;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
mmValue.value = newMmValue;
|
|
mmValue.value = newMmValue;
|
|
}
|
|
}
|
|
function handleSSTime(num: number) {
|
|
function handleSSTime(num: number) {
|
|
if (playState.value === 'play') return;
|
|
if (playState.value === 'play') return;
|
|
- let newSsValue = ssValue.value + num;
|
|
|
|
|
|
+ const newSsValue = ssValue.value + num;
|
|
if (newSsValue > 59) {
|
|
if (newSsValue > 59) {
|
|
- newSsValue = 59;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
if (newSsValue < 0) {
|
|
if (newSsValue < 0) {
|
|
- newSsValue = 0;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
ssValue.value = newSsValue;
|
|
ssValue.value = newSsValue;
|
|
}
|
|
}
|
|
@@ -286,36 +306,13 @@ function handleCountUpStart() {
|
|
width: 132px;
|
|
width: 132px;
|
|
height: 100%;
|
|
height: 100%;
|
|
position: relative;
|
|
position: relative;
|
|
- padding: 6px 0 2px;
|
|
|
|
- &.timeFocus::after {
|
|
|
|
- content: '';
|
|
|
|
- width: 1px;
|
|
|
|
- height: 94px;
|
|
|
|
- position: absolute;
|
|
|
|
- background-color: #fff;
|
|
|
|
- left: -10px;
|
|
|
|
- top: 50%;
|
|
|
|
- transform: translateY(-50%);
|
|
|
|
- animation: blink 1.1s infinite;
|
|
|
|
- @keyframes blink {
|
|
|
|
- 0% {
|
|
|
|
- opacity: 1;
|
|
|
|
- }
|
|
|
|
- 50% {
|
|
|
|
- opacity: 0;
|
|
|
|
- }
|
|
|
|
- 100% {
|
|
|
|
- opacity: 1;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
&.mmTimeIpt,
|
|
&.mmTimeIpt,
|
|
&.ssTimeIpt {
|
|
&.ssTimeIpt {
|
|
&::before {
|
|
&::before {
|
|
content: 'M';
|
|
content: 'M';
|
|
position: absolute;
|
|
position: absolute;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
- font-size: 16px;
|
|
|
|
|
|
+ font-size: 18px;
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
top: 9px;
|
|
top: 9px;
|
|
right: -16px;
|
|
right: -16px;
|
|
@@ -338,17 +335,20 @@ function handleCountUpStart() {
|
|
--n-padding-left: initial !important;
|
|
--n-padding-left: initial !important;
|
|
--n-padding-right: initial !important;
|
|
--n-padding-right: initial !important;
|
|
--n-color-disabled: initial !important;
|
|
--n-color-disabled: initial !important;
|
|
- --n-caret-color: #3a3939 !important;
|
|
|
|
|
|
+ --n-caret-color: #ffffff !important;
|
|
.n-input__border,
|
|
.n-input__border,
|
|
.n-input__state-border {
|
|
.n-input__state-border {
|
|
display: none;
|
|
display: none;
|
|
}
|
|
}
|
|
.n-input__input-el {
|
|
.n-input__input-el {
|
|
text-align: center;
|
|
text-align: center;
|
|
- font-family: DINAlternate, DINAlternate !important;
|
|
|
|
|
|
+ font-family: DINA !important;
|
|
font-weight: bold !important;
|
|
font-weight: bold !important;
|
|
- font-size: 126px !important;
|
|
|
|
|
|
+ font-size: 136px !important;
|
|
color: #ffffff !important;
|
|
color: #ffffff !important;
|
|
|
|
+ &::selection {
|
|
|
|
+ background: #555252;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
&.n-input--disabled {
|
|
&.n-input--disabled {
|
|
cursor: initial;
|
|
cursor: initial;
|
|
@@ -360,25 +360,41 @@ function handleCountUpStart() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.timeInputBtn {
|
|
.timeInputBtn {
|
|
- width: 78px;
|
|
|
|
|
|
+ width: 100%;
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
- & > img {
|
|
|
|
- cursor: pointer;
|
|
|
|
- width: 12px;
|
|
|
|
- height: 8px;
|
|
|
|
- }
|
|
|
|
- &.palyDisabled > img {
|
|
|
|
- opacity: 0.4;
|
|
|
|
|
|
+ &.palyDisabled > div {
|
|
cursor: initial;
|
|
cursor: initial;
|
|
|
|
+ & > img {
|
|
|
|
+ opacity: 0.4;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ & > div {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ height: 20px;
|
|
|
|
+ width: 50%;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ &:first-child {
|
|
|
|
+ flex-direction: row-reverse;
|
|
|
|
+ & > img {
|
|
|
|
+ margin: 0 22px 0 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ & > img {
|
|
|
|
+ margin-left: 20px;
|
|
|
|
+ width: 12px;
|
|
|
|
+ height: 8px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.timeTools {
|
|
.timeTools {
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
- width: 138px;
|
|
|
|
|
|
+ min-width: 138px;
|
|
.timeType {
|
|
.timeType {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 40px;
|
|
height: 40px;
|
|
@@ -441,7 +457,7 @@ function handleCountUpStart() {
|
|
background: url('./img/timeNum.png') no-repeat;
|
|
background: url('./img/timeNum.png') no-repeat;
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
- font-size: 16px;
|
|
|
|
|
|
+ font-size: 18px;
|
|
color: #7c7c7c;
|
|
color: #7c7c7c;
|
|
line-height: 38px;
|
|
line-height: 38px;
|
|
text-align: center;
|
|
text-align: center;
|