Add settings toggle for UI animations.

remotes/1693045480750635534/spooky-22
Snakes 2022-05-29 03:08:28 -04:00
parent 0aafd810a2
commit 0a73083e8a
4 changed files with 34 additions and 0 deletions

View File

@ -79,6 +79,7 @@ class User(Base):
over_18 = Column(Boolean, default=False)
hidevotedon = Column(Boolean, default=False)
highlightcomments = Column(Boolean, default=True)
animations = Column(Boolean, default=True)
slurreplacer = Column(Boolean, default=True)
flairchanged = Column(Integer)
newtab = Column(Boolean, default=False)

View File

@ -59,6 +59,10 @@ def settings_profile_post(v):
updated = True
v.slurreplacer = request.values.get("slurreplacer") == 'true'
elif request.values.get("animations", v.animations) != v.animations:
updated = True
v.animations = request.values.get("animations") == 'true'
elif request.values.get("hidevotedon", v.hidevotedon) != v.hidevotedon:
updated = True
v.hidevotedon = request.values.get("hidevotedon") == 'true'

View File

@ -285,3 +285,14 @@
}
</style>
{% endif %}
{% if v and not v.animations -%}
<style>
* {
animation: unset !important;
}
.active-anim.arrow-up::before{
animation: bounce-top-inset 0s 1 0s;
}
</style>
{%- endif %}

View File

@ -281,6 +281,24 @@
</div>
<div class="d-lg-flex border-bottom">
<div class="title w-lg-25">
<label for="animations">Animations</label>
</div>
<div class="body w-lg-100">
<div class="custom-control custom-switch">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="animations" name="animations"{% if v.animations %} checked{% endif %} onchange="post_toast(this,'/settings/profile?animations='+document.getElementById('animations').checked);">
<label class="custom-control-label" for="animations"></label>
</div>
<span class="text-small-extra text-muted">Enables animations for user interface elements. No effect on award animations.</span>
</div>
</div>
<div class="d-lg-flex border-bottom">