Spaces:
Configuration error
Configuration error
Dee Ferdinand commited on
Commit ·
f4ac095
1
Parent(s): b84a129
feat: init Dee Video Studio — HyperFrames cloud render for testimonial/teaser/trailer videos
Browse files- 4 workflows: testimonial (75s), teaser (30s), trailer (60s), community (60s)
- 6 royalty-free Pixabay music tracks auto-selected by workflow
- WebSocket real-time render progress
- Dark-mode Studio UI with drag-drop upload
- HuggingFace Docker Space ready (port 7860)
- static/index.html +220 -0
static/index.html
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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">
|
| 6 |
+
<title>Dee Video Studio</title>
|
| 7 |
+
<style>
|
| 8 |
+
:root{--bg:#0f0f0f;--s:#1a1a1a;--s2:#242424;--b:rgba(255,255,255,0.1);--a:#7C6FE0;--a2:#E06F9A;--t:#e8e6e1;--m:#888;--g:#4ade80;--r:#f87171;--rad:12px}
|
| 9 |
+
*{box-sizing:border-box;margin:0;padding:0}
|
| 10 |
+
body{background:var(--bg);color:var(--t);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100vh}
|
| 11 |
+
header{padding:20px 28px;border-bottom:1px solid var(--b);display:flex;align-items:center;gap:12px}
|
| 12 |
+
header h1{font-size:18px;font-weight:700}header span{font-size:12px;color:var(--m)}
|
| 13 |
+
.dot{width:8px;height:8px;border-radius:50%;background:var(--g);animation:pulse 2s infinite}
|
| 14 |
+
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
|
| 15 |
+
.layout{display:grid;grid-template-columns:360px 1fr;min-height:calc(100vh - 61px)}
|
| 16 |
+
.sidebar{border-right:1px solid var(--b);padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:16px}
|
| 17 |
+
.main{padding:20px;overflow-y:auto}
|
| 18 |
+
.card{background:var(--s);border:1px solid var(--b);border-radius:var(--rad);padding:14px}
|
| 19 |
+
.card-title{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--m);margin-bottom:10px}
|
| 20 |
+
.wf-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}
|
| 21 |
+
.wf-pill{padding:10px;border-radius:8px;border:1px solid var(--b);cursor:pointer;background:var(--s2);text-align:left;transition:all .15s;width:100%}
|
| 22 |
+
.wf-pill:hover{border-color:var(--a)}.wf-pill.active{border-color:var(--a);background:rgba(124,111,224,.15)}
|
| 23 |
+
.wf-pill .icon{font-size:18px;display:block;margin-bottom:3px}
|
| 24 |
+
.wf-pill .name{font-size:12px;font-weight:600;color:var(--t)}
|
| 25 |
+
.wf-pill .desc{font-size:10px;color:var(--m);margin-top:2px;line-height:1.35}
|
| 26 |
+
.drop-zone{border:2px dashed var(--b);border-radius:var(--rad);padding:24px 12px;text-align:center;cursor:pointer;transition:all .2s}
|
| 27 |
+
.drop-zone.drag{border-color:var(--a);background:rgba(124,111,224,.08)}
|
| 28 |
+
.drop-zone input{display:none}
|
| 29 |
+
.drop-zone .dz-icon{font-size:28px;margin-bottom:6px}
|
| 30 |
+
.drop-zone p{font-size:12px;color:var(--m)}
|
| 31 |
+
.drop-zone strong{color:var(--t)}
|
| 32 |
+
.file-list{display:flex;flex-direction:column;gap:5px;margin-top:8px}
|
| 33 |
+
.file-item{display:flex;align-items:center;gap:7px;padding:7px 9px;background:var(--s2);border-radius:7px;font-size:11px}
|
| 34 |
+
.fi-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
| 35 |
+
.fi-size{color:var(--m);flex-shrink:0}
|
| 36 |
+
.fi-rm{background:none;border:none;color:var(--m);cursor:pointer;font-size:13px;padding:0 3px}
|
| 37 |
+
.fi-rm:hover{color:var(--r)}
|
| 38 |
+
.field{margin-bottom:11px}
|
| 39 |
+
.field label{display:block;font-size:11px;color:var(--m);margin-bottom:4px}
|
| 40 |
+
.field input,.field select{width:100%;padding:7px 9px;background:var(--s2);border:1px solid var(--b);border-radius:7px;color:var(--t);font-size:12px;outline:none}
|
| 41 |
+
.field input:focus,.field select:focus{border-color:var(--a)}
|
| 42 |
+
.field select option{background:var(--s2)}
|
| 43 |
+
.music-grid{display:flex;flex-direction:column;gap:5px}
|
| 44 |
+
.music-item{display:flex;align-items:center;gap:8px;padding:7px 9px;background:var(--s2);border-radius:7px;border:1px solid var(--b);cursor:pointer;transition:border-color .15s}
|
| 45 |
+
.music-item:hover,.music-item.sel{border-color:var(--a)}
|
| 46 |
+
.music-item input{accent-color:var(--a)}
|
| 47 |
+
.mi-info{flex:1}.mi-name{font-size:12px;font-weight:500}.mi-tags{font-size:10px;color:var(--m);margin-top:1px}
|
| 48 |
+
.mi-bpm{font-size:10px;color:var(--m);flex-shrink:0}
|
| 49 |
+
.render-btn{width:100%;padding:13px;background:var(--a);color:#fff;border:none;border-radius:var(--rad);font-size:14px;font-weight:700;cursor:pointer;transition:all .15s}
|
| 50 |
+
.render-btn:hover:not(:disabled){background:#6b5fd4}
|
| 51 |
+
.render-btn:disabled{opacity:.5;cursor:not-allowed}
|
| 52 |
+
.job-item{background:var(--s);border:1px solid var(--b);border-radius:var(--rad);padding:14px;margin-bottom:10px}
|
| 53 |
+
.job-header{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:8px}
|
| 54 |
+
.job-name{font-size:13px;font-weight:600}.job-meta{font-size:10px;color:var(--m);margin-top:2px}
|
| 55 |
+
.sbadge{font-size:10px;font-weight:600;padding:3px 8px;border-radius:99px;flex-shrink:0}
|
| 56 |
+
.sq{background:rgba(251,191,36,.15);color:#fbbf24}
|
| 57 |
+
.sc{background:rgba(124,111,224,.2);color:#a78bfa}
|
| 58 |
+
.sr{background:rgba(56,189,248,.15);color:#38bdf8}
|
| 59 |
+
.sd{background:rgba(74,222,128,.15);color:var(--g)}
|
| 60 |
+
.se{background:rgba(248,113,113,.15);color:var(--r)}
|
| 61 |
+
.prog-bar{height:4px;background:var(--s2);border-radius:99px;overflow:hidden;margin-bottom:8px}
|
| 62 |
+
.prog-fill{height:100%;background:linear-gradient(90deg,var(--a),var(--a2));border-radius:99px;transition:width .3s}
|
| 63 |
+
.job-actions{display:flex;gap:7px}
|
| 64 |
+
.btn-sm{padding:5px 12px;border-radius:7px;font-size:11px;font-weight:600;cursor:pointer;border:none;transition:all .15s}
|
| 65 |
+
.btn-dl{background:var(--g);color:#000}.btn-dl:hover{background:#22c55e}
|
| 66 |
+
.btn-rt{background:var(--s2);color:var(--t);border:1px solid var(--b)}
|
| 67 |
+
.section-hdr{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
|
| 68 |
+
.section-hdr h2{font-size:15px;font-weight:700}
|
| 69 |
+
.section-hdr span{font-size:11px;color:var(--m)}
|
| 70 |
+
.empty{text-align:center;padding:50px 20px;color:var(--m)}
|
| 71 |
+
.empty .ei{font-size:44px;margin-bottom:10px}
|
| 72 |
+
.empty p{font-size:13px}
|
| 73 |
+
input[type=range]{accent-color:var(--a);cursor:pointer;width:100%}
|
| 74 |
+
.toast{position:fixed;bottom:20px;right:20px;padding:10px 16px;background:var(--s);border:1px solid var(--b);border-radius:var(--rad);font-size:12px;z-index:999;animation:tin .2s ease}
|
| 75 |
+
@keyframes tin{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
|
| 76 |
+
</style>
|
| 77 |
+
</head>
|
| 78 |
+
<body>
|
| 79 |
+
<header>
|
| 80 |
+
<div class="dot"></div>
|
| 81 |
+
<h1>🎬 Dee Video Studio</h1>
|
| 82 |
+
<span>HyperFrames · Cloud Render · AI-powered</span>
|
| 83 |
+
</header>
|
| 84 |
+
<div class="layout">
|
| 85 |
+
<div class="sidebar">
|
| 86 |
+
<div class="card">
|
| 87 |
+
<div class="card-title">Video Type</div>
|
| 88 |
+
<div class="wf-grid" id="wf-grid"></div>
|
| 89 |
+
</div>
|
| 90 |
+
<div class="card">
|
| 91 |
+
<div class="card-title">Upload Assets</div>
|
| 92 |
+
<div class="drop-zone" id="dz">
|
| 93 |
+
<input type="file" id="fi" multiple accept="video/*,image/*,audio/*">
|
| 94 |
+
<div class="dz-icon">📁</div>
|
| 95 |
+
<p><strong>Click or drag files here</strong></p>
|
| 96 |
+
<p>Videos · Photos · Audio — up to 500MB total</p>
|
| 97 |
+
</div>
|
| 98 |
+
<div class="file-list" id="fl"></div>
|
| 99 |
+
</div>
|
| 100 |
+
<div class="card">
|
| 101 |
+
<div class="card-title">Project Details</div>
|
| 102 |
+
<div class="field"><label>Client / Event Name</label><input id="clientName" placeholder="e.g. Purbasari Indonesia"></div>
|
| 103 |
+
<div class="field"><label>Trainer Name</label><input id="trainerName" value="Dee Ferdinand"></div>
|
| 104 |
+
<div class="field"><label>Tagline</label><input id="tagline" value="AI Corporate Trainer"></div>
|
| 105 |
+
<div class="field"><label>Website</label><input id="website" value="deeferdinand.com"></div>
|
| 106 |
+
<div class="field"><label>Format</label>
|
| 107 |
+
<select id="format">
|
| 108 |
+
<option value="9:16">9:16 Vertical (Reels / TikTok / Shorts)</option>
|
| 109 |
+
<option value="16:9">16:9 Landscape (YouTube / LinkedIn)</option>
|
| 110 |
+
<option value="1:1">1:1 Square (Instagram Feed)</option>
|
| 111 |
+
</select>
|
| 112 |
+
</div>
|
| 113 |
+
</div>
|
| 114 |
+
<div class="card">
|
| 115 |
+
<div class="card-title">Background Music</div>
|
| 116 |
+
<div class="music-grid" id="mg">
|
| 117 |
+
<label class="music-item sel"><input type="radio" name="music" value="auto" checked>
|
| 118 |
+
<div class="mi-info"><div class="mi-name">🤖 Auto-select</div><div class="mi-tags">Matches your workflow</div></div>
|
| 119 |
+
</label>
|
| 120 |
+
</div>
|
| 121 |
+
<div class="field" style="margin-top:10px">
|
| 122 |
+
<label>Volume: <span id="vl">30%</span></label>
|
| 123 |
+
<input type="range" id="mvol" min="0" max="100" value="30" oninput="document.getElementById('vl').textContent=this.value+'%'">
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
+
<button class="render-btn" id="rb" onclick="startRender()">▶ Render Video</button>
|
| 127 |
+
</div>
|
| 128 |
+
<div class="main">
|
| 129 |
+
<div class="section-hdr">
|
| 130 |
+
<h2>Render Queue</h2>
|
| 131 |
+
<span id="jc">0 jobs</span>
|
| 132 |
+
</div>
|
| 133 |
+
<div id="jlist">
|
| 134 |
+
<div class="empty"><div class="ei">🎬</div><p>Upload assets and hit Render to create your first video.</p></div>
|
| 135 |
+
</div>
|
| 136 |
+
</div>
|
| 137 |
+
</div>
|
| 138 |
+
<script>
|
| 139 |
+
const API='';
|
| 140 |
+
let wf='testimonial', files=[], jobs={};
|
| 141 |
+
|
| 142 |
+
async function init(){
|
| 143 |
+
try{
|
| 144 |
+
const [wfs,tracks]=await Promise.all([fetch(API+'/api/workflows').then(r=>r.json()),fetch(API+'/api/music').then(r=>r.json())]);
|
| 145 |
+
document.getElementById('wf-grid').innerHTML=wfs.map(w=>`<button class="wf-pill ${w.id===wf?'active':''}" onclick="selWf('${w.id}')"><span class="icon">${w.icon}</span><span class="name">${w.name}</span><span class="desc">${w.description}</span></button>`).join('');
|
| 146 |
+
const mg=document.getElementById('mg');
|
| 147 |
+
mg.innerHTML=`<label class="music-item sel"><input type="radio" name="music" value="auto" checked><div class="mi-info"><div class="mi-name">🤖 Auto-select</div><div class="mi-tags">Matches your workflow</div></div></label>`
|
| 148 |
+
+tracks.map(t=>`<label class="music-item"><input type="radio" name="music" value="${t.file}"><div class="mi-info"><div class="mi-name">${moji(t.mood)} ${cap(t.mood)}</div><div class="mi-tags">${(t.tags||[]).slice(0,3).join(' · ')}</div></div><div class="mi-bpm">${t.bpm} bpm</div></label>`).join('');
|
| 149 |
+
mg.querySelectorAll('.music-item').forEach(el=>el.addEventListener('click',()=>{mg.querySelectorAll('.music-item').forEach(x=>x.classList.remove('sel'));el.classList.add('sel');}));
|
| 150 |
+
}catch(e){console.warn('Init error',e)}
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
function moji(m){return{corporate:'🏢',cinematic:'🎬',upbeat:'⚡',warm:'🤝',tech:'🤖',energetic:'🔥'}[m]||'🎵'}
|
| 154 |
+
function cap(s){return s?s[0].toUpperCase()+s.slice(1):''}
|
| 155 |
+
function selWf(id){wf=id;document.querySelectorAll('.wf-pill').forEach(el=>el.classList.toggle('active',el.getAttribute('onclick')===`selWf('${id}')`))}
|
| 156 |
+
|
| 157 |
+
const dz=document.getElementById('dz');
|
| 158 |
+
const fi=document.getElementById('fi');
|
| 159 |
+
dz.addEventListener('click',()=>fi.click());
|
| 160 |
+
fi.addEventListener('change',e=>addFiles([...e.target.files]));
|
| 161 |
+
dz.addEventListener('dragover',e=>{e.preventDefault();dz.classList.add('drag')});
|
| 162 |
+
dz.addEventListener('dragleave',()=>dz.classList.remove('drag'));
|
| 163 |
+
dz.addEventListener('drop',e=>{e.preventDefault();dz.classList.remove('drag');addFiles([...e.dataTransfer.files])});
|
| 164 |
+
|
| 165 |
+
function addFiles(f){files.push(...f);renderFL()}
|
| 166 |
+
function removeFile(i){files.splice(i,1);renderFL()}
|
| 167 |
+
function renderFL(){
|
| 168 |
+
const l=document.getElementById('fl');
|
| 169 |
+
l.innerHTML=files.map((f,i)=>`<div class="file-item"><span>${ficon(f.type)}</span><span class="fi-name">${f.name}</span><span class="fi-size">${fsz(f.size)}</span><button class="fi-rm" onclick="removeFile(${i})">✕</button></div>`).join('');
|
| 170 |
+
}
|
| 171 |
+
function ficon(m){if(m.startsWith('video/'))return'🎥';if(m.startsWith('image/'))return'🖼️';if(m.startsWith('audio/'))return'🎵';return'📄'}
|
| 172 |
+
function fsz(b){return b>1024*1024?(b/1024/1024).toFixed(1)+'MB':(b/1024).toFixed(0)+'KB'}
|
| 173 |
+
|
| 174 |
+
async function startRender(){
|
| 175 |
+
if(!files.length){toast('Please upload at least one video or photo.');return}
|
| 176 |
+
const rb=document.getElementById('rb');rb.disabled=true;
|
| 177 |
+
const fd=new FormData();
|
| 178 |
+
files.forEach(f=>fd.append('files',f));
|
| 179 |
+
fd.append('workflow',wf);
|
| 180 |
+
['clientName','trainerName','tagline','website','format'].forEach(id=>fd.append(id,document.getElementById(id).value));
|
| 181 |
+
fd.append('musicTrack',document.querySelector('input[name=music]:checked')?.value||'auto');
|
| 182 |
+
fd.append('musicVolume',(document.getElementById('mvol').value/100).toString());
|
| 183 |
+
try{
|
| 184 |
+
const res=await fetch(API+'/api/render',{method:'POST',body:fd});
|
| 185 |
+
const {jobId}=await res.json();
|
| 186 |
+
jobs[jobId]={id:jobId,status:'queued',progress:0,projectName:document.getElementById('clientName').value||'Untitled',workflow:wf,createdAt:Date.now()};
|
| 187 |
+
renderJobs();connectWS(jobId);toast('✅ Render started!');
|
| 188 |
+
}catch(e){toast('❌ '+e.message)}
|
| 189 |
+
finally{rb.disabled=false}
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
function connectWS(jobId){
|
| 193 |
+
const p=location.protocol==='https:'?'wss':'ws';
|
| 194 |
+
const s=new WebSocket(`${p}://${location.host}?job=${jobId}`);
|
| 195 |
+
s.onmessage=e=>{Object.assign(jobs[jobId]||{},JSON.parse(e.data));if(!jobs[jobId])jobs[jobId]=JSON.parse(e.data);renderJobs();const d=JSON.parse(e.data);if(d.status==='done'||d.status==='error')s.close()};
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
function renderJobs(){
|
| 199 |
+
const c=document.getElementById('jlist');
|
| 200 |
+
const list=Object.values(jobs).sort((a,b)=>b.createdAt-a.createdAt);
|
| 201 |
+
document.getElementById('jc').textContent=`${list.length} job${list.length!==1?'s':''}`;
|
| 202 |
+
if(!list.length){c.innerHTML='<div class="empty"><div class="ei">🎬</div><p>Upload assets and hit Render to create your first video.</p></div>';return}
|
| 203 |
+
const cls={queued:'sq',composing:'sc',rendering:'sr',done:'sd',error:'se'};
|
| 204 |
+
c.innerHTML=list.map(j=>`<div class="job-item">
|
| 205 |
+
<div class="job-header"><div><div class="job-name">${j.projectName||'Untitled'} · ${j.workflow||''}</div><div class="job-meta">${new Date(j.createdAt).toLocaleTimeString()} · ${(j.id||'').slice(0,8)}…</div></div>
|
| 206 |
+
<span class="sbadge ${cls[j.status]||'sq'}">${j.status}</span></div>
|
| 207 |
+
<div class="prog-bar"><div class="prog-fill" style="width:${j.progress||0}%"></div></div>
|
| 208 |
+
<div class="job-actions">
|
| 209 |
+
${j.status==='done'?`<button class="btn-sm btn-dl" onclick="dl('${j.id}')">⬇ Download MP4</button>`:''}
|
| 210 |
+
${j.status==='error'?`<span style="font-size:11px;color:var(--r)">${j.error}</span>`:''}
|
| 211 |
+
</div></div>`).join('');
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
function dl(id){window.open(API+'/api/download/'+id,'_blank')}
|
| 215 |
+
function toast(msg){const el=document.createElement('div');el.className='toast';el.textContent=msg;document.body.appendChild(el);setTimeout(()=>el.remove(),3000)}
|
| 216 |
+
|
| 217 |
+
init();
|
| 218 |
+
</script>
|
| 219 |
+
</body>
|
| 220 |
+
</html>
|