Added waiting room feature
This commit is contained in:
parent
db00fbf45d
commit
d939e14c40
10 changed files with 473 additions and 471 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
node_modules
|
||||||
|
dist
|
871
package-lock.json
generated
871
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "foundation-vue",
|
"name": "syng-web",
|
||||||
"version": "0.0.0",
|
"version": "2.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
|
|
@ -80,9 +80,6 @@ function append(entry) {
|
||||||
checked_append_with_name(entry, state.value.name)
|
checked_append_with_name(entry, state.value.name)
|
||||||
}
|
}
|
||||||
function checked_append_with_name(entry, name) {
|
function checked_append_with_name(entry, name) {
|
||||||
console.log("checked_append_with_name")
|
|
||||||
console.log(entry)
|
|
||||||
console.log(name)
|
|
||||||
if(name == "" || name == null) {
|
if(name == "" || name == null) {
|
||||||
state.value.current_entry = entry;
|
state.value.current_entry = entry;
|
||||||
state.value.current_name = "";
|
state.value.current_name = "";
|
||||||
|
@ -97,7 +94,8 @@ function checked_append_with_name(entry, name) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(in_queue) {
|
if(in_queue && !state.value.admin) {
|
||||||
|
state.value.current_entry = entry;
|
||||||
$("#alreadyqueued").foundation("open");
|
$("#alreadyqueued").foundation("open");
|
||||||
} else {
|
} else {
|
||||||
raw_append(entry.ident, name, entry.source, state.value.uid);
|
raw_append(entry.ident, name, entry.source, state.value.uid);
|
||||||
|
@ -121,7 +119,6 @@ function wait_append(ident, name, source, uid) {
|
||||||
|
|
||||||
state.value.current_name = null;
|
state.value.current_name = null;
|
||||||
state.value.current_entry = null;
|
state.value.current_entry = null;
|
||||||
console.log(name)
|
|
||||||
state.socket.emit("waiting-room-append", {"ident": ident, "performer": name, "source": source, "uid": uid });
|
state.socket.emit("waiting-room-append", {"ident": ident, "performer": name, "source": source, "uid": uid });
|
||||||
$("#queue-tab-title").click();
|
$("#queue-tab-title").click();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
li {
|
li {
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
margin-left: 0.2em;
|
/* margin-left: 0.2em; */
|
||||||
margin-right: 0.2em;
|
/* margin-right: 0.2em; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
|
@ -10,7 +10,7 @@ li {
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
background-color: #008000;
|
background-color: #008000 !important;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
@ -4,10 +4,23 @@ const emits = defineEmits(["append", "wait", "cancel"])
|
||||||
<template>
|
<template>
|
||||||
<div class="reveal" id="alreadyqueued" data-reveal >
|
<div class="reveal" id="alreadyqueued" data-reveal >
|
||||||
<h1>You are already in queue</h1>
|
<h1>You are already in queue</h1>
|
||||||
<p>While you can append the song anyway, you can also queue it to the "waiting room".</p>
|
<p>While you can append the song anyway, you can also add it to the <i>waiting room</i>.</p>
|
||||||
<p>It will be appended to the queue as soon, as your next song leaves the queue.</p>
|
<p>It will be appended to the queue as soon, as your next song leaves the queue.</p>
|
||||||
<button class="button" @click="$emit('append')">Append</button>
|
<div class="grid-x">
|
||||||
<button class="button" @click="$emit('wait')">Waiting Room</button>
|
<div class="cell medium-6 small-12 btn">
|
||||||
<button class="button" @click="$emit('cancel')">Abort</button>
|
<button class="button expanded" @click="$emit('wait')">Waiting room</button>
|
||||||
|
</div>
|
||||||
|
<div class="cell medium-6 small-12 btn">
|
||||||
|
<button class="button expanded" @click="$emit('append')">Append anyway</button>
|
||||||
|
</div>
|
||||||
|
<div class="cell medium-12 small-12 btn">
|
||||||
|
<button class="button expanded alert" @click="$emit('cancel')">Cancel</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.btn {
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
const props = defineProps(['admin', 'entry', 'current', 'firstStartedAt', 'offset', 'currentTime', 'additionalClass'])
|
const props = defineProps(['admin', 'entry', 'current', 'firstStartedAt', 'offset', 'currentTime', 'waitingRoom'])
|
||||||
const emits = defineEmits(['skip', 'skipCurrent', 'moveUp'])
|
const emits = defineEmits(['skip', 'skipCurrent', 'moveUp'])
|
||||||
|
|
||||||
function skip() {
|
function skip() {
|
||||||
|
@ -27,13 +27,13 @@ const eta = computed(() =>{
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<li :class="[{ current: current }, additionalClass]">
|
<li :class="[{ current: current }, {waitingRoom: waitingRoom}]">
|
||||||
<div class="grid-x">
|
<div class="grid-x">
|
||||||
<div class="cell" :class="{'small-9': admin}">
|
<div class="cell" :class="{'small-9': admin}">
|
||||||
<span class="artist">{{ entry.artist }}</span>
|
<span class="artist">{{ entry.artist }}</span>
|
||||||
<span class="title">{{ entry.title }}</span><br />
|
<span class="title">{{ entry.title }}</span><br />
|
||||||
<span class="performer">{{ entry.performer }} [{{ entry.uid }}]</span>
|
<span class="performer">{{ entry.performer }}</span>
|
||||||
<span v-if="!current && eta" class="eta">{{ eta }}</span>
|
<span v-if="!current && !waitingRoom" class="eta">{{ eta }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="admin" class="cell small-3">
|
<div v-if="admin" class="cell small-3">
|
||||||
<button class="button alert fright" @click="skip">
|
<button class="button alert fright" @click="skip">
|
||||||
|
@ -41,7 +41,7 @@ const eta = computed(() =>{
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="button alert fright"
|
class="button alert fright"
|
||||||
v-if="!current"
|
v-if="!current && !waitingRoom"
|
||||||
@click="$emit('moveUp', entry.uuid)" >
|
@click="$emit('moveUp', entry.uuid)" >
|
||||||
<font-awesome-icon icon="fa-solid fa-arrow-up" />
|
<font-awesome-icon icon="fa-solid fa-arrow-up" />
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -42,13 +42,13 @@ function offset(index) {
|
||||||
@moveUp="(uuid) => $emit('moveUp', uuid)"
|
@moveUp="(uuid) => $emit('moveUp', uuid)"
|
||||||
/>
|
/>
|
||||||
</ul>
|
</ul>
|
||||||
|
<div class="header">Waiting room</div>
|
||||||
<ul id="waiting_room" class="vertical menu">
|
<ul id="waiting_room" class="vertical menu">
|
||||||
<li class="heading">Waiting room</li>
|
|
||||||
<Entry
|
<Entry
|
||||||
v-for="(entry, index) in waiting_room"
|
v-for="(entry, index) in waiting_room"
|
||||||
:entry="entry"
|
:entry="entry"
|
||||||
:admin="admin"
|
:admin="admin"
|
||||||
class="waitingRoom"
|
:waitingRoom="true"
|
||||||
@skip="(uuid) => $emit('skip', uuid)"
|
@skip="(uuid) => $emit('skip', uuid)"
|
||||||
@skipCurrent="$emit('skipCurrent')"
|
@skipCurrent="$emit('skipCurrent')"
|
||||||
@moveUp="(uuid) => $emit('moveUp', uuid)"
|
@moveUp="(uuid) => $emit('moveUp', uuid)"
|
||||||
|
@ -59,15 +59,6 @@ function offset(index) {
|
||||||
</template>
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
#waiting_room {
|
|
||||||
background: repeating-linear-gradient(
|
|
||||||
45deg,
|
|
||||||
#000000,
|
|
||||||
#000000 10px,
|
|
||||||
#004000 10px,
|
|
||||||
#004000 20px
|
|
||||||
);
|
|
||||||
}
|
|
||||||
#waiting_room li{
|
#waiting_room li{
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
@ -75,4 +66,8 @@ function offset(index) {
|
||||||
background: #00ff00;
|
background: #00ff00;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.menu {
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -14,6 +14,9 @@ const emits = defineEmits(['append'])
|
||||||
<a class="button alert fright" target="_blank" rel="noreferrer noopener" :href="result.ident" v-if="result.source == 'youtube'">
|
<a class="button alert fright" target="_blank" rel="noreferrer noopener" :href="result.ident" v-if="result.source == 'youtube'">
|
||||||
<font-awesome-icon icon="fa-brands fa-youtube" />
|
<font-awesome-icon icon="fa-brands fa-youtube" />
|
||||||
</a>
|
</a>
|
||||||
|
<!-- <button class="button fright" @click="$emit('append')"> -->
|
||||||
|
<!-- <font-awesome-icon icon="fa-solid fa-chair" /> -->
|
||||||
|
<!-- </button> -->
|
||||||
<button class="button fright" @click="$emit('append')">
|
<button class="button fright" @click="$emit('append')">
|
||||||
<font-awesome-icon icon="fa-solid fa-plus" />
|
<font-awesome-icon icon="fa-solid fa-plus" />
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -6,7 +6,7 @@ import App from './App.vue'
|
||||||
import Main from './Main.vue'
|
import Main from './Main.vue'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
||||||
import { faMagnifyingGlass, faList, faArrowUp, faHistory, faPlus, faStepForward, faTimes } from '@fortawesome/free-solid-svg-icons'
|
import { faMagnifyingGlass, faList, faChair, faArrowUp, faHistory, faPlus, faStepForward, faTimes } from '@fortawesome/free-solid-svg-icons'
|
||||||
import { faYoutube } from '@fortawesome/free-brands-svg-icons'
|
import { faYoutube } from '@fortawesome/free-brands-svg-icons'
|
||||||
|
|
||||||
import 'foundation-sites/dist/css/foundation.min.css'
|
import 'foundation-sites/dist/css/foundation.min.css'
|
||||||
|
@ -19,6 +19,7 @@ library.add(faStepForward)
|
||||||
library.add(faYoutube)
|
library.add(faYoutube)
|
||||||
library.add(faTimes)
|
library.add(faTimes)
|
||||||
library.add(faArrowUp)
|
library.add(faArrowUp)
|
||||||
|
library.add(faChair)
|
||||||
|
|
||||||
window.jQuery = jquery;
|
window.jQuery = jquery;
|
||||||
window.$ = jquery;
|
window.$ = jquery;
|
||||||
|
|
Loading…
Add table
Reference in a new issue