Refactor entire app structure

This commit is contained in:
Kevin Thomas
2021-07-21 17:20:44 -07:00
parent 5f120e12bc
commit 3572d69cba
16 changed files with 3176 additions and 2042 deletions

3
.browserslistrc Normal file
View File

@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

View File

@@ -1,22 +1,17 @@
module.exports = {
extends: [
// add more generic rulesets here, such as:
"eslint:recommended",
// 'plugin:vue/vue3-recommended',
"plugin:vue/recommended" // Use this if you are using Vue.js 2.x.
],
rules: {
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
"eol-last": 1
},
"env": {
"node": true
},
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "babel-eslint",
"ecmaVersion": 8,
"sourceType": "module"
}
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential',
'@vue/standard'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}

4864
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "^4.5.13",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/eslint-config-standard": "^5.1.2",
@@ -40,25 +40,5 @@
"vue-cli-plugin-vuetify": "~2.4.1",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.7.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended",
"@vue/standard"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
}

View File

@@ -38,4 +38,3 @@ app.use('/myaccount', myaccountRouter);
app.use('/users', usersRouter);
module.exports = app;

View File

@@ -1,16 +1,8 @@
<template>
<v-app>
<AppBar />
<AppBar />
<v-main>
<v-container fluid>
<router-link to="/">
Home
</router-link> |
<router-link to="/login">
Login
</router-link>
<router-view />
</v-container>
<router-view/>
</v-main>
</v-app>
</template>
@@ -22,11 +14,11 @@ export default {
name: 'App',
components: {
AppBar,
AppBar
},
data: () => ({
//
}),
})
}
</script>

View File

@@ -1,26 +0,0 @@
<template>
<v-app>
<v-main>
<AppBar />
<Noise />
</v-main>
</v-app>
</template>
<script>
import Noise from './components/Noise'
import AppBar from './components/AppBar'
export default {
name: 'App',
components: {
AppBar,
Noise,
},
data: () => ({
//
}),
}
</script>

View 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>

View File

@@ -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>

View File

@@ -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
}
},
}
}

View File

@@ -1,12 +1,12 @@
import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify'
import router from './router'
import vuetify from './plugins/vuetify'
Vue.config.productionTip = false
new Vue({
vuetify,
router,
vuetify,
render: h => h(App)
}).$mount('#app')

View File

@@ -1,8 +1,7 @@
import Vue from 'vue';
import Vuetify from 'vuetify/lib/framework';
import Vue from 'vue'
import Vuetify from 'vuetify/lib/framework'
Vue.use(Vuetify);
Vue.use(Vuetify)
export default new Vuetify({
theme: { dark: false },
});
})

View File

@@ -11,12 +11,12 @@ const routes = [
component: Home
},
{
path: '/login',
name: 'LoginView',
path: '/about',
name: 'About',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
}
]

5
src/views/About.vue Normal file
View File

@@ -0,0 +1,5 @@
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>

View File

@@ -3,11 +3,11 @@
</template>
<script>
// @ is an alias to /src
import Noise from '@/components/Noise'
import Noise from '../components/Noise'
export default {
name: 'Home',
components: {
Noise
}

View File

@@ -1,15 +0,0 @@
<template>
<Login />
</template>
<script>
// @ is an alias to /src
import Login from '@/components/Login'
export default {
name: 'LoginView',
components: {
Login
}
}
</script>