diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 54272dbc2..737122d44 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -4769,3 +4769,14 @@ table { margin-bottom: 7px; } } +@keyframes golden { + from {filter: sepia(100%) saturate(2) drop-shadow(-1px 1px 1px gold)} + to {filter: sepia(100%) saturate(3) drop-shadow(-1px 1px 12px gold)} +} +img.golden { + animation-name: golden !important; + animation-duration: 1s !important; + animation-iteration-count: infinite !important; + animation-direction: alternate !important; + animation-timing-function: linear !important; +} \ No newline at end of file diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 6ed408625..abf409e40 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -7,6 +7,7 @@ from os import path, environ import re from mistletoe import markdown from json import loads, dump +from random import random site = environ.get("DOMAIN").strip() @@ -189,20 +190,22 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False): for i in re.finditer('(?', new, flags=re.I) + new = re.sub(f'(?', new, flags=re.I) if comment: marseys_used.add(emoji) sanitized = sanitized.replace(old, new) @@ -212,12 +215,16 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False): emoji = i.group(1).lower() if emoji.startswith("!"): emoji = emoji[1:] + classes = 'emoji mirrored' + if random() < 0.01: classes += ' golden' if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): - sanitized = re.sub(f'(?', sanitized, flags=re.I) + sanitized = re.sub(f'(?', sanitized, flags=re.I) if comment: marseys_used.add(emoji) elif path.isfile(f'files/assets/images/emojis/{emoji}.webp'): - sanitized = re.sub(f'(?', sanitized, flags=re.I) + classes = 'emoji' + if random() < 0.01: classes += ' golden' + sanitized = re.sub(f'(?', sanitized, flags=re.I) if comment: marseys_used.add(emoji) sanitized = sanitized.replace("https://www.", "https://").replace("https://youtu.be/", "https://youtube.com/watch?v=").replace("https://music.youtube.com/watch?v=", "https://youtube.com/watch?v=").replace("https://open.spotify.com/", "https://open.spotify.com/embed/").replace("https://streamable.com/", "https://streamable.com/e/").replace("https://youtube.com/shorts/", "https://youtube.com/watch?v=").replace("https://mobile.twitter", "https://twitter").replace("https://m.facebook", "https://facebook").replace("m.wikipedia.org", "wikipedia.org").replace("https://m.youtube", "https://youtube") @@ -268,11 +275,15 @@ def filter_emojis_only(title): if emoji.startswith("!"): emoji = emoji[1:] + classes = 'emoji mirrored' + if random() < 0.01: classes += ' golden' if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): - title = re.sub(f'(?', title, flags=re.I) + title = re.sub(f'(?', title, flags=re.I) elif path.isfile(f'files/assets/images/emojis/{emoji}.webp'): - title = re.sub(f'(?', title, flags=re.I) + classes = 'emoji mirrored' + if random() < 0.01: classes += ' golden' + title = re.sub(f'(?', title, flags=re.I) if len(title) > 1500: abort(400) else: return title \ No newline at end of file diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 22b85f712..b32c0aebe 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index 77c1419f3..caa2125f7 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -7,7 +7,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index a48e858eb..da3e5fdee 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,7 +6,7 @@ {% block content %} {% if v %} - + {% if v.agendaposter %} - + {% endif %}