master
Aevann1 2021-09-18 20:57:26 +02:00
parent cf4ba361d2
commit 276a8333b7
2 changed files with 14 additions and 30 deletions

View File

@ -21,6 +21,8 @@ app = Flask(__name__, template_folder='./templates')
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=3)
app.url_map.strict_slashes = False
app.jinja_env.cache = {}
import faulthandler
faulthandler.enable()
app.config["SITE_NAME"]=environ.get("SITE_NAME").strip()
app.config["COINS_NAME"]=environ.get("COINS_NAME").strip()

View File

@ -206,36 +206,18 @@
</script>
{% endif %}
<script src="/assets/js/sparkle.min.js" type="text/javascript"></script>
{% if p.award_count("stars") %}
{% set sparkles = 10*p.award_count("stars") if p.award_count("stars") <= 5 else 50 %}
<style>
#post-content {
z-index: 50;
}
</style>
<script>
document.querySelector("#post-content").sparkle({
count: {{ sparkles }},
minAge: 500,
maxAge: 1000,
position: "afterend",
starsource: `
<svg
width="100%"
height="100%"
viewBox="0 0 15 15"
version="1.1"
xmlns="http://www.w3.org/2000/svg" x
mlns:xlink="http://www.w3.org/1999/xlink"
xml:space="preserve"
xmlns:serif="http://www.serif.com/"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="M1.125,4.95l4.462,0l1.913,-3.825l0.637,3.825l5.738,0l-4.463,3.188l0.638,5.737l-3.187,-3.825l-4.463,3.825l1.913,-5.737l-3.188,-3.188Z"
style="fill:#aaad00;">
</path>
</svg>`,
<script src="/assets/js/sparkle-min.js" type="text/javascript"></script>
{% set minbugs = 10*p.award_count("shit") if p.award_count("shit") <= 5 else 50 %}
{% set maxbugs = 20*p.award_count("shit") if p.award_count("shit") <= 5 else 100 %}
<script type="text/javascript">
new BugController({
imageSprite: "/assets/images/sparkle-sprite.webp",
canDie: false,
minBugs: {{minbugs}},
maxBugs: {{maxbugs}},
mouseOver: "multiply"
});
</script>
{% endif %}