Initial Commit
This commit is contained in:
23
app/.gitignore
vendored
Normal file
23
app/.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
24
app/README.md
Normal file
24
app/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# app
|
||||
|
||||
## Project setup
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
yarn serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
yarn build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
5
app/babel.config.js
Normal file
5
app/babel.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
44
app/package.json
Normal file
44
app/package.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "quelea-web",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource/lato": "^4.5.0",
|
||||
"core-js": "^3.6.5",
|
||||
"vue": "^2.6.11",
|
||||
"vue-sse": "^2.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.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"
|
||||
]
|
||||
}
|
BIN
app/public/favicon.ico
Normal file
BIN
app/public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
17
app/public/index.html
Normal file
17
app/public/index.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<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">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> 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>
|
94
app/src/App.vue
Normal file
94
app/src/App.vue
Normal file
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<!-- Title Here -->
|
||||
<Lyrics id="lyrics" :lyrics="lyrics"/>
|
||||
<img id="logo" src="./assets/logo.png">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import "@fontsource/lato";
|
||||
import Lyrics from './components/Lyrics.vue'
|
||||
|
||||
let sseClient;
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
Lyrics
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
lyrics: ""
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
sseClient = this.$sse.create();
|
||||
|
||||
// Catch any errors (ie. lost connections, etc.)
|
||||
sseClient.on('error', (e) => {
|
||||
console.error('Server threw an error or the connection was lost.', e);
|
||||
|
||||
// If this error is due to an unexpected disconnection, EventSource will
|
||||
// automatically attempt to reconnect indefinitely. You will _not_ need to
|
||||
// re-add your handlers.
|
||||
});
|
||||
|
||||
// Handle messages without a specific event
|
||||
sseClient.on('message', this.handleMessage);
|
||||
|
||||
sseClient.connect()
|
||||
.then(() => {
|
||||
console.log('Connected to SSE server.');
|
||||
})
|
||||
.catch((err) => {
|
||||
// When this error is caught, it means the initial connection to the
|
||||
// events server failed. No automatic attempts to reconnect will be made.
|
||||
console.error('Failed to connect to server.', err);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
handleMessage(message) {
|
||||
if (!(this.lyrics === message)) {
|
||||
console.log(message);
|
||||
this.lyrics = message;
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
// Make sure to close the connection with the events server
|
||||
// when the component is destroyed, or we'll have ghost connections!
|
||||
sseClient.disconnect();
|
||||
|
||||
// Alternatively, we could have added the `sse: { cleanup: true }` option to our component,
|
||||
// and the SSEManager would have automatically disconnected during beforeDestroy.
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #419567;
|
||||
}
|
||||
#app {
|
||||
font-family: "Lato";
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: white;
|
||||
}
|
||||
#logo {
|
||||
position: absolute;
|
||||
left: 25px;
|
||||
bottom: 25px;
|
||||
height: 100px;
|
||||
}
|
||||
#lyrics {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
BIN
app/src/assets/logo.png
Normal file
BIN
app/src/assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
20
app/src/components/Lyrics.vue
Normal file
20
app/src/components/Lyrics.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<p class="lyrics" v-html="lyrics">}</p>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: [
|
||||
'lyrics'
|
||||
]
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.lyrics {
|
||||
font-size: 5em;
|
||||
font-weight: 800;
|
||||
text-align: center;
|
||||
text-shadow: 2px 2px 5px rgba(0,0,0,0.6);
|
||||
}
|
||||
</style>
|
13
app/src/main.js
Normal file
13
app/src/main.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import Vue from 'vue'
|
||||
import VueSSE from 'vue-sse';
|
||||
import App from './App.vue'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
Vue.use(VueSSE, {
|
||||
url: '/lowerthirdsserver',
|
||||
});
|
||||
|
||||
new Vue({
|
||||
render: h => h(App),
|
||||
}).$mount('#app')
|
5
app/vue.config.js
Normal file
5
app/vue.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
devServer: {
|
||||
proxy: 'http://localhost:3000'
|
||||
}
|
||||
}
|
8558
app/yarn.lock
Normal file
8558
app/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user