streamer mode

This commit is contained in:
pingumask 2022-12-26 13:09:47 +01:00
parent d59cef24d3
commit b44bab4cf7
14 changed files with 239 additions and 29 deletions

View file

@ -8,15 +8,14 @@
static: grimoire.isStatic static: grimoire.isStatic
}" }"
:style="{ :style="{
backgroundImage: grimoire.background backgroundImage: `url('${background}')`,
? `url('${grimoire.background}')` backgroundColor: `${backgroundColor}`
: ''
}" }"
> >
<video <video
id="background" id="background"
v-if="grimoire.background && grimoire.background.match(/\.(mp4|webm)$/i)" v-if="background && background.match(/\.(mp4|webm)$/i)"
:src="grimoire.background" :src="background"
autoplay autoplay
loop loop
></video> ></video>
@ -74,8 +73,19 @@ export default {
Gradients Gradients
}, },
computed: { computed: {
...mapState(["grimoire", "session"]), ...mapState(["grimoire", "session", "edition"]),
...mapState("players", ["players"]) ...mapState("players", ["players"]),
background: function() {
if (this.grimoire.isStreamerMode) {
return "none";
}
return this.grimoire.background || this.edition.background || "none";
},
backgroundColor: function() {
return this.grimoire.isStreamerMode
? "#00FF00"
: "transparent"
}
}, },
data() { data() {
return { return {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

View file

@ -2,7 +2,8 @@
{ {
"id": "_meta", "id": "_meta",
"name": "Reykjavik's Scheme", "name": "Reykjavik's Scheme",
"author": "Gordon Fitzgerald" "author": "Gordon Fitzgerald",
"background": "https://raw.githubusercontent.com/Pingumask/townsquare/develop/src/assets/scripts/reykjaviks_scheme.bg.png"
}, },
{ {
"id": "slayer" "id": "slayer"

View file

@ -0,0 +1,81 @@
[
{
"id": "_meta",
"name": "Storyteller's Vengeance"
},
{
"id": "investigator"
},
{
"id": "chambermaid"
},
{
"id": "empath"
},
{
"id": "fortune_teller"
},
{
"id": "innkeeper"
},
{
"id": "town_crier"
},
{
"id": "undertaker"
},
{
"id": "artist"
},
{
"id": "seamstress"
},
{
"id": "slayer"
},
{
"id": "virgin"
},
{
"id": "mayor"
},
{
"id": "atheist"
},
{
"id": "drunk"
},
{
"id": "lunatic"
},
{
"id": "puzzlemaster"
},
{
"id": "klutz"
},
{
"id": "evil_twin"
},
{
"id": "marionette"
},
{
"id": "witch"
},
{
"id": "scarlet_woman"
},
{
"id": "fang_gu"
},
{
"id": "imp"
},
{
"id": "no_dashii"
},
{
"id": "vigormortis"
}
]

View file

@ -0,0 +1,78 @@
[
{
"id": "_meta",
"name": "Trouble brewing Advanced"
},
{
"id": "noble"
},
{
"id": "chef"
},
{
"id": "washerwoman"
},
{
"id": "librarian"
},
{
"id": "empath"
},
{
"id": "fortune_teller"
},
{
"id": "undertaker"
},
{
"id": "monk"
},
{
"id": "slayer"
},
{
"id": "soldier"
},
{
"id": "ravenkeeper"
},
{
"id": "virgin"
},
{
"id": "mayor"
},
{
"id": "goon"
},
{
"id": "saint"
},
{
"id": "recluse"
},
{
"id": "lunatic"
},
{
"id": "poisoner"
},
{
"id": "spy"
},
{
"id": "baron"
},
{
"id": "scarlet_woman"
},
{
"id": "marionette"
},
{
"id": "imp"
},
{
"id": "fang_gu"
}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View file

@ -2,7 +2,8 @@
{ {
"id": "_meta", "id": "_meta",
"name": "Trouble with Violets", "name": "Trouble with Violets",
"author": "The Pandemonium Institute" "author": "The Pandemonium Institute",
"background": "https://raw.githubusercontent.com/Pingumask/townsquare/develop/src/assets/scripts/trouble_with_violets.bg.png"
}, },
{ {
"id": "washerwoman" "id": "washerwoman"

View file

@ -101,6 +101,16 @@
]" ]"
/></em> /></em>
</li> </li>
<li @click="streamerMode">
<small>{{ locale.menu.grimoire.streamerMode }}</small>
<em
><font-awesome-icon
:icon="[
'fas',
grimoire.isStreamerMode ? 'check-square' : 'square'
]"
/></em>
</li>
<li @click="toggleStatic"> <li @click="toggleStatic">
{{ locale.menu.grimoire.animations }} {{ locale.menu.grimoire.animations }}
<em <em
@ -292,6 +302,9 @@ export default {
this.toggleImageOptIn(); this.toggleImageOptIn();
} }
}, },
streamerMode() {
this.toggleStreamerMode();
},
joinSession() { joinSession() {
if (this.session.sessionId) return this.leaveSession(); if (this.session.sessionId) return this.leaveSession();
let sessionId = prompt( let sessionId = prompt(
@ -356,6 +369,7 @@ export default {
"toggleGrimoire", "toggleGrimoire",
"toggleMenu", "toggleMenu",
"toggleImageOptIn", "toggleImageOptIn",
"toggleStreamerMode",
"toggleMuted", "toggleMuted",
"toggleNightOrder", "toggleNightOrder",
"toggleStatic", "toggleStatic",

View file

@ -158,6 +158,14 @@ export default {
[ [
"Simpletown Village", "Simpletown Village",
"https://raw.githubusercontent.com/Pingumask/townsquare/develop/src/assets/scripts/pont_saint_esprit.json" "https://raw.githubusercontent.com/Pingumask/townsquare/develop/src/assets/scripts/pont_saint_esprit.json"
],
[
"Trouble Brewing Advanced",
"https://raw.githubusercontent.com/Pingumask/townsquare/develop/src/assets/scripts/trouble_brewing_advanced.json"
],
[
"Storyteller's Vengeance",
"https://raw.githubusercontent.com/Pingumask/townsquare/develop/src/assets/scripts/storytellers_vengeance.json"
] ]
] ]
}; };
@ -241,22 +249,24 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
ul.editions .edition { ul.editions {
font-family: PiratesBay, sans-serif; .edition {
letter-spacing: 1px; font-family: PiratesBay, sans-serif;
text-align: center; letter-spacing: 1px;
padding-top: 15%; text-align: center;
background-position: center center; padding-top: 15%;
background-size: 100% auto; background-position: center center;
background-repeat: no-repeat; background-size: 100% auto;
width: 30%; background-repeat: no-repeat;
margin: 5px; width: 30%;
font-size: 120%; margin: 5px;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, font-size: 120%;
1px 1px 0 #000, 0 0 5px rgba(0, 0, 0, 0.75); text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
cursor: pointer; 1px 1px 0 #000, 0 0 5px rgba(0, 0, 0, 0.75);
&:hover { cursor: pointer;
color: red; &:hover {
color: red;
}
} }
} }

View file

@ -65,9 +65,10 @@ export default {
box-shadow: 2px 2px 20px 1px #000; box-shadow: 2px 2px 20px 1px #000;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
max-height: 80%; max-height: 80vh;
max-width: 80%; max-width: 80vw;
.editions &,
.vote-history &, .vote-history &,
.night-reference &, .night-reference &,
.characters & { .characters & {
@ -76,8 +77,8 @@ export default {
.roles &, .roles &,
.characters & { .characters & {
max-height: 100%; max-height: 100vh;
max-width: 60%; max-width: 60vw;
} }
ul { ul {

View file

@ -110,6 +110,7 @@ export default new Vuex.Store({
isStatic: false, isStatic: false,
isMuted: false, isMuted: false,
isImageOptIn: false, isImageOptIn: false,
isStreamerMode: false,
zoom: 0, zoom: 0,
background: "", background: "",
timer: { timer: {
@ -183,6 +184,7 @@ export default new Vuex.Store({
toggleRinging: toggle("isRinging"), toggleRinging: toggle("isRinging"),
toggleGrimoire: toggle("isPublic"), toggleGrimoire: toggle("isPublic"),
toggleImageOptIn: toggle("isImageOptIn"), toggleImageOptIn: toggle("isImageOptIn"),
toggleStreamerMode: toggle("isStreamerMode"),
setTimer(state, timer) { setTimer(state, timer) {
state.grimoire.timer = timer; state.grimoire.timer = timer;
}, },

View file

@ -10,6 +10,7 @@
"zoom": "Zoom", "zoom": "Zoom",
"background": "Background image", "background": "Background image",
"customImages": "Show Custom Images", "customImages": "Show Custom Images",
"streamerMode": "Streamer Mode",
"animations": "Disable Animations", "animations": "Disable Animations",
"mute": "Mute Sounds", "mute": "Mute Sounds",
"ringBell": "Ring Bell" "ringBell": "Ring Bell"

View file

@ -10,6 +10,7 @@
"zoom": "Zoom", "zoom": "Zoom",
"background": "Image de fond", "background": "Image de fond",
"customImages": "Images Importées", "customImages": "Images Importées",
"streamerMode": "Mode Streamer",
"animations": "Effets réduits", "animations": "Effets réduits",
"mute": "Silencieux", "mute": "Silencieux",
"ringBell": "Sonner Clocher" "ringBell": "Sonner Clocher"

View file

@ -17,6 +17,9 @@ module.exports = store => {
if (localStorage.getItem("imageOptIn")) { if (localStorage.getItem("imageOptIn")) {
store.commit("toggleImageOptIn", true); store.commit("toggleImageOptIn", true);
} }
if (localStorage.getItem("streamerMode")) {
store.commit("toggleStreamerMode", true);
}
if (localStorage.getItem("zoom")) { if (localStorage.getItem("zoom")) {
store.commit("setZoom", parseFloat(localStorage.getItem("zoom"))); store.commit("setZoom", parseFloat(localStorage.getItem("zoom")));
} }
@ -108,6 +111,13 @@ module.exports = store => {
localStorage.removeItem("imageOptIn"); localStorage.removeItem("imageOptIn");
} }
break; break;
case "toggleStreamerMode":
if (state.grimoire.isStreamerMode) {
localStorage.setItem("streamerMode", 1);
} else {
localStorage.removeItem("streamerMode");
}
break;
case "setZoom": case "setZoom":
if (payload !== 0) { if (payload !== 0) {
localStorage.setItem("zoom", payload); localStorage.setItem("zoom", payload);