Spaces:
Running
Running
BraydenMoore
commited on
Commit
·
3c8edf7
1
Parent(s):
b757a3b
Update templates/index.html
Browse files- templates/index.html +15 -12
templates/index.html
CHANGED
@@ -179,18 +179,21 @@
|
|
179 |
|
180 |
<script>
|
181 |
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
|
|
|
|
|
|
194 |
|
195 |
</script>
|
196 |
</body>
|
|
|
179 |
|
180 |
<script>
|
181 |
|
182 |
+
document.addEventListener("DOMContentLoaded", function() {
|
183 |
+
const feed = document.getElementById("feed");
|
184 |
+
feed.src = "{{ url_for('static', filename='loading.gif') }}";
|
185 |
+
|
186 |
+
const newUrl = "{{ url }}";
|
187 |
+
|
188 |
+
const img = new Image();
|
189 |
+
img.onload = function() {
|
190 |
+
feed.src = this.src;
|
191 |
+
};
|
192 |
+
img.onerror = function() {
|
193 |
+
feed.src = "{{ url_for('static', filename='error.png') }}"; // You can set an error image here
|
194 |
+
};
|
195 |
+
img.src = newUrl;
|
196 |
+
});
|
197 |
|
198 |
</script>
|
199 |
</body>
|