Skip to content

Commit 6c8da1f

Browse files
committed
style: modify modules files path
1 parent b85775d commit 6c8da1f

File tree

5 files changed

+23
-19
lines changed

5 files changed

+23
-19
lines changed

src/components/IllestWaveform.vue

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script setup lang="ts">
22
import { 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'
54
import { formatSecond } from '../utils/format-time'
65
import {
76
lazyLoader,
@@ -71,7 +70,7 @@ function lazyLoadHandler() {
7170
const waveRef = ref<HTMLCanvasElement | null>(null)
7271
const ready = ref<boolean>(false)
7372
74-
let webAudioController: WebAudioController
73+
let webAudioController: AudioController
7574
let wave: Wave
7675
7776
// initialize waveform
@@ -86,7 +85,7 @@ async function init(): Promise<void> {
8685
8786
// initialize web audio
8887
async 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

src/modules/WebAudio/index.ts renamed to src/modules/Audio.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { IllestWaveformProps } from '../../types/waveform'
1+
import type { IllestWaveformProps } from '../types/waveform'
22

33
/**
44
* The WebAudio class creates a playable audio instance

src/modules/WebAudio/Controller.ts renamed to src/modules/AudioController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import WebAudio from './index'
2-
import type { IllestWaveformProps } from '../../types/waveform'
1+
import WebAudio from './Audio'
2+
import type { IllestWaveformProps } from '../types/waveform'
33

44
/**
55
* WebAudioController Class creates construct,

src/modules/wave/index.ts renamed to src/modules/Wave.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { IllestWaveformProps } from '../../types/waveform'
1+
import type { IllestWaveformProps } from '../types/waveform'
22

33
export default class Wave {
44
protected canvasCtx!: CanvasRenderingContext2D

src/modules/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Wave from './Wave'
2+
import WebAudio from './Audio'
3+
import AudioController from './AudioController'
4+
5+
export { Wave, WebAudio, AudioController }

0 commit comments

Comments
 (0)