Spaces:
Running
Running
Commit
·
4e95b67
1
Parent(s):
b5b4524
Update templates/index.html
Browse files- templates/index.html +11 -9
templates/index.html
CHANGED
@@ -326,12 +326,11 @@
|
|
326 |
|
327 |
|
328 |
// Fullscreen
|
329 |
-
|
330 |
const feed = document.getElementById("feed");
|
|
|
331 |
|
332 |
-
|
333 |
-
|
334 |
-
feed.addEventListener("click", function() {
|
335 |
if (!isFullscreen) {
|
336 |
if (this.requestFullscreen) {
|
337 |
this.requestFullscreen();
|
@@ -353,13 +352,16 @@
|
|
353 |
document.msExitFullscreen();
|
354 |
}
|
355 |
}
|
356 |
-
}
|
|
|
|
|
|
|
357 |
|
358 |
-
// Listen for fullscreen changes to update isFullscreen
|
359 |
document.addEventListener("fullscreenchange", function() {
|
360 |
-
|
361 |
-
|
362 |
-
|
|
|
363 |
|
364 |
</script>
|
365 |
</body>
|
|
|
326 |
|
327 |
|
328 |
// Fullscreen
|
329 |
+
document.addEventListener("DOMContentLoaded", function() {
|
330 |
const feed = document.getElementById("feed");
|
331 |
+
let isFullscreen = false;
|
332 |
|
333 |
+
function toggleFullScreen() {
|
|
|
|
|
334 |
if (!isFullscreen) {
|
335 |
if (this.requestFullscreen) {
|
336 |
this.requestFullscreen();
|
|
|
352 |
document.msExitFullscreen();
|
353 |
}
|
354 |
}
|
355 |
+
}
|
356 |
+
|
357 |
+
feed.addEventListener("click", toggleFullScreen);
|
358 |
+
feed.addEventListener("touchstart", toggleFullScreen);
|
359 |
|
|
|
360 |
document.addEventListener("fullscreenchange", function() {
|
361 |
+
isFullscreen = !isFullscreen;
|
362 |
+
});
|
363 |
+
});
|
364 |
+
|
365 |
|
366 |
</script>
|
367 |
</body>
|