broadfield-dev commited on
Commit
2f03540
·
verified ·
1 Parent(s): de78f0e

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +11 -2
templates/index.html CHANGED
@@ -62,7 +62,7 @@
62
  .article-tile:hover {
63
  transform: scale(1.05);
64
  }
65
- .article-tile img {
66
  width: 100%;
67
  height: 150px;
68
  object-fit: cover;
@@ -93,7 +93,7 @@
93
  color: #95a5a6;
94
  }
95
  #loading {
96
- display: none;
97
  position: fixed;
98
  top: 0;
99
  left: 0;
@@ -148,7 +148,16 @@
148
  <div class="tiles">
149
  {% for article in articles %}
150
  <div class="article-tile">
 
151
  <img src="{{ article.image }}" alt="Article Image">
 
 
 
 
 
 
 
 
152
  <div class="title"><a href="{{ article.link }}" target="_blank">{{ article.title }}</a></div>
153
  <div class="summary">{{ article.summary }}</div>
154
  <div class="sentiment">Sentiment: {{ article.sentiment }}</div>
 
62
  .article-tile:hover {
63
  transform: scale(1.05);
64
  }
65
+ .article-tile img, .article-tile svg {
66
  width: 100%;
67
  height: 150px;
68
  object-fit: cover;
 
93
  color: #95a5a6;
94
  }
95
  #loading {
96
+ display: block;
97
  position: fixed;
98
  top: 0;
99
  left: 0;
 
148
  <div class="tiles">
149
  {% for article in articles %}
150
  <div class="article-tile">
151
+ {% if article.image != "svg" %}
152
  <img src="{{ article.image }}" alt="Article Image">
153
+ {% else %}
154
+ <svg width="100%" height="150" viewBox="0 0 300 150" xmlns="http://www.w3.org/2000/svg">
155
+ <rect width="300" height="150" fill="#e0e0e0"/>
156
+ <text x="50%" y="50%" text-anchor="middle" dy=".3em" font-size="20" fill="#666">
157
+ No Image Available
158
+ </text>
159
+ </svg>
160
+ {% endif %}
161
  <div class="title"><a href="{{ article.link }}" target="_blank">{{ article.title }}</a></div>
162
  <div class="summary">{{ article.summary }}</div>
163
  <div class="sentiment">Sentiment: {{ article.sentiment }}</div>