mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-19 06:28:05 +00:00
Refactor entire app structure
This commit is contained in:
151
src/components/HelloWorld.vue
Normal file
151
src/components/HelloWorld.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<v-container>
|
||||
<v-row class="text-center">
|
||||
<v-col cols="12">
|
||||
<v-img
|
||||
:src="require('../assets/logo.svg')"
|
||||
class="my-3"
|
||||
contain
|
||||
height="200"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col class="mb-4">
|
||||
<h1 class="display-2 font-weight-bold mb-3">
|
||||
Welcome to Vuetify
|
||||
</h1>
|
||||
|
||||
<p class="subheading font-weight-regular">
|
||||
For help and collaboration with other Vuetify developers,
|
||||
<br>please join our online
|
||||
<a
|
||||
href="https://community.vuetifyjs.com"
|
||||
target="_blank"
|
||||
>Discord Community</a>
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
class="mb-5"
|
||||
cols="12"
|
||||
>
|
||||
<h2 class="headline font-weight-bold mb-3">
|
||||
What's next?
|
||||
</h2>
|
||||
|
||||
<v-row justify="center">
|
||||
<a
|
||||
v-for="(next, i) in whatsNext"
|
||||
:key="i"
|
||||
:href="next.href"
|
||||
class="subheading mx-3"
|
||||
target="_blank"
|
||||
>
|
||||
{{ next.text }}
|
||||
</a>
|
||||
</v-row>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
class="mb-5"
|
||||
cols="12"
|
||||
>
|
||||
<h2 class="headline font-weight-bold mb-3">
|
||||
Important Links
|
||||
</h2>
|
||||
|
||||
<v-row justify="center">
|
||||
<a
|
||||
v-for="(link, i) in importantLinks"
|
||||
:key="i"
|
||||
:href="link.href"
|
||||
class="subheading mx-3"
|
||||
target="_blank"
|
||||
>
|
||||
{{ link.text }}
|
||||
</a>
|
||||
</v-row>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
class="mb-5"
|
||||
cols="12"
|
||||
>
|
||||
<h2 class="headline font-weight-bold mb-3">
|
||||
Ecosystem
|
||||
</h2>
|
||||
|
||||
<v-row justify="center">
|
||||
<a
|
||||
v-for="(eco, i) in ecosystem"
|
||||
:key="i"
|
||||
:href="eco.href"
|
||||
class="subheading mx-3"
|
||||
target="_blank"
|
||||
>
|
||||
{{ eco.text }}
|
||||
</a>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'HelloWorld',
|
||||
|
||||
data: () => ({
|
||||
ecosystem: [
|
||||
{
|
||||
text: 'vuetify-loader',
|
||||
href: 'https://github.com/vuetifyjs/vuetify-loader'
|
||||
},
|
||||
{
|
||||
text: 'github',
|
||||
href: 'https://github.com/vuetifyjs/vuetify'
|
||||
},
|
||||
{
|
||||
text: 'awesome-vuetify',
|
||||
href: 'https://github.com/vuetifyjs/awesome-vuetify'
|
||||
}
|
||||
],
|
||||
importantLinks: [
|
||||
{
|
||||
text: 'Documentation',
|
||||
href: 'https://vuetifyjs.com'
|
||||
},
|
||||
{
|
||||
text: 'Chat',
|
||||
href: 'https://community.vuetifyjs.com'
|
||||
},
|
||||
{
|
||||
text: 'Made with Vuetify',
|
||||
href: 'https://madewithvuejs.com/vuetify'
|
||||
},
|
||||
{
|
||||
text: 'Twitter',
|
||||
href: 'https://twitter.com/vuetifyjs'
|
||||
},
|
||||
{
|
||||
text: 'Articles',
|
||||
href: 'https://medium.com/vuetify'
|
||||
}
|
||||
],
|
||||
whatsNext: [
|
||||
{
|
||||
text: 'Explore components',
|
||||
href: 'https://vuetifyjs.com/components/api-explorer'
|
||||
},
|
||||
{
|
||||
text: 'Select a layout',
|
||||
href: 'https://vuetifyjs.com/getting-started/pre-made-layouts'
|
||||
},
|
||||
{
|
||||
text: 'Frequently Asked Questions',
|
||||
href: 'https://vuetifyjs.com/getting-started/frequently-asked-questions'
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@@ -1,25 +0,0 @@
|
||||
<template>
|
||||
<v-container>
|
||||
<v-form v-model="valid">
|
||||
<v-text-field
|
||||
v-model="username"
|
||||
label="Username"
|
||||
required
|
||||
/>
|
||||
|
||||
<v-text-field
|
||||
v-model="password"
|
||||
label="Password"
|
||||
type="password"
|
||||
required
|
||||
/>
|
||||
|
||||
<v-btn
|
||||
class="mr-4"
|
||||
type="submit"
|
||||
>
|
||||
Submit
|
||||
</v-btn>
|
||||
</v-form>
|
||||
</v-container>
|
||||
</template>
|
||||
@@ -1,39 +1,39 @@
|
||||
import { Filter, Noise, Transport } from "tone";
|
||||
import { Filter, Noise, Transport } from 'tone'
|
||||
|
||||
export default {
|
||||
name: "Noise",
|
||||
name: 'Noise',
|
||||
|
||||
data: () => ({
|
||||
startDisabled: false,
|
||||
isTimerEnabled: false,
|
||||
noiseDuration: 60,
|
||||
timeRemaining: 0,
|
||||
noiseColorOptions: ["pink", "white", "brown"],
|
||||
noiseColor: "pink",
|
||||
noiseColorOptions: ['pink', 'white', 'brown'],
|
||||
noiseColor: 'pink',
|
||||
noiseVolume: -10,
|
||||
isFilterEnabled: false,
|
||||
frequencyCutoff: 20000,
|
||||
filterTypeOptions: ["lowpass", "highpass", "bandpass", "lowshelf", "highshelf", "notch", "allpass", "peaking"],
|
||||
filterType: "lowpass",
|
||||
filterTypeOptions: ['lowpass', 'highpass', 'bandpass', 'lowshelf', 'highshelf', 'notch', 'allpass', 'peaking'],
|
||||
filterType: 'lowpass',
|
||||
rules: {
|
||||
number: value => !isNaN(parseInt(value, 10)) || 'Invalid number',
|
||||
negative: value => (!isNaN(parseInt(value, 10)) && value <= 0) || "Can't be greater than 0"
|
||||
}
|
||||
}),
|
||||
created() {
|
||||
created () {
|
||||
this.noise = new Noise()
|
||||
this.filter = new Filter()
|
||||
},
|
||||
methods: {
|
||||
playNoise() {
|
||||
playNoise () {
|
||||
this.startDisabled = true
|
||||
Transport.cancel()
|
||||
|
||||
if (this.isFilterEnabled) {
|
||||
this.filter = new Filter(this.frequencyCutoff, this.filterType).toDestination()
|
||||
this.noise = new Noise({volume: this.noiseVolume, type: this.noiseColor}).connect(this.filter)
|
||||
this.noise = new Noise({ volume: this.noiseVolume, type: this.noiseColor }).connect(this.filter)
|
||||
} else {
|
||||
this.noise = new Noise({volume: this.noiseVolume, type: this.noiseColor}).toDestination()
|
||||
this.noise = new Noise({ volume: this.noiseVolume, type: this.noiseColor }).toDestination()
|
||||
}
|
||||
|
||||
if (this.isTimerEnabled) {
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
|
||||
Transport.start()
|
||||
},
|
||||
stopTransport() {
|
||||
stopTransport () {
|
||||
clearInterval(this.transportInterval)
|
||||
Transport.stop()
|
||||
this.startDisabled = false
|
||||
@@ -56,14 +56,14 @@ export default {
|
||||
clearInterval(this.timeRemainingInterval)
|
||||
this.timeRemaining = 0
|
||||
},
|
||||
startTimer() {
|
||||
startTimer () {
|
||||
this.timeRemaining -= 1
|
||||
},
|
||||
updateVolume() {
|
||||
updateVolume () {
|
||||
this.noise.volume.value = this.noiseVolume
|
||||
},
|
||||
updateNoiseColor() {
|
||||
updateNoiseColor () {
|
||||
this.noise.type = this.noiseColor
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user