Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +464 -19
- prompts.txt +1 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: ai-video-generator
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: purple
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,464 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE 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>AI Video Generator | Transform Images to Videos</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
|
11 |
+
|
12 |
+
body {
|
13 |
+
font-family: 'Poppins', sans-serif;
|
14 |
+
background-color: #f8fafc;
|
15 |
+
}
|
16 |
+
|
17 |
+
.dropzone {
|
18 |
+
border: 2px dashed #cbd5e1;
|
19 |
+
transition: all 0.3s ease;
|
20 |
+
}
|
21 |
+
|
22 |
+
.dropzone.active {
|
23 |
+
border-color: #6366f1;
|
24 |
+
background-color: #eef2ff;
|
25 |
+
}
|
26 |
+
|
27 |
+
.progress-bar {
|
28 |
+
height: 8px;
|
29 |
+
transition: width 0.3s ease;
|
30 |
+
}
|
31 |
+
|
32 |
+
.video-preview {
|
33 |
+
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
|
34 |
+
transition: all 0.3s ease;
|
35 |
+
}
|
36 |
+
|
37 |
+
.video-preview:hover {
|
38 |
+
transform: translateY(-2px);
|
39 |
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
|
40 |
+
}
|
41 |
+
|
42 |
+
.tooltip {
|
43 |
+
position: relative;
|
44 |
+
}
|
45 |
+
|
46 |
+
.tooltip-text {
|
47 |
+
visibility: hidden;
|
48 |
+
width: 120px;
|
49 |
+
background-color: #1e293b;
|
50 |
+
color: #fff;
|
51 |
+
text-align: center;
|
52 |
+
border-radius: 6px;
|
53 |
+
padding: 5px;
|
54 |
+
position: absolute;
|
55 |
+
z-index: 1;
|
56 |
+
bottom: 125%;
|
57 |
+
left: 50%;
|
58 |
+
margin-left: -60px;
|
59 |
+
opacity: 0;
|
60 |
+
transition: opacity 0.3s;
|
61 |
+
}
|
62 |
+
|
63 |
+
.tooltip:hover .tooltip-text {
|
64 |
+
visibility: visible;
|
65 |
+
opacity: 1;
|
66 |
+
}
|
67 |
+
|
68 |
+
.animate-pulse {
|
69 |
+
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
70 |
+
}
|
71 |
+
|
72 |
+
@keyframes pulse {
|
73 |
+
0%, 100% {
|
74 |
+
opacity: 1;
|
75 |
+
}
|
76 |
+
50% {
|
77 |
+
opacity: 0.5;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
</style>
|
81 |
+
</head>
|
82 |
+
<body class="min-h-screen">
|
83 |
+
<div class="container mx-auto px-4 py-8 max-w-6xl">
|
84 |
+
<!-- Header -->
|
85 |
+
<header class="mb-12 text-center">
|
86 |
+
<h1 class="text-4xl font-bold text-indigo-900 mb-2">AI Video Generator</h1>
|
87 |
+
<p class="text-lg text-gray-600">Transform your images into stunning videos with AI-powered motion effects</p>
|
88 |
+
</header>
|
89 |
+
|
90 |
+
<!-- Main Content -->
|
91 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden">
|
92 |
+
<div class="md:flex">
|
93 |
+
<!-- Left Panel - Upload & Settings -->
|
94 |
+
<div class="md:w-1/2 p-8 border-r border-gray-100">
|
95 |
+
<div class="mb-8">
|
96 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-4">Upload Images</h2>
|
97 |
+
|
98 |
+
<!-- Dropzone -->
|
99 |
+
<div id="dropzone" class="dropzone rounded-lg p-8 text-center cursor-pointer mb-4">
|
100 |
+
<div class="flex flex-col items-center justify-center">
|
101 |
+
<i class="fas fa-cloud-upload-alt text-4xl text-indigo-500 mb-3"></i>
|
102 |
+
<p class="text-gray-600 mb-1">Drag & drop your images here</p>
|
103 |
+
<p class="text-sm text-gray-500">or click to browse files</p>
|
104 |
+
<input type="file" id="fileInput" class="hidden" accept="image/*" multiple>
|
105 |
+
</div>
|
106 |
+
</div>
|
107 |
+
|
108 |
+
<div class="text-sm text-gray-500 text-center">
|
109 |
+
Supports JPG, PNG, WEBP (Max 20 images, 10MB each)
|
110 |
+
</div>
|
111 |
+
</div>
|
112 |
+
|
113 |
+
<!-- Uploaded Files List -->
|
114 |
+
<div id="fileListContainer" class="mb-8 hidden">
|
115 |
+
<h3 class="font-medium text-gray-700 mb-3">Selected Images</h3>
|
116 |
+
<div id="fileList" class="max-h-48 overflow-y-auto border border-gray-200 rounded-lg p-2">
|
117 |
+
<!-- Files will be listed here -->
|
118 |
+
</div>
|
119 |
+
</div>
|
120 |
+
|
121 |
+
<!-- Settings -->
|
122 |
+
<div class="mb-8">
|
123 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-4">Video Settings</h2>
|
124 |
+
|
125 |
+
<div class="space-y-4">
|
126 |
+
<div>
|
127 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Transition Style</label>
|
128 |
+
<select id="transitionStyle" class="w-full rounded-lg border-gray-300 focus:border-indigo-500 focus:ring-indigo-500">
|
129 |
+
<option value="slide">Slide</option>
|
130 |
+
<option value="fade">Fade</option>
|
131 |
+
<option value="zoom">Zoom</option>
|
132 |
+
<option value="pan">Pan & Zoom</option>
|
133 |
+
</select>
|
134 |
+
</div>
|
135 |
+
|
136 |
+
<div>
|
137 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Duration per Image (seconds)</label>
|
138 |
+
<input type="range" id="durationSlider" min="1" max="10" value="3" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
|
139 |
+
<div class="flex justify-between text-xs text-gray-500 mt-1">
|
140 |
+
<span>1s</span>
|
141 |
+
<span id="durationValue">3s</span>
|
142 |
+
<span>10s</span>
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
|
146 |
+
<div>
|
147 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Video Resolution</label>
|
148 |
+
<select id="resolution" class="w-full rounded-lg border-gray-300 focus:border-indigo-500 focus:ring-indigo-500">
|
149 |
+
<option value="480p">480p (SD)</option>
|
150 |
+
<option value="720p" selected>720p (HD)</option>
|
151 |
+
<option value="1080p">1080p (Full HD)</option>
|
152 |
+
<option value="4k">4K (Ultra HD)</option>
|
153 |
+
</select>
|
154 |
+
</div>
|
155 |
+
|
156 |
+
<div class="flex items-center">
|
157 |
+
<input type="checkbox" id="addMusic" class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded">
|
158 |
+
<label for="addMusic" class="ml-2 block text-sm text-gray-700">Add background music</label>
|
159 |
+
</div>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
|
163 |
+
<!-- Generate Button -->
|
164 |
+
<button id="generateBtn" class="w-full bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-3 px-4 rounded-lg transition duration-200 flex items-center justify-center">
|
165 |
+
<i class="fas fa-magic mr-2"></i> Generate Video
|
166 |
+
</button>
|
167 |
+
</div>
|
168 |
+
|
169 |
+
<!-- Right Panel - Preview & Results -->
|
170 |
+
<div class="md:w-1/2 p-8 bg-gray-50">
|
171 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-6">Video Preview</h2>
|
172 |
+
|
173 |
+
<!-- Empty State -->
|
174 |
+
<div id="emptyState" class="flex flex-col items-center justify-center h-64 bg-white rounded-lg border-2 border-dashed border-gray-200 text-center p-6">
|
175 |
+
<i class="fas fa-video text-4xl text-gray-300 mb-3"></i>
|
176 |
+
<h3 class="text-lg font-medium text-gray-500">No video generated yet</h3>
|
177 |
+
<p class="text-gray-400 mt-1">Upload images and click "Generate Video" to create your AI video</p>
|
178 |
+
</div>
|
179 |
+
|
180 |
+
<!-- Processing State -->
|
181 |
+
<div id="processingState" class="hidden flex-col items-center justify-center h-64 bg-white rounded-lg border border-gray-200 text-center p-6">
|
182 |
+
<div class="animate-pulse mb-4">
|
183 |
+
<i class="fas fa-cog fa-spin text-3xl text-indigo-500"></i>
|
184 |
+
</div>
|
185 |
+
<h3 class="text-lg font-medium text-gray-700 mb-2">Processing your video</h3>
|
186 |
+
<p class="text-gray-500 mb-4">This may take a few moments...</p>
|
187 |
+
|
188 |
+
<div class="w-full bg-gray-200 rounded-full h-2.5 mb-2">
|
189 |
+
<div id="progressBar" class="progress-bar bg-indigo-600 rounded-full h-2.5" style="width: 0%"></div>
|
190 |
+
</div>
|
191 |
+
<p id="progressText" class="text-sm text-gray-500">0% completed</p>
|
192 |
+
</div>
|
193 |
+
|
194 |
+
<!-- Result State -->
|
195 |
+
<div id="resultState" class="hidden">
|
196 |
+
<div class="video-preview bg-white rounded-lg overflow-hidden mb-4">
|
197 |
+
<video id="generatedVideo" controls class="w-full" poster="https://via.placeholder.com/800x450?text=Video+Preview">
|
198 |
+
Your browser does not support the video tag.
|
199 |
+
</video>
|
200 |
+
</div>
|
201 |
+
|
202 |
+
<div class="flex flex-col sm:flex-row gap-3">
|
203 |
+
<button id="downloadBtn" class="flex-1 bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-4 rounded-lg transition duration-200 flex items-center justify-center">
|
204 |
+
<i class="fas fa-download mr-2"></i> Download
|
205 |
+
</button>
|
206 |
+
<button id="newVideoBtn" class="flex-1 bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium py-2 px-4 rounded-lg transition duration-200 flex items-center justify-center">
|
207 |
+
<i class="fas fa-redo mr-2"></i> Create New
|
208 |
+
</button>
|
209 |
+
<div class="tooltip">
|
210 |
+
<button id="shareBtn" class="flex-1 bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition duration-200 flex items-center justify-center">
|
211 |
+
<i class="fas fa-share-alt mr-2"></i> Share
|
212 |
+
</button>
|
213 |
+
<span class="tooltip-text">Coming soon!</span>
|
214 |
+
</div>
|
215 |
+
</div>
|
216 |
+
|
217 |
+
<div class="mt-6 bg-indigo-50 border border-indigo-100 rounded-lg p-4">
|
218 |
+
<h3 class="font-medium text-indigo-800 mb-2">Video Details</h3>
|
219 |
+
<div class="grid grid-cols-2 gap-2 text-sm">
|
220 |
+
<div class="text-gray-600">Duration:</div>
|
221 |
+
<div id="videoDuration" class="text-gray-800">-</div>
|
222 |
+
|
223 |
+
<div class="text-gray-600">Resolution:</div>
|
224 |
+
<div id="videoResolution" class="text-gray-800">-</div>
|
225 |
+
|
226 |
+
<div class="text-gray-600">File Size:</div>
|
227 |
+
<div id="videoSize" class="text-gray-800">-</div>
|
228 |
+
|
229 |
+
<div class="text-gray-600">Format:</div>
|
230 |
+
<div id="videoFormat" class="text-gray-800">MP4</div>
|
231 |
+
</div>
|
232 |
+
</div>
|
233 |
+
</div>
|
234 |
+
</div>
|
235 |
+
</div>
|
236 |
+
</div>
|
237 |
+
|
238 |
+
<!-- Features Section -->
|
239 |
+
<div class="mt-16">
|
240 |
+
<h2 class="text-2xl font-bold text-center text-gray-800 mb-8">AI-Powered Video Creation</h2>
|
241 |
+
|
242 |
+
<div class="grid md:grid-cols-3 gap-8">
|
243 |
+
<div class="bg-white p-6 rounded-xl shadow-sm hover:shadow-md transition duration-200">
|
244 |
+
<div class="text-indigo-500 mb-4 text-3xl">
|
245 |
+
<i class="fas fa-brain"></i>
|
246 |
+
</div>
|
247 |
+
<h3 class="font-semibold text-lg mb-2">Smart Motion Effects</h3>
|
248 |
+
<p class="text-gray-600">Our AI analyzes your images and applies natural-looking motion effects to create dynamic videos.</p>
|
249 |
+
</div>
|
250 |
+
|
251 |
+
<div class="bg-white p-6 rounded-xl shadow-sm hover:shadow-md transition duration-200">
|
252 |
+
<div class="text-indigo-500 mb-4 text-3xl">
|
253 |
+
<i class="fas fa-sliders-h"></i>
|
254 |
+
</div>
|
255 |
+
<h3 class="font-semibold text-lg mb-2">Customizable Transitions</h3>
|
256 |
+
<p class="text-gray-600">Choose from multiple transition styles and durations to match your creative vision.</p>
|
257 |
+
</div>
|
258 |
+
|
259 |
+
<div class="bg-white p-6 rounded-xl shadow-sm hover:shadow-md transition duration-200">
|
260 |
+
<div class="text-indigo-500 mb-4 text-3xl">
|
261 |
+
<i class="fas fa-bolt"></i>
|
262 |
+
</div>
|
263 |
+
<h3 class="font-semibold text-lg mb-2">Fast Processing</h3>
|
264 |
+
<p class="text-gray-600">Generate high-quality videos in minutes with our optimized AI processing pipeline.</p>
|
265 |
+
</div>
|
266 |
+
</div>
|
267 |
+
</div>
|
268 |
+
</div>
|
269 |
+
|
270 |
+
<script>
|
271 |
+
document.addEventListener('DOMContentLoaded', function() {
|
272 |
+
// DOM Elements
|
273 |
+
const dropzone = document.getElementById('dropzone');
|
274 |
+
const fileInput = document.getElementById('fileInput');
|
275 |
+
const fileListContainer = document.getElementById('fileListContainer');
|
276 |
+
const fileList = document.getElementById('fileList');
|
277 |
+
const durationSlider = document.getElementById('durationSlider');
|
278 |
+
const durationValue = document.getElementById('durationValue');
|
279 |
+
const generateBtn = document.getElementById('generateBtn');
|
280 |
+
const emptyState = document.getElementById('emptyState');
|
281 |
+
const processingState = document.getElementById('processingState');
|
282 |
+
const resultState = document.getElementById('resultState');
|
283 |
+
const progressBar = document.getElementById('progressBar');
|
284 |
+
const progressText = document.getElementById('progressText');
|
285 |
+
const downloadBtn = document.getElementById('downloadBtn');
|
286 |
+
const newVideoBtn = document.getElementById('newVideoBtn');
|
287 |
+
const generatedVideo = document.getElementById('generatedVideo');
|
288 |
+
const videoDuration = document.getElementById('videoDuration');
|
289 |
+
const videoResolution = document.getElementById('videoResolution');
|
290 |
+
const videoSize = document.getElementById('videoSize');
|
291 |
+
|
292 |
+
// Variables
|
293 |
+
let selectedFiles = [];
|
294 |
+
|
295 |
+
// Event Listeners
|
296 |
+
dropzone.addEventListener('click', () => fileInput.click());
|
297 |
+
|
298 |
+
fileInput.addEventListener('change', handleFileSelect);
|
299 |
+
|
300 |
+
dropzone.addEventListener('dragover', (e) => {
|
301 |
+
e.preventDefault();
|
302 |
+
dropzone.classList.add('active');
|
303 |
+
});
|
304 |
+
|
305 |
+
dropzone.addEventListener('dragleave', () => {
|
306 |
+
dropzone.classList.remove('active');
|
307 |
+
});
|
308 |
+
|
309 |
+
dropzone.addEventListener('drop', (e) => {
|
310 |
+
e.preventDefault();
|
311 |
+
dropzone.classList.remove('active');
|
312 |
+
if (e.dataTransfer.files.length > 0) {
|
313 |
+
fileInput.files = e.dataTransfer.files;
|
314 |
+
handleFileSelect({ target: fileInput });
|
315 |
+
}
|
316 |
+
});
|
317 |
+
|
318 |
+
durationSlider.addEventListener('input', () => {
|
319 |
+
durationValue.textContent = `${durationSlider.value}s`;
|
320 |
+
});
|
321 |
+
|
322 |
+
generateBtn.addEventListener('click', generateVideo);
|
323 |
+
|
324 |
+
downloadBtn.addEventListener('click', downloadVideo);
|
325 |
+
|
326 |
+
newVideoBtn.addEventListener('click', resetForm);
|
327 |
+
|
328 |
+
// Functions
|
329 |
+
function handleFileSelect(event) {
|
330 |
+
const files = Array.from(event.target.files).slice(0, 20); // Limit to 20 files
|
331 |
+
|
332 |
+
// Filter only image files
|
333 |
+
selectedFiles = files.filter(file => file.type.match('image.*'));
|
334 |
+
|
335 |
+
if (selectedFiles.length > 0) {
|
336 |
+
displayFileList();
|
337 |
+
} else {
|
338 |
+
alert('Please select valid image files (JPG, PNG, WEBP)');
|
339 |
+
}
|
340 |
+
}
|
341 |
+
|
342 |
+
function displayFileList() {
|
343 |
+
fileList.innerHTML = '';
|
344 |
+
|
345 |
+
selectedFiles.forEach((file, index) => {
|
346 |
+
const fileItem = document.createElement('div');
|
347 |
+
fileItem.className = 'flex items-center justify-between py-2 px-3 hover:bg-gray-50 rounded';
|
348 |
+
|
349 |
+
const fileInfo = document.createElement('div');
|
350 |
+
fileInfo.className = 'flex items-center truncate';
|
351 |
+
|
352 |
+
const fileIcon = document.createElement('i');
|
353 |
+
fileIcon.className = 'fas fa-image text-gray-400 mr-3';
|
354 |
+
|
355 |
+
const fileName = document.createElement('span');
|
356 |
+
fileName.className = 'text-sm text-gray-700 truncate';
|
357 |
+
fileName.textContent = file.name;
|
358 |
+
|
359 |
+
const fileSize = document.createElement('span');
|
360 |
+
fileSize.className = 'text-xs text-gray-500 ml-2';
|
361 |
+
fileSize.textContent = formatFileSize(file.size);
|
362 |
+
|
363 |
+
const removeBtn = document.createElement('button');
|
364 |
+
removeBtn.className = 'text-red-400 hover:text-red-600 ml-2';
|
365 |
+
removeBtn.innerHTML = '<i class="fas fa-times"></i>';
|
366 |
+
removeBtn.addEventListener('click', () => removeFile(index));
|
367 |
+
|
368 |
+
fileInfo.appendChild(fileIcon);
|
369 |
+
fileInfo.appendChild(fileName);
|
370 |
+
fileInfo.appendChild(fileSize);
|
371 |
+
|
372 |
+
fileItem.appendChild(fileInfo);
|
373 |
+
fileItem.appendChild(removeBtn);
|
374 |
+
|
375 |
+
fileList.appendChild(fileItem);
|
376 |
+
});
|
377 |
+
|
378 |
+
fileListContainer.classList.remove('hidden');
|
379 |
+
}
|
380 |
+
|
381 |
+
function removeFile(index) {
|
382 |
+
selectedFiles.splice(index, 1);
|
383 |
+
|
384 |
+
if (selectedFiles.length > 0) {
|
385 |
+
displayFileList();
|
386 |
+
} else {
|
387 |
+
fileListContainer.classList.add('hidden');
|
388 |
+
}
|
389 |
+
}
|
390 |
+
|
391 |
+
function formatFileSize(bytes) {
|
392 |
+
if (bytes === 0) return '0 Bytes';
|
393 |
+
const k = 1024;
|
394 |
+
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
|
395 |
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
396 |
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i];
|
397 |
+
}
|
398 |
+
|
399 |
+
function generateVideo() {
|
400 |
+
if (selectedFiles.length === 0) {
|
401 |
+
alert('Please upload at least one image');
|
402 |
+
return;
|
403 |
+
}
|
404 |
+
|
405 |
+
// Show processing state
|
406 |
+
emptyState.classList.add('hidden');
|
407 |
+
processingState.classList.remove('hidden');
|
408 |
+
resultState.classList.add('hidden');
|
409 |
+
|
410 |
+
// Simulate processing with progress updates
|
411 |
+
let progress = 0;
|
412 |
+
const interval = setInterval(() => {
|
413 |
+
progress += Math.random() * 10;
|
414 |
+
if (progress > 100) progress = 100;
|
415 |
+
|
416 |
+
progressBar.style.width = `${progress}%`;
|
417 |
+
progressText.textContent = `${Math.round(progress)}% completed`;
|
418 |
+
|
419 |
+
if (progress === 100) {
|
420 |
+
clearInterval(interval);
|
421 |
+
setTimeout(showResult, 500);
|
422 |
+
}
|
423 |
+
}, 500);
|
424 |
+
}
|
425 |
+
|
426 |
+
function showResult() {
|
427 |
+
processingState.classList.add('hidden');
|
428 |
+
resultState.classList.remove('hidden');
|
429 |
+
|
430 |
+
// In a real app, this would be the actual generated video
|
431 |
+
// For demo purposes, we'll use a placeholder
|
432 |
+
generatedVideo.src = 'https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4';
|
433 |
+
generatedVideo.poster = URL.createObjectURL(selectedFiles[0]);
|
434 |
+
|
435 |
+
// Set video details
|
436 |
+
const duration = selectedFiles.length * parseInt(durationSlider.value);
|
437 |
+
videoDuration.textContent = `${duration} seconds`;
|
438 |
+
|
439 |
+
const resolution = document.getElementById('resolution').value;
|
440 |
+
videoResolution.textContent = resolution.toUpperCase();
|
441 |
+
|
442 |
+
// Random file size for demo
|
443 |
+
const sizeMB = (Math.random() * 5 + 1).toFixed(1);
|
444 |
+
videoSize.textContent = `${sizeMB} MB`;
|
445 |
+
}
|
446 |
+
|
447 |
+
function downloadVideo() {
|
448 |
+
// In a real app, this would download the actual generated video
|
449 |
+
alert('Video download would start here. This is a demo.');
|
450 |
+
}
|
451 |
+
|
452 |
+
function resetForm() {
|
453 |
+
selectedFiles = [];
|
454 |
+
fileInput.value = '';
|
455 |
+
fileListContainer.classList.add('hidden');
|
456 |
+
resultState.classList.add('hidden');
|
457 |
+
emptyState.classList.remove('hidden');
|
458 |
+
durationSlider.value = 3;
|
459 |
+
durationValue.textContent = '3s';
|
460 |
+
}
|
461 |
+
});
|
462 |
+
</script>
|
463 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=XXXMARK/ai-video-generator" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
464 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
ai video from images - generate- videos from uploaded images , motion images with ai
|