|
@@ -11,6 +11,8 @@ import state, { refreshView, setCurrentTime } from '/src/pages/detail/runtime'
|
|
import detailState from '/src/pages/detail/state'
|
|
import detailState from '/src/pages/detail/state'
|
|
import iconFollwBtn from './icons/icon-follwBtn.png'
|
|
import iconFollwBtn from './icons/icon-follwBtn.png'
|
|
import { unitTestData } from '/src/subpages/colexiu/unitTest/index'
|
|
import { unitTestData } from '/src/subpages/colexiu/unitTest/index'
|
|
|
|
+import { formatPitch } from '/src/subpages/colexiu/buttons/evaluating'
|
|
|
|
+
|
|
// 显示或隐藏播放按钮
|
|
// 显示或隐藏播放按钮
|
|
const togglePlayer = (show: boolean = false) => {
|
|
const togglePlayer = (show: boolean = false) => {
|
|
let globalPlayer: HTMLElement = document.querySelector('#globalPlayer')!
|
|
let globalPlayer: HTMLElement = document.querySelector('#globalPlayer')!
|
|
@@ -147,6 +149,8 @@ const getNoteIndex = (): any => {
|
|
id: item.id,
|
|
id: item.id,
|
|
min: item.frequency - (item.frequency - item.noteElement.pitch.prevFrequency) * 0.1,
|
|
min: item.frequency - (item.frequency - item.noteElement.pitch.prevFrequency) * 0.1,
|
|
max: item.frequency + (item.noteElement.pitch.nextFrequency - item.frequency) * 0.1,
|
|
max: item.frequency + (item.noteElement.pitch.nextFrequency - item.frequency) * 0.1,
|
|
|
|
+ duration: item.duration,
|
|
|
|
+ baseFrequency: formatPitch(item.noteElement.pitch.frequency),
|
|
}
|
|
}
|
|
}
|
|
}
|
|
let checking = false
|
|
let checking = false
|
|
@@ -172,25 +176,30 @@ const checked = () => {
|
|
next()
|
|
next()
|
|
data.index += 1
|
|
data.index += 1
|
|
data.list = data.list.slice(i + 1)
|
|
data.list = data.list.slice(i + 1)
|
|
- setColor(item, true)
|
|
|
|
|
|
+ setColor(item, '', true)
|
|
checking = false
|
|
checking = false
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- setColor(item)
|
|
|
|
|
|
+ setColor(item, audioFrequency.value > item.baseFrequency ? 'follow-up' : 'follow-down')
|
|
checking = false
|
|
checking = false
|
|
}
|
|
}
|
|
-const setColor = (item: any, isRight = false) => {
|
|
|
|
|
|
+
|
|
|
|
+const setColor = (item: any, state: 'follow-up' | 'follow-down' | '', isRight = false) => {
|
|
const note: HTMLElement = document.querySelector(`div[data-vf=vf${item.id}]`)!
|
|
const note: HTMLElement = document.querySelector(`div[data-vf=vf${item.id}]`)!
|
|
if (note) {
|
|
if (note) {
|
|
|
|
+ note.classList.remove('follow-up', 'follow-down', 'follow-error', 'follow-success')
|
|
if (isRight) {
|
|
if (isRight) {
|
|
- note.classList.remove('follow-error')
|
|
|
|
note.classList.add('follow-success')
|
|
note.classList.add('follow-success')
|
|
} else {
|
|
} else {
|
|
- note.classList.remove('follow-success')
|
|
|
|
- note.classList.add('follow-error')
|
|
|
|
|
|
+ note.classList.add('follow-error', state)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ const _note: HTMLElement = document.getElementById(`vf-${item.id}`)!
|
|
|
|
+ if (_note) {
|
|
|
|
+ _note.classList.remove('follow-up', 'follow-down')
|
|
|
|
+ state && _note.classList.add(state)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|