Update templates/index.html
Browse files- templates/index.html +7 -43
templates/index.html
CHANGED
@@ -30,23 +30,14 @@
|
|
30 |
h1 { color: var(--heading-color); font-weight: 700; margin-bottom: 0.5rem; }
|
31 |
p.subtitle { color: var(--secondary-color); font-size: 1.1rem; }
|
32 |
|
33 |
-
.
|
34 |
-
.tab {
|
35 |
-
padding: 0.75rem 1.5rem; cursor: pointer; font-weight: 600; color: var(--secondary-color);
|
36 |
-
border-bottom: 3px solid transparent; transition: all 0.2s; position: relative;
|
37 |
-
}
|
38 |
-
.tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
|
39 |
-
|
40 |
-
.form-content { display: none; }
|
41 |
-
.form-content.active { display: block; animation: fadeIn 0.5s ease; }
|
42 |
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
43 |
|
44 |
.form-step { margin-bottom: 1.5rem; padding: 1.5rem; border: 1px solid var(--border-color); border-radius: 12px; }
|
45 |
.form-step legend { font-size: 1.1rem; font-weight: 600; color: var(--primary-color); padding: 0 0.5rem; margin-left: 0.5rem; }
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
.file-upload-label:hover, input[type="url"]:focus { background-color: #f8f9fa; border-color: var(--primary-color); }
|
50 |
input[type="file"] { display: none; }
|
51 |
#file-name { margin-top: 1rem; font-style: italic; color: var(--secondary-color); font-size: 0.9rem; }
|
52 |
|
@@ -76,7 +67,7 @@
|
|
76 |
<div class="container">
|
77 |
<header>
|
78 |
<h1>AI Video Narrator</h1>
|
79 |
-
<p class="subtitle">
|
80 |
</header>
|
81 |
|
82 |
{% with messages = get_flashed_messages(with_categories=true) %}
|
@@ -88,12 +79,7 @@
|
|
88 |
{% endwith %}
|
89 |
|
90 |
<form id="dubbing-form" action="/process" method="POST" enctype="multipart/form-data">
|
91 |
-
<div class="
|
92 |
-
<div class="tab active" data-tab="upload">Upload File</div>
|
93 |
-
<div class="tab" data-tab="youtube">From YouTube URL</div>
|
94 |
-
</div>
|
95 |
-
|
96 |
-
<div id="upload" class="form-content active">
|
97 |
<label for="video" class="file-upload-label">
|
98 |
<span>Click to select a video file</span>
|
99 |
<div id="file-name">No file chosen</div>
|
@@ -101,10 +87,6 @@
|
|
101 |
<input type="file" id="video" name="video" accept="video/mp4,video/mov,video/webm">
|
102 |
</div>
|
103 |
|
104 |
-
<div id="youtube" class="form-content">
|
105 |
-
<input type="url" name="youtube_url" placeholder="Paste YouTube video link here...">
|
106 |
-
</div>
|
107 |
-
|
108 |
<fieldset class="form-step" style="padding-top: 0.5rem;">
|
109 |
<legend>Configure Voice</legend>
|
110 |
<div class="radio-group">
|
@@ -135,37 +117,19 @@
|
|
135 |
</div>
|
136 |
|
137 |
<script>
|
138 |
-
const tabs = document.querySelectorAll('.tab');
|
139 |
-
const contents = document.querySelectorAll('.form-content');
|
140 |
const form = document.getElementById('dubbing-form');
|
141 |
const loader = document.getElementById('loader');
|
142 |
const videoInput = document.getElementById('video');
|
143 |
-
const urlInput = document.querySelector('input[name="youtube_url"]');
|
144 |
const fileNameDisplay = document.getElementById('file-name');
|
145 |
|
146 |
-
tabs.forEach(tab => {
|
147 |
-
tab.addEventListener('click', () => {
|
148 |
-
tabs.forEach(item => item.classList.remove('active'));
|
149 |
-
contents.forEach(item => item.classList.remove('active'));
|
150 |
-
tab.classList.add('active');
|
151 |
-
document.getElementById(tab.dataset.tab).classList.add('active');
|
152 |
-
if (tab.dataset.tab === 'upload') {
|
153 |
-
urlInput.value = '';
|
154 |
-
} else {
|
155 |
-
videoInput.value = '';
|
156 |
-
fileNameDisplay.textContent = 'No file chosen';
|
157 |
-
}
|
158 |
-
});
|
159 |
-
});
|
160 |
-
|
161 |
videoInput.addEventListener('change', function() {
|
162 |
fileNameDisplay.textContent = this.files.length > 0 ? this.files[0].name : 'No file chosen';
|
163 |
});
|
164 |
|
165 |
form.addEventListener('submit', function(event) {
|
166 |
-
if (!videoInput.value
|
167 |
event.preventDefault();
|
168 |
-
alert('Please
|
169 |
} else {
|
170 |
form.style.display = 'none';
|
171 |
loader.style.display = 'block';
|
|
|
30 |
h1 { color: var(--heading-color); font-weight: 700; margin-bottom: 0.5rem; }
|
31 |
p.subtitle { color: var(--secondary-color); font-size: 1.1rem; }
|
32 |
|
33 |
+
.form-content { display: block; animation: fadeIn 0.5s ease; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
|
35 |
|
36 |
.form-step { margin-bottom: 1.5rem; padding: 1.5rem; border: 1px solid var(--border-color); border-radius: 12px; }
|
37 |
.form-step legend { font-size: 1.1rem; font-weight: 600; color: var(--primary-color); padding: 0 0.5rem; margin-left: 0.5rem; }
|
38 |
|
39 |
+
.file-upload-label { width: 100%; border: 2px dashed var(--border-color); padding: 2rem; border-radius: 8px; text-align: center; cursor: pointer; transition: background-color 0.2s, border-color 0.2s; }
|
40 |
+
.file-upload-label:hover { background-color: #f8f9fa; border-color: var(--primary-color); }
|
|
|
41 |
input[type="file"] { display: none; }
|
42 |
#file-name { margin-top: 1rem; font-style: italic; color: var(--secondary-color); font-size: 0.9rem; }
|
43 |
|
|
|
67 |
<div class="container">
|
68 |
<header>
|
69 |
<h1>AI Video Narrator</h1>
|
70 |
+
<p class="subtitle">Upload your video to generate a dubbed version</p>
|
71 |
</header>
|
72 |
|
73 |
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
|
79 |
{% endwith %}
|
80 |
|
81 |
<form id="dubbing-form" action="/process" method="POST" enctype="multipart/form-data">
|
82 |
+
<div class="form-content">
|
|
|
|
|
|
|
|
|
|
|
83 |
<label for="video" class="file-upload-label">
|
84 |
<span>Click to select a video file</span>
|
85 |
<div id="file-name">No file chosen</div>
|
|
|
87 |
<input type="file" id="video" name="video" accept="video/mp4,video/mov,video/webm">
|
88 |
</div>
|
89 |
|
|
|
|
|
|
|
|
|
90 |
<fieldset class="form-step" style="padding-top: 0.5rem;">
|
91 |
<legend>Configure Voice</legend>
|
92 |
<div class="radio-group">
|
|
|
117 |
</div>
|
118 |
|
119 |
<script>
|
|
|
|
|
120 |
const form = document.getElementById('dubbing-form');
|
121 |
const loader = document.getElementById('loader');
|
122 |
const videoInput = document.getElementById('video');
|
|
|
123 |
const fileNameDisplay = document.getElementById('file-name');
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
videoInput.addEventListener('change', function() {
|
126 |
fileNameDisplay.textContent = this.files.length > 0 ? this.files[0].name : 'No file chosen';
|
127 |
});
|
128 |
|
129 |
form.addEventListener('submit', function(event) {
|
130 |
+
if (!videoInput.value) {
|
131 |
event.preventDefault();
|
132 |
+
alert('Please select a video file to upload.');
|
133 |
} else {
|
134 |
form.style.display = 'none';
|
135 |
loader.style.display = 'block';
|