Spaces:
Running
Running
Upload 3 files
Browse files- index.html +16 -18
- js/app.js +21 -0
- style.css +16 -24
index.html
CHANGED
@@ -1,19 +1,17 @@
|
|
1 |
-
<!
|
2 |
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
</body>
|
19 |
-
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
<html>
|
3 |
+
<head>
|
4 |
+
<title>Veo AI Generator</title>
|
5 |
+
<link rel="stylesheet" href="style.css" />
|
6 |
+
</head>
|
7 |
+
<body>
|
8 |
+
<div class="container">
|
9 |
+
<h1>Veo AI Generator</h1>
|
10 |
+
<input type="text" id="prompt" placeholder="Enter your video prompt" />
|
11 |
+
<button onclick="generate()">Generate Video</button>
|
12 |
+
<p id="status"></p>
|
13 |
+
<video id="result" controls style="display:none; margin-top:20px;"></video>
|
14 |
+
</div>
|
15 |
+
<script src="js/app.js"></script>
|
16 |
+
</body>
|
17 |
+
</html>
|
|
|
|
js/app.js
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
async function generate() {
|
2 |
+
const prompt = document.getElementById("prompt").value;
|
3 |
+
document.getElementById("status").innerText = "Generating...";
|
4 |
+
document.getElementById("result").style.display = "none";
|
5 |
+
|
6 |
+
const response = await fetch("https://your-hf-space-url.hf.space/generate", {
|
7 |
+
method: "POST",
|
8 |
+
headers: { "Content-Type": "application/json" },
|
9 |
+
body: JSON.stringify({ prompt })
|
10 |
+
});
|
11 |
+
|
12 |
+
const result = await response.json();
|
13 |
+
if (result.video_url) {
|
14 |
+
const video = document.getElementById("result");
|
15 |
+
video.src = result.video_url;
|
16 |
+
video.style.display = "block";
|
17 |
+
document.getElementById("status").innerText = "Done!";
|
18 |
+
} else {
|
19 |
+
document.getElementById("status").innerText = "Error.";
|
20 |
+
}
|
21 |
+
}
|
style.css
CHANGED
@@ -1,28 +1,20 @@
|
|
1 |
body {
|
2 |
-
|
3 |
-
|
|
|
|
|
4 |
}
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
9 |
}
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
font-size: 15px;
|
14 |
-
margin-bottom: 10px;
|
15 |
-
margin-top: 5px;
|
16 |
-
}
|
17 |
-
|
18 |
-
.card {
|
19 |
-
max-width: 620px;
|
20 |
-
margin: 0 auto;
|
21 |
-
padding: 16px;
|
22 |
-
border: 1px solid lightgray;
|
23 |
-
border-radius: 16px;
|
24 |
-
}
|
25 |
-
|
26 |
-
.card p:last-child {
|
27 |
-
margin-bottom: 0;
|
28 |
}
|
|
|
|
|
|
|
|
|
|
1 |
body {
|
2 |
+
font-family: Arial, sans-serif;
|
3 |
+
background: #f4f4f4;
|
4 |
+
padding: 2em;
|
5 |
+
text-align: center;
|
6 |
}
|
7 |
+
.container {
|
8 |
+
background: white;
|
9 |
+
padding: 2em;
|
10 |
+
border-radius: 10px;
|
11 |
+
display: inline-block;
|
12 |
}
|
13 |
+
input {
|
14 |
+
width: 300px;
|
15 |
+
padding: 0.5em;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
17 |
+
button {
|
18 |
+
margin-top: 1em;
|
19 |
+
padding: 0.5em 1em;
|
20 |
+
}
|