broadfield-dev commited on
Commit
1969085
·
verified ·
1 Parent(s): 36f2507

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +16 -8
templates/index.html CHANGED
@@ -2,7 +2,7 @@
2
  <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
- <meta name="asság:width=device-width, initial-scale=1.0">
6
  <title>News Feed Hub</title>
7
  <style>
8
  body { font-family: Arial, sans-serif; margin: 20px; background-color: #f5f5f5; color: #333; }
@@ -32,11 +32,9 @@
32
  </form>
33
  <button id="backButton" style="display: none; margin-top: 10px;">Back to Main</button>
34
  </div>
35
- {% if loading %}
36
- <div class="loading-container" id="loadingContainer">
37
- <span class="loading-spinner"></span>
38
- </div>
39
- {% endif %}
40
  {% if has_articles %}
41
  <div id="articlesContainer">
42
  {% for category, articles in categorized_articles.items() %}
@@ -181,6 +179,9 @@
181
  }
182
  }
183
  }
 
 
 
184
  }
185
  setTimeout(updateArticles, 2000);
186
  })
@@ -214,10 +215,17 @@
214
  tiles.forEach(tile => {
215
  lastUpdate = Math.max(lastUpdate, parseFloat(tile.dataset.lastUpdate) || 0);
216
  });
 
 
 
 
 
 
 
217
  updateArticles();
218
 
219
  // Start checking loading status if loading is active
220
- if (document.getElementById('loadingContainer')) {
221
  checkLoadingStatus();
222
  }
223
 
@@ -277,4 +285,4 @@
277
  });
278
  </script>
279
  </body>
280
- </html>
 
2
  <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>News Feed Hub</title>
7
  <style>
8
  body { font-family: Arial, sans-serif; margin: 20px; background-color: #f5f5f5; color: #333; }
 
32
  </form>
33
  <button id="backButton" style="display: none; margin-top: 10px;">Back to Main</button>
34
  </div>
35
+ <div class="loading-container" id="loadingContainer" {% if not loading %}style="display: none;"{% endif %}>
36
+ <span class="loading-spinner"></span>
37
+ </div>
 
 
38
  {% if has_articles %}
39
  <div id="articlesContainer">
40
  {% for category, articles in categorized_articles.items() %}
 
179
  }
180
  }
181
  }
182
+ // Hide spinner once articles are updated
183
+ const loadingContainer = document.getElementById('loadingContainer');
184
+ if (loadingContainer) loadingContainer.style.display = 'none';
185
  }
186
  setTimeout(updateArticles, 2000);
187
  })
 
215
  tiles.forEach(tile => {
216
  lastUpdate = Math.max(lastUpdate, parseFloat(tile.dataset.lastUpdate) || 0);
217
  });
218
+
219
+ // Show spinner initially if loading
220
+ const loadingContainer = document.getElementById('loadingContainer');
221
+ if (loadingContainer && !document.getElementById('articlesContainer')) {
222
+ loadingContainer.style.display = 'block';
223
+ }
224
+
225
  updateArticles();
226
 
227
  // Start checking loading status if loading is active
228
+ if (loadingContainer) {
229
  checkLoadingStatus();
230
  }
231
 
 
285
  });
286
  </script>
287
  </body>
288
+ </html>