Athspi commited on
Commit
cff6bd5
·
verified ·
1 Parent(s): 202112a

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +33 -22
templates/index.html CHANGED
@@ -5,65 +5,71 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>AI Video Narrator</title>
7
  <style>
8
- @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
9
 
10
  :root {
11
  --primary-color: #0d6efd;
12
  --secondary-color: #6c757d;
13
- --background-color: #f8f9fa;
14
  --card-background: #ffffff;
15
  --heading-color: #212529;
16
- --border-color: #dee2e6;
17
- --shadow: 0 8px 30px rgba(0,0,0,0.08);
18
  }
19
 
20
  *, *::before, *::after { box-sizing: border-box; }
21
  body {
22
- font-family: 'Poppins', sans-serif; margin: 0; background-color: var(--background-color);
23
  display: flex; justify-content: center; align-items: flex-start; padding: 2rem; min-height: 100vh;
24
  }
25
  .container {
26
- background-color: var(--card-background); padding: 2.5rem 3rem; border-radius: 20px;
27
  border: 1px solid var(--border-color); box-shadow: var(--shadow); width: 100%; max-width: 700px;
28
  }
29
  header { text-align: center; margin-bottom: 2.5rem; }
30
  h1 { color: var(--heading-color); font-weight: 700; margin-bottom: 0.5rem; }
31
- p.subtitle { color: var(--secondary-color); }
32
 
33
  .tab-container { display: flex; border-bottom: 2px solid var(--border-color); margin-bottom: 1.5rem; }
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;
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; }
 
42
 
43
  .form-step { margin-bottom: 1.5rem; padding: 1.5rem; border: 1px solid var(--border-color); border-radius: 12px; }
44
  .form-step legend { font-size: 1.1rem; font-weight: 600; color: var(--primary-color); padding: 0 0.5rem; margin-left: 0.5rem; }
45
 
46
  input[type="url"], .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; }
