From 9bdb5c896644ec47e9c8f79f644c8c39dbd762f0 Mon Sep 17 00:00:00 2001 From: Pim Date: Sun, 21 Jul 2024 16:22:40 +0200 Subject: [PATCH] feat: also blur text in post body for spoilers (#186) chore: simplify blur classes --- static/style.css | 22 ++++++++++++++++------ templates/utils.html | 20 +++++++++----------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/static/style.css b/static/style.css index 58eb010..2ab1eac 100644 --- a/static/style.css +++ b/static/style.css @@ -1019,11 +1019,25 @@ a.search_subreddit:hover { margin: auto; } -.post_nsfw_blur { +.post_blurred img, +.post_blurred svg, +.post_blurred video { filter: blur(1.5rem); } -.post_nsfw_blur:hover { +.post_blurred .post_body { + filter: blur(0.25rem); +} + +.post_blurred .post_thumbnail svg { + filter: blur(0.3rem); +} + +.post_blurred img:hover, +.post_blurred svg:hover, +.post_blurred video:hover, +.post_blurred .post_body:hover, +.post_blurred .post_thumbnail:hover svg { filter: none; } @@ -1199,10 +1213,6 @@ a.search_subreddit:hover { z-index: 0; } -.thumb_nsfw_blur { - filter: blur(0.3rem) -} - .post_thumbnail.no_thumbnail { background-color: var(--highlighted); } diff --git a/templates/utils.html b/templates/utils.html index c5ba45f..b88702b 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -64,7 +64,7 @@ {% macro post(post) -%} {% set post_should_be_blurred = post.flags.spoiler && prefs.blur_spoiler=="on" -%} -
+

r/{{ post.community }} @@ -104,12 +104,11 @@ {% if post.media.height == 0 || post.media.width == 0 %} - Post image + Post image {% else %} @@ -123,7 +122,7 @@ {% if prefs.use_hls == "on" && !post.media.alt_url.is_empty() %}
-