Update templates/index.html
Browse files2 unmodified lines345678910111213141516171819201 unmodified line2223242526272829303132333435363738394041424344454647484950515253545556573 unmodified lines61626364656667686970717273747576771 unmodified line7980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971 unmodified line1992002012022032042052062072082092102112124 unmodified lines2172182192202212222232242252262272282292302312322332342352362372387 unmodified lines2462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752 unmodified lines<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>VibeSync Ultra | Professional AI Visualizer</title><style>body {background: #050505;color: #fff;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;display: flex;justify-content: center;align-items: center;min-height: 100vh;margin: 0;overflow-x: hidden;}.card {background: #000;1 unmodified linepadding: 30px;border-radius: 25px;width: 90%;max-width: 440px;text-align: center;box-shadow: 0 0 40px rgba(0, 242, 234, 0.2);position: relative;}h2 {letter-spacing: 6px;margin-bottom: 5px;font-size: 28px;text-transform: uppercase;}h2 span { color: #ff0050; text-shadow: 0 0 10px #ff0050; }.subtitle {font-size: 10px;color: #666;text-transform: uppercase;letter-spacing: 3px;margin-bottom: 25px;}.input-group {text-align: left;margin-bottom: 15px;}label {display: block;font-size: 11px;color: #00f2ea;margin-bottom: 6px;text-transform: uppercase;font-weight: bold;}input, select {width: 100%;3 unmodified linescolor: #fff;border-radius: 12px;box-sizing: border-box;font-size: 14px;outline: none;transition: 0.3s;}input:focus, select:focus { border-color: #ff0050; }input:disabled, select:disabled { opacity: 0.3; cursor: not-allowed; }.btn {width: 100%;padding: 16px;margin-top: 15px;border-radius: 12px;border: none;background: linear-gradient(45deg, #00f2ea, #ff0050);1 unmodified linefont-weight: bold;font-size: 16px;cursor: pointer;text-transform: uppercase;letter-spacing: 1px;transition: 0.3s;}.btn:hover { transform: scale(1.02); filter: brightness(1.1); }.btn:disabled {background: #222;color: #555;cursor: not-allowed;transform: none;}#prog {display: none;margin-top: 25px;padding: 20px;background: #0a0a0a;border-radius: 15px;border: 1px solid #222;}.bar-container {background: #1a1a1a;height: 12px;border-radius: 6px;margin: 15px 0;overflow: hidden;border: 1px solid #333;}.fill {background: linear-gradient(90deg, #00f2ea, #ff0050);width: 0%;height: 100%;transition: 0.5s;box-shadow: 0 0 15px #00f2ea;}#st { font-size: 13px; color: #00f2ea; font-weight: bold; }#pct { font-size: 16px; color: #ff0050; font-weight: bold; margin-top: 5px; }#dl-box {display: none;margin-top: 25px;padding-top: 20px;border-top: 1px solid #222;}.dl-link {background: #238636;color: white;padding: 18px;display: block;text-decoration: none;border-radius: 12px;font-weight: bold;font-size: 18px;transition: 0.3s;}.dl-link:hover { background: #2ea043; transform: translateY(-2px); }</style></head><body><div class="card"><h2>VIBE<span>ULTRA</span></h2><p class="subtitle">Next-Gen Bass & Lightning AI</p><form id="ultraForm"><div class="input-group"><label>1. Video Format</label><select id="size" required><option value="9:16">Portrait (Shorts/Reels/TikTok)</option><option value="16:9">Landscape (YouTube/TV)</option></select></div><div class="input-group"><label>2. Audio File (Full Song)</label><input type="file" id="audio" accept="audio/*" required></div><div class="input-group"><label>3. Left Icon (Dhak-Dhak Effect)</label><input type="file" id="img1" accept="image/*" required></div><div class="input-group"><label>4. Right Icon (Dhak-Dhak Effect)</label><input type="file" id="img2" accept="image/*" required></div><div class="input-group"><label>5. Custom Background (Optional)</label><input type="file" id="bg" accept="image/*"><small style="font-size: 9px; color: #555;">Leave empty for default Black background.</small></div><button type="submit" class="btn" id="sBtn">⚡ START ULTRA RENDERING ⚡</button></form><div id="prog"><p id="st">Analyzing Audio Frequencies...</p><div class="bar-container"><div class="fill" id="bf"></div></div><p id="pct">0%</p><p style="font-size: 10px; color: #555; margin-top: 10px;">Please do not refresh the page during rendering.</p></div><div id="dl-box"><p style="margin:0 0 15px 0; font-size: 14px; color: #00f2ea;">✅ Rendering Successfull!</p><a id="dl" class="dl-link" href="/download">DOWNLOAD VIDEO 📥</a></div></div><script>const form = document.getElementById('ultraForm');const sBtn = document.getElementById('sBtn');const prog = document.getElementById('prog');const fill = document.getElementById('bf');1 unmodified lineconst pct = document.getElementById('pct');const dlBox = document.getElementById('dl-box');// Form controls for lockingconst controls = form.querySelectorAll('input, select, button');form.onsubmit = async (e) => {e.preventDefault();// LOCK UIcontrols.forEach(el => el.disabled = true);prog.style.display = 'block';dlBox.style.display = 'none';st.innerText = "Uploading Files to Server...";4 unmodified linesfd.append('img1', document.getElementById('img1').files[0]);fd.append('img2', document.getElementById('img2').files[0]);const bgFile = document.getElementById('bg').files[0];if (bgFile) {fd.append('bg', bgFile);}try {const res = await fetch('/process', { method: 'POST', body: fd });if (res.ok) {st.innerText = "Files Received. AI Rendering Started...";startPolling();} else {alert("Server Busy or Connection Error!");resetUI();}} catch (err) {alert("Upload Failed!");resetUI();}};7 unmodified linesif(d.progress > 0 && d.progress < 100) {fill.style.width = d.progress + '%';pct.innerText = d.progress + '%';st.innerText = "AI Rendering Frames & Lightning...";}if(d.progress === 100) {clearInterval(itv);fill.style.width = '100%';pct.innerText = '100%';st.innerText = "✅ VIDEO GENERATED SUCCESSFULLY!";dlBox.style.display = 'block';// UNLOCK UI for next taskcontrols.forEach(el => el.disabled = false);}if(d.progress === -1) {clearInterval(itv);alert("Rendering Failed. Please check file sizes.");resetUI();}} catch (e) { console.log("Connecting..."); }}, 3000); // Poll every 3 seconds}function resetUI() {controls.forEach(el => el.disabled = false);prog.style.display = 'none';}</script>2 unmodified lines3456789101112131415161718191 unmodified line2122232425262728293031323334353637383940414243444546473 unmodified lines51525354555657585960616263641 unmodified line666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761 unmodified line1781791801811821831841851861871881891901914 unmodified lines1961971981992002012022032042052062072082092102112122132142152167 unmodified lines2242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532 unmodified lines<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>VibeSync Lite AI | Low MB Visualizer</title><style>body {background: #050505;color: #fff;font-family: 'Segoe UI', sans-serif;display: flex;justify-content: center;align-items: center;min-height: 100vh;margin: 0;}.card {background: #000;1 unmodified linepadding: 30px;border-radius: 25px;width: 90%;max-width: 420px;text-align: center;box-shadow: 0 0 35px rgba(0, 242, 234, 0.2);}h2 { letter-spacing: 5px; margin-bottom: 5px; font-size: 26px; }h2 span { color: #ff0050; text-shadow: 0 0 10px #ff0050; }.subtitle {font-size: 10px;color: #555;text-transform: uppercase;letter-spacing: 2px;margin-bottom: 25px;}.input-group { text-align: left; margin-bottom: 15px; }label {display: block;font-size: 11px;color: #00f2ea;margin-bottom: 6px;text-transform: uppercase;font-weight: bold;}input, select {width: 100%;3 unmodified linescolor: #fff;border-radius: 12px;box-sizing: border-box;outline: none;}input:disabled, select:disabled { opacity: 0.3; cursor: not-allowed; }.btn {width: 100%;padding: 16px;margin-top: 10px;border-radius: 12px;border: none;background: linear-gradient(45deg, #00f2ea, #ff0050);1 unmodified linefont-weight: bold;font-size: 16px;cursor: pointer;transition: 0.3s;}.btn:disabled { background: #222; color: #555; cursor: not-allowed; }#prog {display: none;margin-top: 25px;padding: 15px;background: #0a0a0a;border-radius: 15px;}.bar-container {background: #1a1a1a;height: 10px;border-radius: 5px;margin: 12px 0;overflow: hidden;}.fill {background: linear-gradient(90deg, #00f2ea, #ff0050);width: 0%;height: 100%;transition: 0.5s;}#st { font-size: 12px; color: #00f2ea; }.mb-info {font-size: 9px;color: #444;margin-top: 8px;font-style: italic;}#dl-box {display: none;margin-top: 25px;border-top: 1px solid #222;padding-top: 20px;}.dl-link {background: #238636;color: white;padding: 15px;display: block;text-decoration: none;border-radius: 12px;font-weight: bold;}</style></head><body><div class="card"><h2>VIBE<span>LITE</span></h2><p class="subtitle">Police Light & Electric Spark AI</p><form id="liteForm"><div class="input-group"><label>1. Video Size</label><select id="size" required><option value="9:16">Portrait (9:16) - Shorts/Reels</option><option value="16:9">Landscape (16:9) - YouTube</option></select></div><div class="input-group"><label>2. Audio (Full Song)</label><input type="file" id="audio" accept="audio/*" required></div><div class="input-group"><label>3. Left Icon</label><input type="file" id="img1" accept="image/*" required></div><div class="input-group"><label>4. Right Icon</label><input type="file" id="img2" accept="image/*" required></div><div class="input-group"><label>5. Custom Background (Optional)</label><input type="file" id="bg" accept="image/*"></div><p class="mb-info">⚡ New: Optimized for Low MB Download (Compressed MP4)</p><button type="submit" class="btn" id="sBtn">GENERATE MASTER VIDEO ⚡</button></form><div id="prog"><p id="st">Starting AI Rendering...</p><div class="bar-container"><div class="fill" id="bf"></div></div><p id="pct" style="font-size: 14px; color: #ff0050; font-weight: bold;">0%</p></div><div id="dl-box"><p style="color: #00f2ea; font-size: 13px; margin-bottom: 10px;">✅ Video Ready (Low MB Optimized)</p><a id="dl" class="dl-link" href="/download">DOWNLOAD MP4 📥</a></div></div><script>const form = document.getElementById('liteForm');const sBtn = document.getElementById('sBtn');const prog = document.getElementById('prog');const fill = document.getElementById('bf');1 unmodified lineconst pct = document.getElementById('pct');const dlBox = document.getElementById('dl-box');// Disable inputs during renderingconst inputs = form.querySelectorAll('input, select, button');form.onsubmit = async (e) => {e.preventDefault();// Lock UIinputs.forEach(el => el.disabled = true);prog.style.display = 'block';dlBox.style.display = 'none';st.innerText = "Uploading Files to Server...";4 unmodified linesfd.append('img1', document.getElementById('img1').files[0]);fd.append('img2', document.getElementById('img2').files[0]);if (document.getElementById('bg').files[0]) {fd.append('bg', document.getElementById('bg').files[0]);}try {const res = await fetch('/process', { method: 'POST', body: fd });if (res.ok) {st.innerText = "Rendering Police Lights & Sparks...";startPolling();} else {alert("System Busy. Try again later.");resetUI();}} catch (err) {alert("Connection Error!");resetUI();}};7 unmodified linesif(d.progress > 0 && d.progress < 100) {fill.style.width = d.progress + '%';pct.innerText = d.progress + '%';st.innerText = "AI Rendering Frames: " + d.progress + "%";}if(d.progress === 100) {clearInterval(itv);fill.style.width = '100%';pct.innerText = '100%';st.innerText = "✅ PROCESSING COMPLETE!";dlBox.style.display = 'block';// Re-enable for next videoinputs.forEach(el => el.disabled = false);}if(d.progress === -1) {clearInterval(itv);alert("Rendering Error! Check audio format.");resetUI();}} catch (e) { console.log("Reconnecting..."); }}, 3000);}function resetUI() {inputs.forEach(el => el.disabled = false);prog.style.display = 'none';}</script>
templates/index.html+61-83