runway-video/public/index.html
2025-09-04 05:53:16 +05:30

156 lines
10 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Runway Gen4 Web App</title>
<!-- Tailwind CSS - Local Build -->
<link rel="stylesheet" href="css/tailwind-build.css">
<!-- Custom CSS for Font and other minimal global styles -->
<link rel="stylesheet" href="css/style.css">
<!-- Font Awesome for icons (e.g., loading spinner) -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<!-- MSAL.js Library -->
<script src="https://cdn.jsdelivr.net/npm/@azure/msal-browser@3.5.0/lib/msal-browser.min.js"></script>
</head>
<body class="min-h-screen bg-gray-100 text-gray-900 antialiased flex flex-col items-center py-8">
<!-- Dark Mode Toggle Button -->
<button id="darkModeToggle" class="dark-mode-toggle" title="Toggle Dark Mode">
<span id="lightModeIcon">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<path d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
</svg>
</span>
<span id="darkModeIcon" style="display: none;">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/>
</svg>
</span>
</button>
<!-- Authentication Section -->
<div id="auth-section" class="mb-4 text-center">
<button id="login-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg shadow-md transition duration-150 ease-in-out hidden" style="background-color: #2563eb !important; color: #ffffff !important;">
Sign In with Microsoft
</button>
<button id="logout-btn" class="bg-red-600 hover:bg-red-700 text-white px-6 py-2 rounded-lg shadow-md transition duration-150 ease-in-out hidden" style="background-color: #dc2626 !important; color: #ffffff !important;">
Sign Out
</button>
<div id="user-info" class="mt-2 text-sm font-medium"></div>
</div>
<!-- Header -->
<header class="w-full py-6 bg-gray-50 shadow-sm rounded-b-lg">
<h1 class="text-3xl md:text-4xl font-bold text-orange-600 text-center px-4">
Runway Gen4 Web App
</h1>
</header>
<!-- Main Content Area -->
<main class="w-full max-w-4xl lg:max-w-6xl mx-auto p-4 md:p-8 flex flex-col gap-6 md:gap-8 mt-8">
<!-- Input Form Section (always visible) -->
<div id="input-form-section" class="w-full">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 md:gap-8">
<!-- Left column for image upload and prompt input -->
<div class="flex flex-col gap-6">
<!-- Image Upload Zone -->
<div id="image-upload-zone"
class="relative flex flex-col items-center justify-center p-6 border-2 border-dashed rounded-lg border-gray-400 hover:border-indigo-500 transition-all duration-200 ease-in-out cursor-pointer h-64 md:h-80">
<input type="file" id="image-input" accept="image/png, image/jpeg" class="hidden" aria-label="Upload Image">
<div id="image-preview-container" class="hidden max-h-full max-w-full">
<img id="image-preview" src="#" alt="Image Preview" class="max-h-full max-w-full object-contain rounded-lg">
<button id="remove-image-btn"
class="absolute top-2 right-2 bg-red-500 hover:bg-red-600 text-white rounded-full p-1 text-xs w-6 h-6 flex items-center justify-center shadow-md transition-colors"
aria-label="Remove image">
&times;
</button>
</div>
<div id="image-upload-placeholder" class="flex flex-col items-center text-gray-500">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 mb-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" />
</svg>
<p class="text-sm md:text-base">Drag & Drop Image Here or</p>
<p class="text-sm md:text-base font-medium text-orange-600">Click to Upload</p>
</div>
<p id="image-error-message" class="absolute bottom-2 text-red-500 text-xs mt-2 hidden"></p>
</div>
<!-- Prompt Input Field -->
<div>
<label for="prompt-input" class="block text-sm md:text-base font-medium text-gray-700 mb-1">
Video Prompt
</label>
<textarea id="prompt-input"
class="w-full p-3 border border-gray-300 rounded-lg focus:ring-orange-500 focus:border-orange-500 resize-y min-h-[100px] text-sm md:text-base"
rows="4"
placeholder="Enter your video generation prompt..."
aria-label="Video Generation Prompt"></textarea>
</div>
</div>
<!-- Right column for API options panel -->
<div id="api-options-panel" class="bg-gray-50 p-4 rounded-lg shadow-sm">
<!-- Dynamic API options will be injected here by JavaScript -->
<details class="mb-4 group" open>
<summary class="flex justify-between items-center cursor-pointer font-bold text-lg text-orange-800">
API Options
<span class="transform transition-transform duration-200 group-open:rotate-90">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</span>
</summary>
<div id="dynamic-options-container" class="mt-4 border-t border-gray-200 pt-4">
<!-- Options will be rendered here by script.js -->
</div>
</details>
</div>
</div>
<!-- General Error Message -->
<div id="general-error-message" class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded-lg relative mt-6 hidden" role="alert">
<strong class="font-bold">Error!</strong>
<span class="block sm:inline ml-2" id="general-error-text"></span>
</div>
<!-- Generate Button -->
<button id="generate-video-btn"
class="w-full py-3 px-6 rounded-lg shadow-md transition duration-150 ease-in-out flex items-center justify-center font-bold text-lg mt-6 bg-gray-400 cursor-not-allowed"
disabled
aria-label="Generate Video">
Generate Video
</button>
</div>
<!-- Video Display Section (hidden initially) -->
<div id="video-display-section" class="w-full flex-col items-center p-4 bg-gray-50 rounded-lg shadow-md hidden mt-8">
<h2 class="text-xl md:text-2xl font-bold text-orange-700 mb-4">Your Generated Video</h2>
<video id="video-player" controls class="w-full max-w-xl rounded-lg shadow-xl mb-6 aspect-video bg-black"></video>
<div class="flex flex-col sm:flex-row gap-4 w-full max-w-xl">
<a id="download-video-btn" href="#" download="generated-video.mp4"
class="flex-1 text-center bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-lg shadow-md transition duration-150 ease-in-out"
aria-label="Download generated video">
Download Video
</a>
<button id="start-new-btn"
class="flex-1 text-center bg-gray-500 hover:bg-gray-600 text-white font-bold py-2 px-4 rounded-lg shadow-md transition duration-150 ease-in-out"
aria-label="Generate another video">
Generate Another Video
</button>
</div>
</div>
</main>
<!-- Loading Overlay -->
<div id="loading-overlay" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 hidden" role="status" aria-live="polite">
<div class="flex flex-col items-center text-white">
<i class="fas fa-spinner fa-spin fa-3x mb-4"></i>
<p class="text-xl md:text-2xl font-semibold">Generating your video...</p>
<p class="text-sm md:text-base mt-2">This may take a moment.</p>
</div>
</div>
<!-- JavaScript for interactivity -->
<script src="js/script.js"></script>
</body>
</html>