Merge pull request #157 from wisq/main

Add option to reduce night animations to save power.
This commit is contained in:
Steffen 2021-05-01 21:26:54 +02:00 committed by GitHub
commit fe0f0bfbf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 2 deletions

View File

@ -17,7 +17,8 @@
autoplay autoplay
loop loop
></video> ></video>
<div class="backdrop"></div> <div v-if="grimoire.isNightAnimated" class="backdrop animated"></div>
<div v-else class="backdrop"></div>
<transition name="blur"> <transition name="blur">
<Intro v-if="!players.length"></Intro> <Intro v-if="!players.length"></Intro>
<TownInfo v-if="players.length && !session.nomination"></TownInfo> <TownInfo v-if="players.length && !session.nomination"></TownInfo>
@ -339,11 +340,14 @@ video#background {
height: 100%; height: 100%;
background: url("assets/clouds.png") repeat; background: url("assets/clouds.png") repeat;
background-size: 2000px auto; background-size: 2000px auto;
animation: move-background 120s linear infinite;
opacity: 0.3; opacity: 0.3;
} }
} }
#app > .backdrop.animated:after {
animation: move-background 120s linear infinite;
}
@keyframes move-background { @keyframes move-background {
from { from {
transform: translate3d(-2000px, 0px, 0px); transform: translate3d(-2000px, 0px, 0px);

View File

@ -96,6 +96,16 @@
Background image Background image
<em><font-awesome-icon icon="image"/></em> <em><font-awesome-icon icon="image"/></em>
</li> </li>
<li @click="toggleNightAnimated">
Animated night
<em
><font-awesome-icon
:icon="[
'fas',
grimoire.isNightAnimated ? 'check-square' : 'square'
]"
/></em>
</li>
<li @click="toggleMuted"> <li @click="toggleMuted">
Mute Sounds Mute Sounds
<em <em
@ -334,6 +344,7 @@ export default {
"toggleMuted", "toggleMuted",
"toggleNight", "toggleNight",
"toggleNightOrder", "toggleNightOrder",
"toggleNightAnimated",
"setZoom", "setZoom",
"toggleModal" "toggleModal"
]) ])

View File

@ -79,6 +79,7 @@ export default new Vuex.Store({
grimoire: { grimoire: {
isNight: false, isNight: false,
isNightOrder: true, isNightOrder: true,
isNightAnimated: true,
isPublic: true, isPublic: true,
isMenuOpen: false, isMenuOpen: false,
isMuted: false, isMuted: false,
@ -144,6 +145,7 @@ export default new Vuex.Store({
toggleMuted: toggle("isMuted"), toggleMuted: toggle("isMuted"),
toggleMenu: toggle("isMenuOpen"), toggleMenu: toggle("isMenuOpen"),
toggleNightOrder: toggle("isNightOrder"), toggleNightOrder: toggle("isNightOrder"),
toggleNightAnimated: toggle("isNightAnimated"),
toggleNight: toggle("isNight"), toggleNight: toggle("isNight"),
toggleGrimoire: toggle("isPublic"), toggleGrimoire: toggle("isPublic"),
toggleImageOptIn: toggle("isImageOptIn"), toggleImageOptIn: toggle("isImageOptIn"),