From 1edde69a22f1a2d2d7bf4f1c61a2faceb84c8e70 Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Mon, 9 Aug 2021 22:50:21 -0700 Subject: [PATCH] Overhaul UI --- src/components/Admin.vue | 120 +++++----- src/components/Noise.vue | 492 ++++++++++++++++++++++----------------- src/components/noise.js | 28 ++- 3 files changed, 361 insertions(+), 279 deletions(-) diff --git a/src/components/Admin.vue b/src/components/Admin.vue index b7d29c1..f9cd068 100644 --- a/src/components/Admin.vue +++ b/src/components/Admin.vue @@ -1,70 +1,72 @@ diff --git a/src/components/Noise.vue b/src/components/Noise.vue index 1d68c1b..4e77ec7 100644 --- a/src/components/Noise.vue +++ b/src/components/Noise.vue @@ -1,19 +1,276 @@ diff --git a/src/components/noise.js b/src/components/noise.js index e0919f3..0cbb8f0 100644 --- a/src/components/noise.js +++ b/src/components/noise.js @@ -4,13 +4,17 @@ export default { name: 'Noise', data: () => ({ + isTimerValid: false, selectedProfile: {}, profileItems: [], profileDialog: false, profileName: '', playDisabled: false, isTimerEnabled: false, - duration: 60, + hours: 0, + minutes: 0, + seconds: 30, + duration: 30, timeRemaining: 0, noiseColor: 'pink', noiseColorItems: ['pink', 'white', 'brown'], @@ -20,13 +24,21 @@ export default { filterType: 'lowpass', filterTypeItems: ['lowpass', 'highpass', 'bandpass', 'lowshelf', 'highshelf', 'notch', 'allpass', 'peaking'], isLFOFilterCutoffEnabled: false, - lfoFilterCutoffFrequency: 1, + lfoFilterCutoffFrequency: 0.5, lfoFilterCutoffMin: 0, lfoFilterCutoffMax: 20000, - lfoFilterCutoffRange: [100, 1000], + lfoFilterCutoffRange: [100, 5000], isTremoloEnabled: false, tremoloFrequency: 0.5, - tremoloDepth: 0.5 + tremoloDepth: 0.5, + rules: { + lt (n) { + return value => (!isNaN(parseInt(value, 10)) && value < n) || 'Must be less than ' + n + }, + gt (n) { + return value => (!isNaN(parseInt(value, 10)) && value > n) || 'Must be greater than ' + n + } + } }), created () { this.noise = new Noise() @@ -61,10 +73,15 @@ export default { } if (this.isTimerEnabled) { + console.log(this.hours) + console.log(this.minutes) + console.log(this.seconds) + this.duration = parseInt((this.hours * 3600)) + parseInt((this.minutes * 60)) + parseInt(this.seconds) + console.log(this.duration) this.noise.sync().start(0).stop(this.duration) Transport.loopEnd = this.duration this.timeRemaining = this.duration - this.transportInterval = setInterval(() => this.stopTransport(), this.duration * 1000 + 100) + this.transportInterval = setInterval(() => this.stop(), this.duration * 1000 + 100) this.timeRemainingInterval = setInterval(() => this.startTimer(), 1000) } else { this.noise.sync().start(0) @@ -79,6 +96,7 @@ export default { clearInterval(this.timeRemainingInterval) this.timeRemaining = 0 + this.duration = 0 }, startTimer () { this.timeRemaining -= 1