init commit

This commit is contained in:
Ubuntu committed 2025-12-09 23:46:28 +00:00
commit 5cd2a1b6dc
14 files changed
+1113

No files matched your search

+80
View File
@@ -0,0 +1,80 @@
import React from 'react';
import { ProcessingStep, VideoJob } from '../types';
import { Loader2, CheckCircle2, Music, Video, FileText, UploadCloud } from 'lucide-react';
interface ProcessTrackerProps {
job: VideoJob;
}
const steps = [
{ id: ProcessingStep.UPLOAD, label: "Upload", icon: UploadCloud },
{ id: ProcessingStep.LYRICS, label: "Lyrics", icon: FileText },
{ id: ProcessingStep.MUSIC, label: "Music", icon: Music },
{ id: ProcessingStep.VIDEO, label: "Video", icon: Video },
];
export const ProcessTracker: React.FC<ProcessTrackerProps> = ({ job }) => {
const getCurrentStepIndex = () => {
if (job.currentStep === ProcessingStep.DONE) return steps.length;
return steps.findIndex(s => s.id === job.currentStep);
};
const currentIndex = getCurrentStepIndex();
return (
<div className="w-full max-w-2xl mx-auto p-6 bg-glass backdrop-blur-xl border border-glassBorder rounded-2xl shadow-2xl">
<h3 className="text-xl font-serif font-bold text-center mb-6 text-white">
Creating Magic for {job.data.customer_name}
</h3>
<div className="relative flex justify-between items-center mb-8">
{/* Connecting Line */}
<div className="absolute top-1/2 left-0 w-full h-1 bg-gray-700 -z-10 transform -translate-y-1/2 rounded-full overflow-hidden">
<div
className="h-full bg-gradient-to-r from-blue-500 to-accent transition-all duration-700 ease-out"
style={{ width: `${(currentIndex / (steps.length - 1)) * 100}%` }}
/>
</div>
{steps.map((step, index) => {
const isActive = index === currentIndex;
const isCompleted = index < currentIndex;
const Icon = step.icon;
return (
<div key={step.id} className="flex flex-col items-center gap-2">
<div
className={`
w-12 h-12 rounded-full flex items-center justify-center border-2 transition-all duration-500
${isCompleted
? 'bg-accent border-accent text-white scale-110'
: isActive
? 'bg-gray-900 border-blue-400 text-blue-400 shadow-[0_0_15px_rgba(59,130,246,0.5)]'
: 'bg-gray-900 border-gray-600 text-gray-400'
}
`}
>
{isCompleted ? <CheckCircle2 size={24} /> : isActive ? <Loader2 size={24} className="animate-spin" /> : <Icon size={20} />}
</div>
<span className={`
text-xs uppercase tracking-wider transition-colors duration-300 text-center
${isActive ? 'text-blue-300 font-bold drop-shadow-[0_0_5px_rgba(147,197,253,0.5)]' : ''}
${isCompleted ? 'text-white font-semibold' : ''}
${!isActive && !isCompleted ? 'text-gray-400 font-medium' : ''}
`}>
{step.label}
</span>
</div>
);
})}
</div>
<div className="text-center h-8">
<p className="text-blue-200 animate-pulse text-sm font-medium">
{job.currentStep !== ProcessingStep.DONE ? `Current Step: ${job.currentStep}` : 'Finalizing output...'}
</p>
</div>
</div>
);
};
+69
View File
@@ -0,0 +1,69 @@
import React from 'react';
import { VideoHistoryItem } from '../types';
import { Calendar, Film } from 'lucide-react';
interface VideoGalleryProps {
videos: VideoHistoryItem[];
}
export const VideoGallery: React.FC<VideoGalleryProps> = ({ videos }) => {
return (
<div className="w-full max-w-7xl mx-auto px-4 py-12">
<h2 className="text-3xl font-serif font-bold mb-8 text-white border-b border-white/10 pb-4">
Your Creations
</h2>
{videos.length === 0 ? (
<div className="text-center text-gray-500 py-12">
<p>No videos found. Create your first campaign above!</p>
</div>
) : (
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
{videos.map((video) => (
<div
key={video.id}
className="group relative bg-glass backdrop-blur-md border border-glassBorder rounded-xl overflow-hidden hover:border-blue-500/50 transition-all duration-300 hover:shadow-2xl hover:-translate-y-1"
>
{/* Video Thumbnail Area */}
<div className="relative aspect-video bg-gray-900 overflow-hidden">
{video.result_movie_url ? (
<video
src={video.result_movie_url}
className="w-full h-full object-cover"
controls
preload="metadata"
/>
) : (
<div className="w-full h-full flex items-center justify-center bg-gray-800 text-gray-500">
<Film className="opacity-20" size={48} />
</div>
)}
</div>
{/* Content Area */}
<div className="p-4">
<div className="flex items-center justify-between">
<div className="flex flex-col">
<span className="text-xs text-gray-400 uppercase tracking-wider mb-1">Created At</span>
<div className="flex items-center text-gray-200 text-sm font-mono">
<Calendar size={14} className="mr-2 text-blue-400" />
{video.created_at}
</div>
</div>
{video.status && (
<div className={`px-2 py-1 rounded text-xs font-bold uppercase ${
video.status.toLowerCase() === 'completed' ? 'bg-green-500/20 text-green-400' : 'bg-yellow-500/20 text-yellow-400'
}`}>
{video.status}
</div>
)}
</div>
</div>
</div>
))}
</div>
)}
</div>
);
};