fix: visualizer stopped working

This commit is contained in:
Phan An 2022-10-09 10:32:22 +02:00
parent 36a32145fc
commit fcd836edc9
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
4 changed files with 1703 additions and 1854 deletions

View file

@ -61,7 +61,7 @@ const value = computed({
}
}
@media only screen and(max-width: 768px) {
@media only screen and (max-width: 768px) {
margin-top: 8px;
}
}

View file

@ -13,7 +13,7 @@
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import initVisualizer from '@/utils/visualizer'
import { eventBus } from '@/utils'
import { eventBus, logger } from '@/utils'
import CloseModalBtn from '@/components/ui/BtnCloseModal.vue'
@ -31,6 +31,7 @@ onMounted(() => {
try {
initVisualizer(el.value!)
} catch (e) {
logger.warn('Failed to initialize visualizer', e)
// in e.g., DOM testing, the call will fail due to the lack of proper API support
}
})

View file

@ -161,7 +161,7 @@ export default (container: HTMLElement) => {
Sketch.create({
container,
particles: [],
init () {
setup () {
// generate some particles
for (let i = 0; i < NUM_PARTICLES; i++) {
const particle = new Particle(random(this.width), random(this.height))
@ -170,7 +170,6 @@ export default (container: HTMLElement) => {
this.particles.push(particle)
}
// setup the audio analyser
const analyser = new AudioAnalyser(NUM_BANDS, SMOOTHING)
// update particles based on fft transformed audio frequencies

3549
yarn.lock

File diff suppressed because it is too large Load diff