Add placeholder for posts without thumbnail
This commit is contained in:
parent
292f8fbbb7
commit
d19e73f059
4 changed files with 48 additions and 9 deletions
|
@ -506,7 +506,7 @@ a.search_subreddit:hover {
|
||||||
display: grid;
|
display: grid;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
background-color: var(--highlighted);
|
background-color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post_thumbnail img {
|
.post_thumbnail img {
|
||||||
|
@ -517,12 +517,23 @@ a.search_subreddit:hover {
|
||||||
justify-self: center;
|
justify-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.post_thumbnail.no_thumbnail {
|
||||||
|
background-color: var(--highlighted)
|
||||||
|
}
|
||||||
|
|
||||||
|
.post_thumbnail svg {
|
||||||
|
grid-area: 1 / 1 / 2 / 2;
|
||||||
|
align-self: center;
|
||||||
|
justify-self: center;
|
||||||
|
stroke: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
.post_thumbnail span {
|
.post_thumbnail span {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: rgba(0,0,0,0.6);
|
background-color: rgba(0,0,0,0.8);
|
||||||
color: white;
|
color: white;
|
||||||
grid-area: 1 / 1 / 2 / 2;
|
grid-area: 1 / 1 / 2 / 2;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
|
|
@ -64,7 +64,21 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- POST THUMBNAIL -->
|
<!-- POST THUMBNAIL -->
|
||||||
<img class="post_thumbnail" src="{{ post.thumbnail }}">
|
<!-- POST MEDIA/THUMBNAIL -->
|
||||||
|
{% if prefs.layout == "card" && post.post_type == "image" %}
|
||||||
|
<img class="post_media" src="{{ post.media }}"/>
|
||||||
|
{% else if post.post_type != "self" %}
|
||||||
|
<a class="post_thumbnail {% if post.thumbnail == "" %}no_thumbnail{% endif %}" href="{% if post.post_type == "link" %}{{ post.media }}{% else %}{{ post.permalink }}{% endif %}">
|
||||||
|
{% if post.thumbnail == "" %}
|
||||||
|
<svg viewBox="0 0 100 106" width="50" height="53" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M35,15h-15a10,10 0,0,0 0,20h25a10,10 0,0,0 10,-10m-12.5,0a10, 10 0,0,1 10, -10h25a10,10 0,0,1 0,20h-15" fill="none" stroke-width="5" stroke-linecap="round"/>
|
||||||
|
</svg>
|
||||||
|
{% else %}
|
||||||
|
<img src="{{ post.thumbnail }}">
|
||||||
|
{% endif %}
|
||||||
|
<span>{% if post.post_type == "link" %}{{ post.domain }}{% else %}{{ post.post_type }}{% endif %}</span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -56,10 +56,17 @@
|
||||||
<!-- POST MEDIA/THUMBNAIL -->
|
<!-- POST MEDIA/THUMBNAIL -->
|
||||||
{% if prefs.layout == "card" && post.post_type == "image" %}
|
{% if prefs.layout == "card" && post.post_type == "image" %}
|
||||||
<img class="post_media" src="{{ post.media }}"/>
|
<img class="post_media" src="{{ post.media }}"/>
|
||||||
{% else if post.post_type == "link" %}
|
|
||||||
<a class="post_thumbnail" href="{{ post.media }}"><img src="{{ post.thumbnail }}"><span>{{ post.domain }}</span></a>
|
|
||||||
{% else if post.post_type != "self" %}
|
{% else if post.post_type != "self" %}
|
||||||
<a class="post_thumbnail" href="{{ post.permalink }}"><img src="{{ post.thumbnail }}"><span>{{ post.post_type }}</span></a>
|
<a class="post_thumbnail {% if post.thumbnail == "" %}no_thumbnail{% endif %}" href="{% if post.post_type == "link" %}{{ post.media }}{% else %}{{ post.permalink }}{% endif %}">
|
||||||
|
{% if post.thumbnail == "" %}
|
||||||
|
<svg viewBox="0 0 100 106" width="50" height="53" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M35,15h-15a10,10 0,0,0 0,20h25a10,10 0,0,0 10,-10m-12.5,0a10, 10 0,0,1 10, -10h25a10,10 0,0,1 0,20h-15" fill="none" stroke-width="5" stroke-linecap="round"/>
|
||||||
|
</svg>
|
||||||
|
{% else %}
|
||||||
|
<img src="{{ post.thumbnail }}">
|
||||||
|
{% endif %}
|
||||||
|
<span>{% if post.post_type == "link" %}{{ post.domain }}{% else %}{{ post.post_type }}{% endif %}</span>
|
||||||
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -51,10 +51,17 @@
|
||||||
<!-- POST MEDIA/THUMBNAIL -->
|
<!-- POST MEDIA/THUMBNAIL -->
|
||||||
{% if prefs.layout == "card" && post.post_type == "image" %}
|
{% if prefs.layout == "card" && post.post_type == "image" %}
|
||||||
<img class="post_media" src="{{ post.media }}"/>
|
<img class="post_media" src="{{ post.media }}"/>
|
||||||
{% else if post.post_type == "link" %}
|
|
||||||
<a class="post_thumbnail" href="{{ post.media }}"><img src="{{ post.thumbnail }}"><span>{{ post.domain }}</span></a>
|
|
||||||
{% else if post.post_type != "self" %}
|
{% else if post.post_type != "self" %}
|
||||||
<a class="post_thumbnail" href="{{ post.permalink }}"><img src="{{ post.thumbnail }}"><span>{{ post.post_type }}</span></a>
|
<a class="post_thumbnail {% if post.thumbnail == "" %}no_thumbnail{% endif %}" href="{% if post.post_type == "link" %}{{ post.media }}{% else %}{{ post.permalink }}{% endif %}">
|
||||||
|
{% if post.thumbnail == "" %}
|
||||||
|
<svg viewBox="0 0 100 106" width="50" height="53" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M35,15h-15a10,10 0,0,0 0,20h25a10,10 0,0,0 10,-10m-12.5,0a10, 10 0,0,1 10, -10h25a10,10 0,0,1 0,20h-15" fill="none" stroke-width="5" stroke-linecap="round"/>
|
||||||
|
</svg>
|
||||||
|
{% else %}
|
||||||
|
<img src="{{ post.thumbnail }}">
|
||||||
|
{% endif %}
|
||||||
|
<span>{% if post.post_type == "link" %}{{ post.domain }}{% else %}{{ post.post_type }}{% endif %}</span>
|
||||||
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue