11<script setup lang="ts">
22import { ref , onMounted , watchEffect , onUnmounted } from ' vue'
3- import WebAudioController from ' ../modules/WebAudio/Controller'
4- import Wave from ' ../modules/Wave/index'
3+ import { Wave , AudioController } from ' ../modules'
54import { formatSecond } from ' ../utils/format-time'
65import {
76 lazyLoader ,
@@ -71,7 +70,7 @@ function lazyLoadHandler() {
7170const waveRef = ref <HTMLCanvasElement | null >(null )
7271const ready = ref <boolean >(false )
7372
74- let webAudioController: WebAudioController
73+ let webAudioController: AudioController
7574let wave: Wave
7675
7776// initialize waveform
@@ -86,7 +85,7 @@ async function init(): Promise<void> {
8685
8786// initialize web audio
8887async function initAudio(): Promise <void > {
89- webAudioController = new WebAudioController (props )
88+ webAudioController = new AudioController (props )
9089 await webAudioController .setupAudio ()
9190 watchIsFinish ()
9291}
@@ -198,44 +197,44 @@ defineExpose({
198197
199198<template >
200199 <section
201- id =" ill -wave-container"
200+ id =" illest -wave-container"
202201 ref =" waveformContainer"
203202 @mousemove =" mouseMoveHandler"
204203 @click =" clickHandler"
205204 >
206205 <transition name =" fade" >
207206 <div
208207 v-show =" props.skeleton && !ready"
209- id =" ill -skeleton"
208+ id =" illest -skeleton"
210209 :style =" `background-color: ${skeletonColor}`"
211210 >
212211 <div
213212 v-show =" !ready"
214- id =" ill -skeleton__load"
213+ id =" illest -skeleton__load"
215214 :style =" `background-color: ${skeletonColor}`"
216215 />
217216 </div >
218217 </transition >
219218
220- <canvas id =" ill -wave" ref =" waveRef" />
219+ <canvas id =" illest -wave" ref =" waveRef" />
221220
222221 <div
223222 v-show =" ready && props.interact"
224- id =" ill -cursor"
223+ id =" illest -cursor"
225224 :style =" `width:${props.cursorWidth}px; transform: translateX(${moveX}px);background-color: ${props.cursorColor}; `"
226225 />
227226 </section >
228227</template >
229228
230229<style scoped>
231- #ill -wave-container {
230+ #illest -wave-container {
232231 position : relative ;
233232 width : 100% ;
234233 height : 100% ;
235234 overflow : hidden ;
236235}
237236
238- #ill -wave-container > #ill -skeleton {
237+ #illest -wave-container > #illest -skeleton {
239238 position : absolute ;
240239 left : 0 ;
241240 top : 0 ;
@@ -246,7 +245,7 @@ defineExpose({
246245 z-index : 0 ;
247246}
248247
249- #ill -wave-container > #ill -skeleton > #ill -skeleton__load {
248+ #illest -wave-container > #illest -skeleton > #illest -skeleton__load {
250249 background-image : linear-gradient (
251250 to right ,
252251 rgba (0 , 0 , 0 , 0 ) 0% ,
@@ -258,13 +257,13 @@ defineExpose({
258257 animation : skeleton-load 2.5s ease 0s infinite ;
259258}
260259
261- #ill -wave-container > #ill -wave {
260+ #illest -wave-container > #illest -wave {
262261 width : inherit ;
263262 height : inherit ;
264263 opacity : 0 ;
265264}
266265
267- #ill -wave-container > #ill -cursor {
266+ #illest -wave-container > #illest -cursor {
268267 position : absolute ;
269268 height : inherit ;
270269 left : 0px ;
@@ -274,7 +273,7 @@ defineExpose({
274273 cursor : pointer ;
275274}
276275
277- #ill -wave-container :hover #ill -cursor {
276+ #illest -wave-container :hover #illest -cursor {
278277 opacity : 1 ;
279278}
280279
0 commit comments