mirror of https://github.com/bra1n/townsquare.git
Merge pull request #159 from bra1n/animation_toggle
add global animation toggle
This commit is contained in:
commit
c868f0930a
|
@ -1,5 +1,6 @@
|
||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
|
- added global animation toggle for better performance
|
||||||
- added record vote history toggle to session menu, and clear vote history button
|
- added record vote history toggle to session menu, and clear vote history button
|
||||||
- add support for custom Fabled characters
|
- add support for custom Fabled characters
|
||||||
|
|
||||||
|
|
13
src/App.vue
13
src/App.vue
|
@ -3,7 +3,10 @@
|
||||||
id="app"
|
id="app"
|
||||||
@keyup="keyup"
|
@keyup="keyup"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
:class="{ night: grimoire.isNight }"
|
:class="{
|
||||||
|
night: grimoire.isNight,
|
||||||
|
static: grimoire.isStatic
|
||||||
|
}"
|
||||||
:style="{
|
:style="{
|
||||||
backgroundImage: grimoire.background
|
backgroundImage: grimoire.background
|
||||||
? `url('${grimoire.background}')`
|
? `url('${grimoire.background}')`
|
||||||
|
@ -202,6 +205,14 @@ ul {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
// disable all animations
|
||||||
|
&.static *,
|
||||||
|
&.static *:after,
|
||||||
|
&.static *:before {
|
||||||
|
transition: none !important;
|
||||||
|
animation: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#version {
|
#version {
|
||||||
|
|
|
@ -83,6 +83,10 @@
|
||||||
/>
|
/>
|
||||||
</em>
|
</em>
|
||||||
</li>
|
</li>
|
||||||
|
<li @click="setBackground">
|
||||||
|
Background image
|
||||||
|
<em><font-awesome-icon icon="image"/></em>
|
||||||
|
</li>
|
||||||
<li v-if="!edition.isOfficial" @click="imageOptIn">
|
<li v-if="!edition.isOfficial" @click="imageOptIn">
|
||||||
<small>Show Custom Images</small>
|
<small>Show Custom Images</small>
|
||||||
<em
|
<em
|
||||||
|
@ -93,9 +97,12 @@
|
||||||
]"
|
]"
|
||||||
/></em>
|
/></em>
|
||||||
</li>
|
</li>
|
||||||
<li @click="setBackground">
|
<li @click="toggleStatic">
|
||||||
Background image
|
Disable Animations
|
||||||
<em><font-awesome-icon icon="image"/></em>
|
<em
|
||||||
|
><font-awesome-icon
|
||||||
|
:icon="['fas', grimoire.isStatic ? 'check-square' : 'square']"
|
||||||
|
/></em>
|
||||||
</li>
|
</li>
|
||||||
<li @click="toggleMuted">
|
<li @click="toggleMuted">
|
||||||
Mute Sounds
|
Mute Sounds
|
||||||
|
@ -335,6 +342,7 @@ export default {
|
||||||
"toggleMuted",
|
"toggleMuted",
|
||||||
"toggleNight",
|
"toggleNight",
|
||||||
"toggleNightOrder",
|
"toggleNightOrder",
|
||||||
|
"toggleStatic",
|
||||||
"setZoom",
|
"setZoom",
|
||||||
"toggleModal"
|
"toggleModal"
|
||||||
])
|
])
|
||||||
|
|
|
@ -81,6 +81,7 @@ export default new Vuex.Store({
|
||||||
isNightOrder: true,
|
isNightOrder: true,
|
||||||
isPublic: true,
|
isPublic: true,
|
||||||
isMenuOpen: false,
|
isMenuOpen: false,
|
||||||
|
isStatic: false,
|
||||||
isMuted: false,
|
isMuted: false,
|
||||||
isImageOptIn: false,
|
isImageOptIn: false,
|
||||||
zoom: 0,
|
zoom: 0,
|
||||||
|
@ -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"),
|
||||||
|
toggleStatic: toggle("isStatic"),
|
||||||
toggleNight: toggle("isNight"),
|
toggleNight: toggle("isNight"),
|
||||||
toggleGrimoire: toggle("isPublic"),
|
toggleGrimoire: toggle("isPublic"),
|
||||||
toggleImageOptIn: toggle("isImageOptIn"),
|
toggleImageOptIn: toggle("isImageOptIn"),
|
||||||
|
|
|
@ -11,6 +11,9 @@ module.exports = store => {
|
||||||
if (localStorage.getItem("muted")) {
|
if (localStorage.getItem("muted")) {
|
||||||
store.commit("toggleMuted", true);
|
store.commit("toggleMuted", true);
|
||||||
}
|
}
|
||||||
|
if (localStorage.getItem("static")) {
|
||||||
|
store.commit("toggleStatic", true);
|
||||||
|
}
|
||||||
if (localStorage.getItem("imageOptIn")) {
|
if (localStorage.getItem("imageOptIn")) {
|
||||||
store.commit("toggleImageOptIn", true);
|
store.commit("toggleImageOptIn", true);
|
||||||
}
|
}
|
||||||
|
@ -91,6 +94,13 @@ module.exports = store => {
|
||||||
localStorage.removeItem("muted");
|
localStorage.removeItem("muted");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "toggleStatic":
|
||||||
|
if (state.grimoire.isStatic) {
|
||||||
|
localStorage.setItem("static", 1);
|
||||||
|
} else {
|
||||||
|
localStorage.removeItem("static");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "toggleImageOptIn":
|
case "toggleImageOptIn":
|
||||||
if (state.grimoire.isImageOptIn) {
|
if (state.grimoire.isImageOptIn) {
|
||||||
localStorage.setItem("imageOptIn", 1);
|
localStorage.setItem("imageOptIn", 1);
|
||||||
|
|
Loading…
Reference in New Issue