Translate / templates /index.html
Athspi's picture
Update templates/index.html
b87a68d verified
raw
history blame
6.57 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Video Dubbing</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
:root {
--primary-color: #007bff;
--primary-hover: #0056b3;
--background-color: #f8f9fa;
--card-background: #ffffff;
--text-color: #333;
--heading-color: #000;
--border-color: #dee2e6;
--box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
body {
font-family: 'Inter', sans-serif;
margin: 0;
background-color: var(--background-color);
display: flex;
justify-content: center;
align-items: center;
padding: 2rem;
min-height: 100vh;
}
.container {
background-color: var(--card-background);
padding: 2.5rem;
border-radius: 16px;
box-shadow: var(--box-shadow);
width: 100%;
max-width: 700px;
transition: all 0.3s ease;
}
h1 {
text-align: center;
color: var(--heading-color);
font-weight: 700;
margin-bottom: 0.5rem;
}
p.subtitle {
text-align: center;
color: #6c757d;
margin-bottom: 2rem;
}
form {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
font-weight: 600;
color: #495057;
}
input[type="file"] {
border: 1px solid var(--border-color);
padding: 0.75rem;
border-radius: 8px;
width: calc(100% - 1.5rem);
}
.radio-group label, .checkbox-group label {
display: inline-flex;
align-items: center;
margin-right: 1.5rem;
cursor: pointer;
}
input[type="radio"], input[type="checkbox"] {
margin-right: 0.5rem;
}
.submit-btn {
background: linear-gradient(90deg, #007bff, #0056b3);
color: white;
border: none;
padding: 1rem 1.5rem;
border-radius: 8px;
font-size: 1.1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
text-align: center;
}
.submit-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 25px rgba(0,123,255,0.3);
}
.result-section {
margin-top: 2.5rem;
border-top: 1px solid var(--border-color);
padding-top: 2.5rem;
}
h2 {
color: var(--heading-color);
border-bottom: 2px solid var(--primary-color);
padding-bottom: 0.5rem;
display: inline-block;
}
video {
width: 100%;
border-radius: 12px;
margin-top: 1rem;
box-shadow: var(--box-shadow);
}
.script-box {
background-color: #e9ecef;
border: 1px solid var(--border-color);
padding: 1.5rem;
border-radius: 8px;
white-space: pre-wrap;
word-wrap: break-word;
font-family: "SF Mono", "Fira Code", "Courier New", monospace;
line-height: 1.6;
margin-top: 1rem;
max-height: 200px;
overflow-y: auto;
}
.flash-message {
padding: 1rem;
margin-bottom: 1rem;
border-radius: 8px;
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.loader {
text-align: center;
display: none; /* Hidden by default */
padding: 2rem;
}
.loader p { font-size: 1.2rem; font-weight: 600; color: var(--primary-color); }
</style>
</head>
<body>
<div class="container">
<h1>AI Video Narrator</h1>
<p class="subtitle">Upload a video, choose a voice, and let AI create a new, expressive narration.</p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="flash-message">
{{ messages[0] }}
</div>
{% endif %}
{% endwith %}
<form id="dubbing-form" action="/process" method="POST" enctype="multipart/form-data">
<div class="form-group">
<label for="video">1. Upload Your Video File:</label>
<input type="file" id="video" name="video" accept="video/mp4,video/mov,video/webm" required>
</div>
<div class="form-group">
<label>2. Select Narrator Voice:</label>
<div class="radio-group">
<label><input type="radio" name="voice_choice" value="Male (Charon)" checked> Male</label>
<label><input type="radio" name="voice_choice" value="Female (Zephyr)"> Female</label>
</div>
</div>
<div class="form-group checkbox-group">
<label><input type="checkbox" name="cheerful"> Use a more cheerful tone</label>
</div>
<button type="submit" class="submit-btn">Generate Dubbed Video</button>
</form>
<div id="loader" class="loader">
<p>Processing your video... This may take a few minutes.</p>
</div>
{% if result_video %}
<div class="result-section">
<h2>Your Dubbed Video</h2>
<video controls>
<source src="{{ result_video }}" type="video/mp4">
Your browser does not support the video tag.
</video>
<h2>Generated Script</h2>
<div class="script-box">
{{ script }}
</div>
</div>
{% endif %}
</div>
<script>
document.getElementById('dubbing-form').addEventListener('submit', function() {
// Hide form and show loader on submit
document.getElementById('dubbing-form').style.display = 'none';
document.getElementById('loader').style.display = 'block';
});
</script>
</body>
</html>