Spaces:
Running
Running
Commit ·
0c34094
1
Parent(s): 1441a83
added multiple video support
Browse files- frontend/app.js +3 -3
- frontend/index.html +1 -0
- frontend/style.css +10 -3
frontend/app.js
CHANGED
|
@@ -30,11 +30,11 @@ document.getElementById("video-form").addEventListener("submit", async (event) =
|
|
| 30 |
}
|
| 31 |
|
| 32 |
const loader = document.getElementById("loader");
|
| 33 |
-
const
|
| 34 |
const errorContainer = document.getElementById("error-container");
|
| 35 |
|
| 36 |
loader.classList.remove("hidden");
|
| 37 |
-
|
| 38 |
errorContainer.classList.add("hidden");
|
| 39 |
|
| 40 |
try {
|
|
@@ -55,7 +55,7 @@ document.getElementById("video-form").addEventListener("submit", async (event) =
|
|
| 55 |
const videoElement = document.createElement("video");
|
| 56 |
videoElement.src = videoUrl;
|
| 57 |
videoElement.controls = true;
|
| 58 |
-
|
| 59 |
});
|
| 60 |
} else {
|
| 61 |
throw new Error("No videos were generated.");
|
|
|
|
| 30 |
}
|
| 31 |
|
| 32 |
const loader = document.getElementById("loader");
|
| 33 |
+
const videoResults = document.getElementById("video-results");
|
| 34 |
const errorContainer = document.getElementById("error-container");
|
| 35 |
|
| 36 |
loader.classList.remove("hidden");
|
| 37 |
+
videoResults.innerHTML = ""; // Clear previous videos
|
| 38 |
errorContainer.classList.add("hidden");
|
| 39 |
|
| 40 |
try {
|
|
|
|
| 55 |
const videoElement = document.createElement("video");
|
| 56 |
videoElement.src = videoUrl;
|
| 57 |
videoElement.controls = true;
|
| 58 |
+
videoResults.appendChild(videoElement);
|
| 59 |
});
|
| 60 |
} else {
|
| 61 |
throw new Error("No videos were generated.");
|
frontend/index.html
CHANGED
|
@@ -91,6 +91,7 @@
|
|
| 91 |
|
| 92 |
<div id="video-container">
|
| 93 |
<div id="loader" class="hidden"></div>
|
|
|
|
| 94 |
<div id="error-container" class="hidden"></div>
|
| 95 |
</div>
|
| 96 |
</main>
|
|
|
|
| 91 |
|
| 92 |
<div id="video-container">
|
| 93 |
<div id="loader" class="hidden"></div>
|
| 94 |
+
<div id="video-results"></div>
|
| 95 |
<div id="error-container" class="hidden"></div>
|
| 96 |
</div>
|
| 97 |
</main>
|
frontend/style.css
CHANGED
|
@@ -107,9 +107,16 @@ button:hover {
|
|
| 107 |
text-align: center;
|
| 108 |
}
|
| 109 |
|
| 110 |
-
#
|
| 111 |
-
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
border-radius: 8px;
|
| 114 |
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
| 115 |
}
|
|
|
|
| 107 |
text-align: center;
|
| 108 |
}
|
| 109 |
|
| 110 |
+
#video-results {
|
| 111 |
+
display: flex;
|
| 112 |
+
flex-wrap: wrap;
|
| 113 |
+
gap: 1rem;
|
| 114 |
+
justify-content: center;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
#video-results video {
|
| 118 |
+
width: calc(50% - 0.5rem);
|
| 119 |
+
max-width: 400px;
|
| 120 |
border-radius: 8px;
|
| 121 |
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
| 122 |
}
|