mirror of https://github.com/bra1n/townsquare.git
add global audio mute entry to grimoire menu
This commit is contained in:
parent
cd6cf1ed4a
commit
9b94c2f51d
|
@ -76,6 +76,13 @@
|
||||||
Background image
|
Background image
|
||||||
<em><font-awesome-icon icon="image"/></em>
|
<em><font-awesome-icon icon="image"/></em>
|
||||||
</li>
|
</li>
|
||||||
|
<li @click="toggleMute">
|
||||||
|
Mute Sounds
|
||||||
|
<em
|
||||||
|
><font-awesome-icon
|
||||||
|
:icon="['fas', grimoire.isMuted ? 'volume-mute' : 'volume-up']"
|
||||||
|
/></em>
|
||||||
|
</li>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="tab === 'session'">
|
<template v-if="tab === 'session'">
|
||||||
|
@ -215,6 +222,9 @@ export default {
|
||||||
this.$store.commit("setBackground", background);
|
this.$store.commit("setBackground", background);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toggleMute() {
|
||||||
|
this.$store.commit("setIsMuted", !this.grimoire.isMuted);
|
||||||
|
},
|
||||||
hostSession() {
|
hostSession() {
|
||||||
if (this.session.sessionId) return;
|
if (this.session.sessionId) return;
|
||||||
const sessionId = prompt(
|
const sessionId = prompt(
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<span class="nominator" :style="nominatorStyle"></span>
|
<span class="nominator" :style="nominatorStyle"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="overlay">
|
<div class="overlay">
|
||||||
<audio src="../assets/sounds/countdown.mp3"></audio>
|
<audio src="../assets/sounds/countdown.mp3" preload="auto"></audio>
|
||||||
<em class="blue">{{ nominator.name }}</em> nominated
|
<em class="blue">{{ nominator.name }}</em> nominated
|
||||||
<em>{{ nominee.name }}</em
|
<em>{{ nominee.name }}</em
|
||||||
>!
|
>!
|
||||||
|
@ -99,7 +99,11 @@
|
||||||
<span>2</span>
|
<span>2</span>
|
||||||
<span>1</span>
|
<span>1</span>
|
||||||
<span>GO</span>
|
<span>GO</span>
|
||||||
<audio autoplay src="../assets/sounds/countdown.mp3"></audio>
|
<audio
|
||||||
|
:autoplay="!grimoire.isMuted"
|
||||||
|
src="../assets/sounds/countdown.mp3"
|
||||||
|
:muted="grimoire.isMuted"
|
||||||
|
></audio>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
|
@ -111,7 +115,7 @@ import { mapGetters, mapState } from "vuex";
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapState("players", ["players"]),
|
...mapState("players", ["players"]),
|
||||||
...mapState(["session"]),
|
...mapState(["session", "grimoire"]),
|
||||||
...mapGetters({ alive: "players/alive" }),
|
...mapGetters({ alive: "players/alive" }),
|
||||||
nominator: function() {
|
nominator: function() {
|
||||||
return this.players[this.session.nomination[0]];
|
return this.players[this.session.nomination[0]];
|
||||||
|
|
|
@ -44,6 +44,8 @@ const faIcons = [
|
||||||
"UserEdit",
|
"UserEdit",
|
||||||
"UserFriends",
|
"UserFriends",
|
||||||
"Users",
|
"Users",
|
||||||
|
"VolumeUp",
|
||||||
|
"VolumeMute",
|
||||||
"VoteYea"
|
"VoteYea"
|
||||||
];
|
];
|
||||||
const fabIcons = ["Github", "Discord"];
|
const fabIcons = ["Github", "Discord"];
|
||||||
|
|
|
@ -53,6 +53,7 @@ export default new Vuex.Store({
|
||||||
isNightOrder: true,
|
isNightOrder: true,
|
||||||
isPublic: true,
|
isPublic: true,
|
||||||
isMenuOpen: false,
|
isMenuOpen: false,
|
||||||
|
isMuted: false,
|
||||||
zoom: 0,
|
zoom: 0,
|
||||||
background: ""
|
background: ""
|
||||||
},
|
},
|
||||||
|
@ -133,6 +134,9 @@ export default new Vuex.Store({
|
||||||
setBackground({ grimoire }, background) {
|
setBackground({ grimoire }, background) {
|
||||||
grimoire.background = background;
|
grimoire.background = background;
|
||||||
},
|
},
|
||||||
|
setIsMuted({ grimoire }, isMuted) {
|
||||||
|
grimoire.isMuted = isMuted;
|
||||||
|
},
|
||||||
toggleModal({ modals }, name) {
|
toggleModal({ modals }, name) {
|
||||||
if (name) {
|
if (name) {
|
||||||
modals[name] = !modals[name];
|
modals[name] = !modals[name];
|
||||||
|
|
|
@ -3,6 +3,9 @@ module.exports = store => {
|
||||||
if (localStorage.getItem("background")) {
|
if (localStorage.getItem("background")) {
|
||||||
store.commit("setBackground", localStorage.background);
|
store.commit("setBackground", localStorage.background);
|
||||||
}
|
}
|
||||||
|
if (localStorage.getItem("muted")) {
|
||||||
|
store.commit("setIsMuted", true);
|
||||||
|
}
|
||||||
if (localStorage.getItem("zoom")) {
|
if (localStorage.getItem("zoom")) {
|
||||||
store.commit("setZoom", parseFloat(localStorage.getItem("zoom")));
|
store.commit("setZoom", parseFloat(localStorage.getItem("zoom")));
|
||||||
}
|
}
|
||||||
|
@ -70,6 +73,13 @@ module.exports = store => {
|
||||||
localStorage.removeItem("background");
|
localStorage.removeItem("background");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "setIsMuted":
|
||||||
|
if (payload) {
|
||||||
|
localStorage.setItem("muted", 1);
|
||||||
|
} else {
|
||||||
|
localStorage.removeItem("muted");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "setZoom":
|
case "setZoom":
|
||||||
if (payload !== 0) {
|
if (payload !== 0) {
|
||||||
localStorage.setItem("zoom", payload);
|
localStorage.setItem("zoom", payload);
|
||||||
|
|
Loading…
Reference in New Issue