Skip to content

Commit

Permalink
change post_should_be_blurred && to *post_should_be_blurred && + …
Browse files Browse the repository at this point in the history
…unblur all focused content
  • Loading branch information
DokterKaj committed Oct 17, 2024
1 parent 4d05136 commit b821115
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1170,9 +1170,9 @@ a.search_subreddit:hover {
}

.post_blurred:has(:is(.post_media_content, .post_body, .post_thumbnail):focus-within) {
.post_media_content[tabindex] *,
.post_body[tabindex],
.post_thumbnail[tabindex] * {
.post_media_content *,
.post_body,
.post_thumbnail * {
filter: none;
}
}
Expand Down
18 changes: 9 additions & 9 deletions templates/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ <h1 class="post_title">
<!-- POST MEDIA -->
<!-- post_type: {{ post.post_type }} -->
{% if post.post_type == "image" %}
<div class="post_media_content"{% if post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<div class="post_media_content"{% if *post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<a href="{{ post.media.url }}" class="post_media_image" >
{% if post.media.height == 0 || post.media.width == 0 %}
<!-- i.redd.it images special case -->
Expand All @@ -121,15 +121,15 @@ <h1 class="post_title">
{% else if post.post_type == "video" || post.post_type == "gif" %}
{% if prefs.use_hls == "on" && !post.media.alt_url.is_empty() %}
<script src="/hls.min.js"></script>
<div class="post_media_content"{% if post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<div class="post_media_content"{% if *post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<video class="post_media_video short {% if prefs.autoplay_videos == "on" %}hls_autoplay{% endif %}" {% if post.media.width > 0 && post.media.height > 0 %}width="{{ post.media.width }}" height="{{ post.media.height }}"{% endif %} poster="{{ post.media.poster }}" preload="none" controls>
<source src="{{ post.media.alt_url }}" type="application/vnd.apple.mpegurl" />
<source src="{{ post.media.url }}" type="video/mp4" />
</video>
</div>
<script src="/playHLSVideo.js"></script>
{% else %}
<div class="post_media_content"{% if post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<div class="post_media_content"{% if *post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<video class="post_media_video" src="{{ post.media.url }}" controls {% if prefs.autoplay_videos == "on" %}autoplay{% endif %} loop><a href={{ post.media.url }}>Video</a></video>
</div>
{% call render_hls_notification(post.permalink[1..]) %}
Expand All @@ -153,7 +153,7 @@ <h1 class="post_title">
{% endif %}

<!-- POST BODY -->
<div class="post_body"{% if post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<div class="post_body"{% if *post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
{{ post.body|safe }}
{% call poll(post) %}
</div>
Expand Down Expand Up @@ -249,7 +249,7 @@ <h2 class="post_title">
</h2>
<!-- POST MEDIA/THUMBNAIL -->
{% if (prefs.layout.is_empty() || prefs.layout == "card") && post.post_type == "image" %}
<div class="post_media_content"{% if post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<div class="post_media_content"{% if *post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<a href="{{ post.media.url }}" class="post_media_image {% if post.media.height < post.media.width*2 %}short{% endif %}" >
{% if post.media.height == 0 || post.media.width == 0 %}
<!-- i.redd.it images speical case -->
Expand All @@ -269,20 +269,20 @@ <h2 class="post_title">
</div>
{% else if (prefs.layout.is_empty() || prefs.layout == "card") && (post.post_type == "gif" || post.post_type == "video") %}
{% if prefs.use_hls == "on" && !post.media.alt_url.is_empty() %}
<div class="post_media_content"{% if post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<div class="post_media_content"{% if *post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<video class="post_media_video short{% if prefs.autoplay_videos == "on" %} hls_autoplay{% endif %}" {% if post.media.width > 0 && post.media.height > 0 %}width="{{ post.media.width }}" height="{{ post.media.height }}"{% endif %} poster="{{ post.media.poster }}" controls preload="none">
<source src="{{ post.media.alt_url }}" type="application/vnd.apple.mpegurl" />
<source src="{{ post.media.url }}" type="video/mp4" />
</video>
</div>
{% else %}
<div class="post_media_content"{% if post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<div class="post_media_content"{% if *post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<video class="post_media_video short" src="{{ post.media.url }}" {% if post.media.width > 0 && post.media.height > 0 %}width="{{ post.media.width }}" height="{{ post.media.height }}"{% endif %} poster="{{ post.media.poster }}" preload="none" controls {% if prefs.autoplay_videos == "on" %}autoplay{% endif %}><a href={{ post.media.url }}>Video</a></video>
</div>
{% call render_hls_notification(format!("{}%23{}", &self.url[1..].replace("&", "%26").replace("+", "%2B"), post.id)) %}
{% endif %}
{% else if post.post_type != "self" %}
<div class="post_thumbnail{% if post.thumbnail.url.is_empty() %} no_thumbnail{% endif %}"{% if post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<div class="post_thumbnail{% if post.thumbnail.url.is_empty() %} no_thumbnail{% endif %}"{% if *post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<a href="{% if post.post_type == "link" %}{{ post.media.url }}{% else %}{{ post.permalink }}{% endif %}" rel="nofollow">
{% if post.thumbnail.url.is_empty() %}
<svg viewBox="0 0 100 106" width="140" height="53" xmlns="http://www.w3.org/2000/svg">
Expand Down Expand Up @@ -310,7 +310,7 @@ <h2 class="post_title">
&#x2022;
{% endif %}
<span class="label"> Upvotes</span></div>
<div class="post_body post_preview"{% if post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
<div class="post_body post_preview"{% if *post_should_be_blurred && prefs.unblur_on_hover != "on" %} tabindex="-1" title="Unblur post"{% endif %}>
{{ post.body|safe }}
</div>

Expand Down

0 comments on commit b821115

Please sign in to comment.