PageSourceSearch

https://loquiauris.ai/assets/AtlasVideoTest-C5GheAjy.js

js loquiauris.ai collected 2026-10-05 15:23:42 UTC 10,709 bytes, 34 lines download raw bytes

1import{r as e,j as t}from"./react-vendor-DaI6VGpT.js"
2const a="https://loquiauris.ai",s={id:"wan-2.6-t2v",name:"Wan 2.6",durations:[5,10,15],sizes:["720P","1080P"]},r={id:"hailuo-2.3",name:"Hailuo 2.3",durations:null,sizes:["720p","1080p"],noDuration:!0},i={id:"wan-2.6-v2v",name:"Wan 2.6 V2V",durations:[5,10,15],sizes:["720P","1080P"]},o=()=>{const[o,n]=e.useState("text-to-video"),[l,d]=e.useState(""),[c,m]=e.useState("720P"),[u,x]=e.useState(15),[p,h]=e.useState(!1),[g,b]=e.useState(""),[v,w]=e.useState([]),[f,j]=e.useState(null),[N,y]=e.useState(""),[D,I]=e.useState(null),[k,P]=e.useState(""),S=e.useRef(null),C=e.useRef(null),U=e.useRef({}),V=async e=>{if(U.current[e])return
3U.current[e]=!0
4const t=async()=>{try{const s=await fetch(`${a}/api/atlas-video/status/${e}`),r=await s.json()
5w(t=>t.map(t=>{var a
6return t.generationId===e?{...t,status:r.status,videoUrl:r.videoUrl||(null==(a=r.outputs)?void 0:a[0]),rawData:r}:t})),"completed"!==r.status&&"failed"!==r.status&&"error"!==r.status?setTimeout(t,3e3):delete U.current[e]}catch(s){delete U.current[e]}}
7t()},z=e=>{switch(e){case"completed":return"text-green-400 bg-green-500/20"
8case"failed":case"error":return"text-red-400 bg-red-500/20"
9case"processing":case"pending":case"queued":return"text-amber-400 bg-amber-500/20"
10default:return"text-gray-400 bg-gray-500/20"}},R="text-to-video"===o?s:"image-to-video"===o?r:i
11return t.jsx("div",{className:"min-h-screen bg-gradient-to-br from-[#0f0f23] via-[#1a1a3e] to-[#0f0f23] text-white p-5",children:t.jsxs("div",{className:"max-w-5xl mx-auto",children:[t.jsxs("div",{className:"text-center mb-8",children:[t.jsx("h1",{className:"text-4xl font-bold mb-3 bg-gradient-to-r from-indigo-400 to-purple-400 bg-clip-text text-transparent",children:"Atlas Cloud Video"}),t.jsx("p",{className:"text-gray-400 text-lg",children:"Wan 2.6 - Text to Video | Hailuo 2.3 - Image to Video | Wan 2.6 - Video to Video"})]}),t.jsx("div",{className:"flex gap-2 mb-6 justify-center",children:["text-to-video","image-to-video","video-to-video"].map(e=>t.jsx("button",{onClick:()=>n(e),className:"px-6 py-3 rounded-lg font-semibold transition-all "+(o===e?"bg-gradient-to-r from-indigo-500 to-purple-500 text-white shadow-lg shadow-purple-500/25":"bg-white/10 text-white/70 hover:bg-white/15 hover:text-white"),children:e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},e))}),t.jsxs("div",{className:"bg-white/5 rounded-2xl p-6 mb-8 border border-white/10",children:[t.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[t.jsx("span",{className:"px-3 py-1 rounded-full bg-purple-500/20 text-purple-300 text-sm font-medium",children:R.name}),R.noDuration&&t.jsx("span",{className:"px-3 py-1 rounded-full bg-blue-500/20 text-blue-300 text-sm",children:"Duration: Auto (~5s)"})]}),"image-to-video"===o&&t.jsxs("div",{className:"mb-5",children:[t.jsx("label",{className:"block mb-2 font-medium text-white/90",children:"Source Image"}),t.jsx("input",{ref:S,type:"file",accept:"image/*",onChange:e=>{const t=e.target.files[0]
12if(t){j(t)
13const e=new FileReader
14e.onloadend=()=>y(e.result),e.readAsDataURL(t)}},className:"hidden"}),t.jsx("div",{onClick:()=>{var e
15return null==(e=S.current)?void 0:e.click()},className:"border-2 border-dashed border-white/30 rounded-xl p-10 text-center cursor-pointer transition-all hover:border-purple-400/50 hover:bg-white/5 "+(N?"bg-transparent":"bg-white/2"),children:N?t.jsx("img",{src:N,alt:"Preview",className:"max-w-full max-h-72 mx-auto rounded-lg"}):t.jsxs("div",{children:[t.jsx("div",{className:"text-5xl mb-3",children:"📷"}),t.jsx("p",{className:"text-white/80",children:"Click to select an image"}),t.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"JPG, PNG, WebP supported"})]})})]}),"video-to-video"===o&&t.jsxs("div",{className:"mb-5",children:[t.jsx("label",{className:"block mb-2 font-medium text-white/90",children:"Source Video"}),t.jsx("input",{ref:C,type:"file",accept:"video/*",onChange:e=>{const t=e.target.files[0]
16t&&(I(t),P(URL.createObjectURL(t)))},className:"hidden"}),t.jsx("div",{onClick:()=>{var e
17return null==(e=C.current)?void 0:e.click()},className:"border-2 border-dashed border-white/30 rounded-xl p-10 text-center cursor-pointer transition-all hover:border-purple-400/50 hover:bg-white/5 "+(k?"bg-transparent":"bg-white/2"),children:k?t.jsx("video",{src:k,controls:!0,className:"max-w-full max-h-72 mx-auto rounded-lg"}):t.jsxs("div",{children:[t.jsx("div",{className:"text-5xl mb-3",children:"🎬"}),t.jsx("p",{className:"text-white/80",children:"Click to select a video"}),t.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"MP4, MOV supported"})]})})]}),t.jsxs("div",{className:"mb-5",children:[t.jsx("label",{className:"block mb-2 font-medium text-white/90",children:"text-to-vi
17deo"===o?"Prompt (Required)":"Prompt (Optional - describe motion/changes)"}),t.jsx("textarea",{value:l,onChange:e=>d(e.target.value),placeholder:"text-to-video"===o?"Describe the video you want to generate...":"Describe how the image/video should animate or transform...",className:"w-full min-h-28 p-4 rounded-xl border border-white/20 bg-white/5 text-white placeholder-gray-500 resize-y focus:outline-none focus:border-purple-400/50 focus:ring-2 focus:ring-purple-400/20"})]}),t.jsxs("div",{className:"flex gap-4 mb-5 flex-wrap",children:[t.jsxs("div",{className:"flex-1 min-w-40",children:[t.jsx("label",{className:"block mb-2 font-medium text-white/90",children:"Resolution"}),t.jsx("select",{value:c,onChange:e=>m(e.target.value),className:"w-full p-3 rounded-lg border border-white/20 bg-white/5 text-white cursor-pointer focus:outline-none focus:border-purple-400/50",children:R.sizes.map(e=>t.jsx("option",{value:e,className:"bg-gray-900",children:e},e))})]}),!R.noDuration&&R.durations&&t.jsxs("div",{className:"flex-1 min-w-40",children:[t.jsx("label",{className:"block mb-2 font-medium text-white/90",children:"Duration"}),t.jsx("select",{value:u,onChange:e=>x(parseInt(e.target.value)),className:"w-full p-3 rounded-lg border border-white/20 bg-white/5 text-white cursor-pointer focus:outline-none focus:border-purple-400/50",children:R.durations.map(e=>t.jsxs("option",{value:e,className:"bg-gray-900",children:[e," seconds"]},e))})]})]}),g&&t.jsx("div",{className:"p-4 bg-red-500/20 border border-red-500/50 rounded-lg text-red-300 mb-5",children:g}),t.jsx("button",{onClick:()=>{"text-to-video"===o?(async()=>{if(l.trim()){h(!0),b("")
18try{const e=await fetch(`${a}
18/api/atlas-video/text-to-video`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:l,size:c,duration:u})}),t=await e.json()
19if(!e.ok)throw new Error(t.error||"Generation failed")
20const s={id:Date.now(),generationId:t.generationId||t.id,type:"text-to-video",prompt:l,size:c,duration:u,status:t.status||"processing",videoUrl:null,createdAt:new Date,rawData:t}
21w(e=>[s,...e]),d(""),s.generationId&&V(s.generationId)}catch(e){b(e.message)}finally{h(!1)}}else b("Please enter a prompt")})():"image-to-video"===o?(async()=>{if(f){h(!0),b("")
22try{const e=new FormData
23e.append("image",f),e.append("prompt",l)
24const t=await fetch(`${a}/api/atlas-video/image-to-video`,{method:"POST",body:e}),s=await t.json()
25if(!t.ok)throw new Error(s.error||"Generation failed")
26const r={id:Date.now(),generationId:s.generationId||s.id,type:"image-to-video",prompt:l,sourceImage:N,status:s.status||"processing",videoUrl:null,createdAt:new Date,rawData:s}
27w(e=>[r,...e]),d(""),j(null),y(""),r.generationId&&V(r.generationId)}catch(e){b(e.message)}finally{h(!1)}}else b("Please select an image")})():"video-to-video"===o&&(async()=>{if(D){h(!0),b("")
28try{const e=new FormData
29e.append("video",D),e.append("prompt",l),e.append("size",c),e.append("duration",u)
30const t=await fetch(`${a}/api/atlas-video/video-to-video`,{method:"POST",body:e}),s=await t.json()
31if(!t.ok)throw new Error(s.error||"Generation failed")
32const r={id:Date.now(),generationId:s.generationId||s.id,type:"video-to-video",prompt:l,size:c,duration:u,sourceVideo:k,status:s.status||"processing",videoUrl:null,createdAt:new Date,rawData:s}
33w(e=>[r,...e]),d(""),I(null),P(""),r.generationId&&V(r.generationId)}catch(e){b(e.message)}finally{h(!1)}}else b("Please select a video")})()},disabled:p,className:"w-full py-4 rounded-xl font-semibold text-lg transition-all "+(p?"bg-white/10 text-white/50 cursor-not-allowed":"bg-gradient-to-r from-indigo-500 to-purple-500 text-white hover:shadow-lg hover:shadow-purple-500/25 hover:scale-[1.01] active:scale-[0.99]"),children:p?"Generating...":"Generate Video"})]}),v.length>0&&t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-semibold mb-5",children:["Generated Videos (",v.length,")"]}),t.jsx("div",{className:"flex flex-col gap-5",children:v.map(e=>t.jsxs("div",{className:"bg-white/5 rounded-2xl p-5 border border-white/10",children:[t.jsxs("div",{className:"flex justify-between items-center mb-3",children:[t.jsx("span",{className:"px-3 py-1 rounded-full bg-indigo-500/20 text-indigo-300 text-sm font-medium",children:e.type.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}),t.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${z(e.status)}`,children:e.status})]}),e.prompt&&t.jsxs("p",{className:"text-gray-400 mb-3 italic",children:['"',e.prompt,'"']}),(e.duration||e.size)&&t.jsxs("div",{className:"flex gap-2 mb-3",children:[e.duration&&t.jsxs("span",{className:"px-2 py-0.5 rounded bg-white/10 text-white/60 text-xs",children:[e.duration,"s"]}),e.size&&t.jsx("span",{className:"px-2 py-0.5 rounded bg-white/10 text-white/60 text-xs",children:e.size})]}),e.sourceImage&&t.jsxs("div",{className:"mb-3",children:[t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Source Image:"}),t.jsx("img",{src:e.sourceImage,alt:"Source",className:"max-h-36 rounded-lg"})]}),e.videoUrl&&t.jsxs("div",{className:"mt-4",children:[t.jsx("video",{src:e.videoUrl,controls:!0,autoPlay:!0,loop:!0,className:"w-full max-h-96 rounded-xl bg-black"}),t.jsx("a",{href:e.videoUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-block mt-3 px-4 py-2 bg-white/10 hover:bg-white/15 rounded-lg text-indigo-300 text-sm transition-colors",children:"Download Video"})]}),!e.videoUrl&&"failed"!==e.status&&"error"!==e.status&&t.jsxs("div",{className:"p-10 text-center bg-black/20 rounded-xl mt-3",children:[t.jsx("div",{className:"text-4xl mb-3 animate-pulse",children:"⏳"}),t.jsx("p",{className:"text-white/80",children:"Video is being generated..."}),t.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"This may take 1-3 minutes"})]}),t.jsxs("div",{className:"mt-3 text-xs text-gray-600",children:["ID: ",e.generationId]})]},e.id))})]})]})})}
34export{o as default}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.