47
- input[type="url"] { padding: 0.75rem; text-align: left; cursor: text; }
48
- .file-upload-label:hover, input[type="url"]:focus { background-color: #f1f3f5; border-color: var(--primary-color); }
49
  input[type="file"] { display: none; }
50
- #file-name { margin-top: 1rem; font-style: italic; color: var(--secondary-color); }
51
 
52
  .submit-btn {
53
- width: 100%; background-image: linear-gradient(45deg, #0d6efd, #0dcaf0);
54
  color: white; border: none; padding: 1rem; border-radius: 12px;
55
  font-size: 1.2rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
56
- box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3); margin-top: 1rem;
57
  }
58
- .submit-btn:hover { transform: translateY(-3px); box-shadow: 0 7px 20px rgba(13, 110, 253, 0.4); }
59
 
60
  .result-section, .flash-message, #loader { margin-top: 2.5rem; text-align: center; }
61
  h2 { border-bottom: 3px solid var(--primary-color); padding-bottom: 0.5rem; display: inline-block; margin-bottom: 1.5rem; }
62
- video { width: 100%; border-radius: 12px; box-shadow: var(--shadow); }
63
  .script-box { background-color: #212529; color: #f8f9fa; padding: 1.5rem; border-radius: 8px; text-align: left; white-space: pre-wrap; word-wrap: break-word; font-family: "SF Mono", monospace; line-height: 1.7; margin-top: 1rem; max-height: 250px; overflow-y: auto; }
64
- .flash-message { padding: 1rem; border-radius: 8px; background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; font-weight: 600; }
 
 
 
65
  #loader { display: none; }
66
  #loader p { font-size: 1.2rem; font-weight: 600; color: var(--primary-color); }
 
 
67
  </style>
68
  </head>
69
  <body>
@@ -73,8 +79,12 @@
73
  <p class="subtitle">Dub your video by uploading a file or pasting a YouTube link.</p>
74
  </header>
75
 
76
- {% with messages = get_flashed_messages() %}
77
- {% if messages %}<div class="flash-message">{{ messages[0] }}</div>{% endif %}
 
 
 
 
78
  {% endwith %}
79
 
80
  <form id="dubbing-form" action="/process" method="POST" enctype="multipart/form-data">
@@ -109,7 +119,10 @@
109
  <button type="submit" class="submit-btn">Generate Dubbed Video</button>
110
  </form>
111
 
112
- <div id="loader"><p>Processing your video... This may take a few minutes.</p></div>
 
 
 
113
 
114
  {% if result_video %}
115
  <div class="result-section">
@@ -136,8 +149,6 @@
136
  contents.forEach(item => item.classList.remove('active'));
137
  tab.classList.add('active');
138
  document.getElementById(tab.dataset.tab).classList.add('active');
139
-
140
- // Clear the other input when switching tabs
141
  if (tab.dataset.tab === 'upload') {
142
  urlInput.value = '';
143
  } else {
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>AI Video Narrator</title>
7
  <style>
8
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
9
 
10
  :root {
11
  --primary-color: #0d6efd;
12
  --secondary-color: #6c757d;
13
+ --background-color: #f4f7f9;
14
  --card-background: #ffffff;
15
  --heading-color: #212529;
16
+ --border-color: #e9ecef;
17
+ --shadow: 0 10px 40px rgba(0,0,0,0.07);
18
  }
19
 
20
  *, *::before, *::after { box-sizing: border-box; }
21
  body {
22
+ font-family: 'Inter', sans-serif; margin: 0; background-color: var(--background-color);
23
  display: flex; justify-content: center; align-items: flex-start; padding: 2rem; min-height: 100vh;
24
  }
25
  .container {
26
+ background-color: var(--card-background); padding: 2.5rem 3rem; border-radius: 24px;
27
  border: 1px solid var(--border-color); box-shadow: var(--shadow); width: 100%; max-width: 700px;
28
  }
29
  header { text-align: center; margin-bottom: 2.5rem; }
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
  .tab-container { display: flex; border-bottom: 2px solid var(--border-color); margin-bottom: 1.5rem; }
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
  input[type="url"], .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; }
48
+ input[type="url"] { padding: 0.75rem; text-align: left; cursor: text; font-size: 1rem; }
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
 
53
  .submit-btn {
54
+ width: 100%; background: var(--primary-color);
55
  color: white; border: none; padding: 1rem; border-radius: 12px;
56
  font-size: 1.2rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
57
+ box-shadow: 0 4px 15px rgba(13, 110, 253, 0.2); margin-top: 1rem;
58
  }
59
+ .submit-btn:hover { transform: translateY(-3px); box-shadow: 0 7px 20px rgba(13, 110, 253, 0.3); }
60
 
61
  .result-section, .flash-message, #loader { margin-top: 2.5rem; text-align: center; }
62
  h2 { border-bottom: 3px solid var(--primary-color); padding-bottom: 0.5rem; display: inline-block; margin-bottom: 1.5rem; }
63
+ video { width: 100%; border-radius: 12px; box-shadow: var(--shadow); aspect-ratio: 16 / 9; background-color: #000; }
64
  .script-box { background-color: #212529; color: #f8f9fa; padding: 1.5rem; border-radius: 8px; text-align: left; white-space: pre-wrap; word-wrap: break-word; font-family: "SF Mono", monospace; line-height: 1.7; margin-top: 1rem; max-height: 250px; overflow-y: auto; }
65
+ .flash-message { padding: 1rem; border-radius: 8px; font-weight: 500; }
66
+ .flash-message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
67
+ .flash-message.success { background-color: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
68
+
69
  #loader { display: none; }
70
  #loader p { font-size: 1.2rem; font-weight: 600; color: var(--primary-color); }
71
+ .spinner { width: 50px; height: 50px; border: 5px solid #f3f3f3; border-top: 5px solid var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
72
+ @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
73
  </style>
74
  </head>
75
  <body>
 
79
  <p class="subtitle">Dub your video by uploading a file or pasting a YouTube link.</p>
80
  </header>
81
 
82
+ {% with messages = get_flashed_messages(with_categories=true) %}
83
+ {% if messages %}
84
+ {% for category, message in messages %}
85
+ <div class="flash-message {{ category }}">{{ message }}</div>
86
+ {% endfor %}
87
+ {% endif %}
88
  {% endwith %}
89
 
90
  <form id="dubbing-form" action="/process" method="POST" enctype="multipart/form-data">
 
119
  <button type="submit" class="submit-btn">Generate Dubbed Video</button>
120
  </form>
121
 
122
+ <div id="loader">
123
+ <div class="spinner"></div>
124
+ <p>Processing your video... This may take a few minutes.</p>
125
+ </div>
126
 
127
  {% if result_video %}
128
  <div class="result-section">
 
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 {