diff --git a/static/style.css b/static/style.css index 5a344aa..5515df8 100644 --- a/static/style.css +++ b/static/style.css @@ -622,34 +622,29 @@ a.search_subreddit:hover { font-weight: bold; } -.post_media { +.post_media_image, .post .__NoScript_PlaceHolder__, .post_media_video { max-width: calc(100% - 40px); + grid-area: post_media; + margin: 15px auto 5px auto; +} + +.post_media_image.short svg, .post_media_image.short img{ + max-height: 512px; + width: auto; +} + +.post_media_image svg{ + max-width: 100%; height: auto; align-self: center; - margin-top: 15px; - margin: 5px auto; - grid-area: post_media; background-color: var(--highlighted); background-image: url("data:image/svg+xml;utf8,"); background-position: 50%; background-repeat: no-repeat; } -.post_media_wrapper { - display: contents; - /* Fallback for browsers insufficiently supporting "display: contents"*/ - grid-area: post_media; - text-align: center; -} - -.post_media.short { - max-height: 512px; - width: auto; -} - -img.post_media { +.post_media_image img { max-width: 100%; - width: auto; } #post_url { @@ -658,11 +653,6 @@ img.post_media { grid-area: post_media; } -.post .__NoScript_PlaceHolder__ { - max-width: calc(100% - 40px); - grid-area: post_media; -} - .post_body { opacity: 0.9; font-weight: normal; diff --git a/templates/post.html b/templates/post.html index a6832e2..b9e78f3 100644 --- a/templates/post.html +++ b/templates/post.html @@ -65,19 +65,19 @@ {% if post.post_type == "image" %} - - {% else if post.post_type == "video" || post.post_type == "gif" %} - + {% else if post.post_type == "link" %} {{ post.media.url }} {% endif %} diff --git a/templates/search.html b/templates/search.html index dbce9df..00e91d1 100644 --- a/templates/search.html +++ b/templates/search.html @@ -48,57 +48,7 @@ {% if post.flags.nsfw && prefs.show_nsfw != "on" %} {% else if post.title != "Comment" %} -
- r/{{ post.community }} - • - u/{{ post.author.name }} - • - {{ post.rel_time }} -
-- {% if post.flair.flair_parts.len() > 0 %} - {% call utils::render_flair(post.flair.flair_parts) %} - {% endif %} - {{ post.title }}{% if post.flags.nsfw %} NSFW{% endif %} -
- - {% if (prefs.layout.is_empty() || prefs.layout == "card") && post.post_type == "image" %} - -
-
- r/{{ post.community }} - • - u/{{ post.author.name }} - • - {{ post.rel_time }} -
-- {% if post.flair.flair_parts.len() > 0 %} - {% call utils::render_flair(post.flair.flair_parts) %} - {% endif %} - {{ post.title }}{% if post.flags.nsfw %} NSFW{% endif %} -
- - {% if (prefs.layout.is_empty() || prefs.layout == "card") && post.post_type == "image" %} - -- r/{{ post.community }} - • - u/{{ post.author.name }} - • - {{ post.rel_time }} -
-- {% if post.flair.flair_parts.len() > 0 %} - {% call utils::render_flair(post.flair.flair_parts) %} - {% endif %} - {{ post.title }}{% if post.flags.nsfw %} NSFW{% endif %} -
- - {% if (prefs.layout.is_empty() || prefs.layout == "card") && post.post_type == "image" %} - -+ r/{{ post.community }} + • + u/{{ post.author.name }} + • + {{ post.rel_time }} +
++ {% if post.flair.flair_parts.len() > 0 %} + {% call render_flair(post.flair.flair_parts) %} + {% endif %} + {{ post.title }}{% if post.flags.nsfw %} NSFW{% endif %} +
+ + {% if (prefs.layout.is_empty() || prefs.layout == "card") && post.post_type == "image" %} + +