0
0
Fork 0

Init Vue-CLI project files

This commit is contained in:
Tyler-A 2020-07-29 22:49:09 -06:00
parent c8e6e8700d
commit 491c9aa5c5
8 changed files with 11630 additions and 0 deletions

21
.eslintrc.js Normal file
View file

@ -0,0 +1,21 @@
module.exports = {
extends: [
// add more generic rulesets here, such as:
// 'eslint:recommended',
'plugin:vue/recommended'
],
rules: {
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
"vue/no-extra-semi": "off",
"vue/html-indent": "off",
"vue/max-attributes-per-line": ["error", {
"singleline": 2,
"multiline": {
"max": 2,
"allowFirstLine": false
}
}],
"vue/singleline-html-element-content-newline": "off"
}
}

5
babel.config.js Normal file
View file

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

25
deploy.sh Normal file
View file

@ -0,0 +1,25 @@
#!/bin/bash
# abort on errors
set -e
# build
npm run build
# navigate into the build output directory
cd dist
# if you are deploying to a custom domain
echo 'oliver.akins.me' > CNAME
git init
git add -A
git commit -m 'deploy'
# if you are deploying to https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
# if you are deploying to https://<USERNAME>.github.io/<REPO>
git push -f git@github.com:Oliver-Akins/top-lists.git master:gh-pages
cd -

11429
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

42
package.json Normal file
View file

@ -0,0 +1,42 @@
{
"name": "top-lists",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --copy",
"build": "vue-cli-service build --modern",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.4.0",
"@vue/cli-plugin-eslint": "~4.4.0",
"@vue/cli-service": "~4.4.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

19
public/index.html Normal file
View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Top Lists For Spotify</title>
<!-- Stylesheets -->
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@800&display=swap" rel="stylesheet">
</head>
<body>
<noscript>
<strong>We're sorry but this website doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

84
src/App.vue Normal file
View file

@ -0,0 +1,84 @@
<template>
<div class="maximize_size">
<LoginCard v-if="!is_authed" />
<MainView v-else />
</div>
</template>
<script>
// Import components
import LoginCard from './components/LoginCard.vue'
import MainView from './components/MainView.vue'
export default {
name: 'App',
components: {
"LoginCard": LoginCard,
"MainView": MainView
},
data: function () {
return {
params: null
}
},
computed: {
is_authed() {
let params = new URLSearchParams(window.location.hash.slice(1));
let qparams = new URLSearchParams(window.location.search.slice(1));
if ( qparams.get(`dev`) != null && qparams.get(`dev`) !== `false` ) {
return true;
} else if ( qparams.get(`preview`) != null && qparams.get(`preview`) !== `false`) {
return true
}
// Check to ensure the authorization was a success
if (params.get(`access_token`)) {
// this.get_user()
// // Check if we compare state
// if (this.use_state) {
// // Compare given state to localstorage state
// let LS_state = localStorage.getItem(`top-spotify-state`);
// if (LS_state == params.get(`state`)) {
// console.info(`State compare success`)
// return true
// }
// console.error(`State compare failed`)
// return false
// } else {
// return true
// }
return true
} else {
let error = (new URLSearchParams(window.location.search)).get(`error`)
// Authorization failed, error to the user
if (error !== null) {
window.location.hash = ``;
}
return false;
}
}
}
}
</script>
<style>
@import "./css/dark_theme.css";
html, body, .maximize_size {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow-x: hidden;
font-family: var(--fonts);
}
body {
background-color: var(--background);
color: var(--background-text);
}
</style>

5
vue.config.js Normal file
View file

@ -0,0 +1,5 @@
module.exports = {
publicPath: process.env.NODE_ENV === `production`
? `/top-lists/`
: `/`
}