Luigi commited on
Commit
16ec358
·
verified ·
1 Parent(s): a6e1b09

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +211 -19
index.html CHANGED
@@ -1,19 +1,211 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Autotutorial.ai - Create Video Tutorials Effortlessly</title>
7
+ <!-- Tailwind CSS CDN for styling -->
8
+ <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
9
+ <!-- Font Awesome CDN for icons -->
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
11
+ <!-- Inter Font from Google Fonts -->
12
+ <link rel="preconnect" href="https://fonts.googleapis.com">
13
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
14
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
15
+ <style>
16
+ body { font-family: 'Inter', sans-serif; }
17
+ .btn-primary { @apply bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50 transition-colors duration-200; }
18
+ .btn-primary:disabled { @apply bg-blue-300 cursor-not-allowed hover:bg-blue-300 focus:ring-0; }
19
+ .btn-secondary { @apply bg-gray-200 hover:bg-gray-300 text-gray-700 font-semibold py-2 px-4 rounded focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-opacity-50 transition-colors duration-200; }
20
+ .input-field { @apply shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline; }
21
+ .input-label { @apply block text-gray-700 text-sm font-bold mb-2; }
22
+ .status-box { @apply border rounded p-4 mb-4; }
23
+ .error-text { @apply text-red-500 mt-2 text-sm; }
24
+ .video-player-container { @apply rounded overflow-hidden shadow-xl; }
25
+ </style>
26
+ </head>
27
+ <body class="bg-gray-100 p-8">
28
+ <div class="max-w-4xl mx-auto bg-white shadow-lg rounded-lg overflow-hidden">
29
+ <!-- Header Section -->
30
+ <header class="bg-blue-700 p-6 text-white">
31
+ <h1 class="text-2xl font-bold"><i class="fas fa-video mr-2"></i> Autotutorial.ai</h1>
32
+ <p class="text-sm mt-1">Effortlessly Generate Professional Video Tutorials</p>
33
+ </header>
34
+
35
+ <!-- Main Content Area -->
36
+ <div class="p-8">
37
+ <!-- Tutorial Input Section -->
38
+ <section class="mb-6">
39
+ <h2 class="text-xl font-semibold mb-4 text-gray-800">Tutorial Settings</h2>
40
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
41
+ <div>
42
+ <label for="tutorialTopic" class="input-label">Tutorial Topic <span class="text-gray-500">(e.g., "Getting Started with React")</span></label>
43
+ <input type="text" id="tutorialTopic" class="input-field" placeholder="Enter tutorial topic" value="Mastering Asynchronous JavaScript" required>
44
+ </div>
45
+ <div>
46
+ <label for="desiredDuration" class="input-label">Desired Duration (Minutes)</label>
47
+ <select id="desiredDuration" class="input-field">
48
+ <option value="5">5 Minutes</option>
49
+ <option value="10" selected>10 Minutes</option>
50
+ <option value="15">15 Minutes</option>
51
+ <option value="20">20 Minutes</option>
52
+ </select>
53
+ </div>
54
+ </div>
55
+ </section>
56
+
57
+ <!-- API Keys Section -->
58
+ <section class="mb-6">
59
+ <h2 class="text-xl font-semibold mb-4 text-gray-800">API Keys <span class="text-gray-500">(Optional, for advanced features)</span></h2>
60
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
61
+ <div>
62
+ <label for="openaiApiKey" class="input-label">OpenAI API Key <span class="text-gray-500">(For script generation)</span></label>
63
+ <input type="text" id="openaiApiKey" class="input-field" placeholder="Enter your OpenAI API Key (Optional)" value="sk-YOUR_OPENAI_API_KEY_DEMO" >
64
+ </div>
65
+ <div>
66
+ <label for="videoGenApiKey" class="input-label">Video Generation API Key <span class="text-gray-500">(For advanced video synthesis)</span></label>
67
+ <input type="text" id="videoGenApiKey" class="input-field" placeholder="Enter Video API Key (Optional)" value="vg-YOUR_VIDEO_GEN_API_KEY_DEMO">
68
+ </div>
69
+ </div>
70
+ <p class="text-sm text-gray-500 mt-2">These API keys are optional and enhance the tutorial generation process. You can still generate basic tutorials without them.</p>
71
+ </section>
72
+
73
+ <!-- Action Buttons -->
74
+ <section class="mb-6 flex justify-between">
75
+ <button id="generateButton" class="btn-primary"><i class="fas fa-magic mr-2"></i> Generate Tutorial</button>
76
+ <button id="resetButton" class="btn-secondary hidden"><i class="fas fa-redo mr-2"></i> Reset</button>
77
+ </section>
78
+
79
+ <!-- Status and Error Area -->
80
+ <section id="statusSection" class="status-box bg-gray-50">
81
+ <h3 class="font-semibold text-gray-700 mb-2"><i class="fas fa-spinner fa-spin mr-2"></i> Status Updates</h3>
82
+ <div id="statusMessages">
83
+ <p class="text-gray-600"><i class="fas fa-check-circle text-green-500 mr-1"></i> Ready to generate tutorial. Please click "Generate Tutorial".</p>
84
+ </div>
85
+ <p id="errorMessage" class="error-text hidden"></p>
86
+ </section>
87
+
88
+ <!-- Video Output Section -->
89
+ <section id="videoOutputSection" class="hidden">
90
+ <h2 class="text-xl font-semibold mb-4 text-gray-800"><i class="fas fa-film mr-2"></i> Generated Tutorial Preview</h2>
91
+ <div class="video-player-container">
92
+ <video id="tutorialVideo" controls width="100%">
93
+ <source src="https://archive.org/download/ElephantsDream/ed_1024_512.mp4" type="video/mp4">
94
+ Your browser does not support the video tag.
95
+ </video>
96
+ </div>
97
+ <div class="mt-4 flex justify-between items-center">
98
+ <div>
99
+ <p class="text-gray-700"><strong>Tutorial Title:</strong> <span id="videoTitle">Mastering Asynchronous JavaScript in 10 Minutes</span></p>
100
+ <p class="text-gray-500 text-sm">Generated based on your topic input.</p>
101
+ </div>
102
+ <div>
103
+ <a href="#" id="downloadButton" class="btn-primary" download="tutorial.mp4"><i class="fas fa-download mr-2"></i> Download Video</a>
104
+ </div>
105
+ </div>
106
+ </section>
107
+ </div>
108
+
109
+ <!-- Footer Section -->
110
+ <footer class="bg-gray-200 p-4 text-center text-gray-600 text-sm">
111
+ © 2023 Autotutorial.ai. All rights reserved. | <a href="#" class="hover:underline">Terms of Service</a> | <a href="#" class="hover:underline">Privacy Policy</a>
112
+ </footer>
113
+ </div>
114
+
115
+ <script>
116
+ document.getElementById('generateButton').addEventListener('click', function() {
117
+ const topic = document.getElementById('tutorialTopic').value;
118
+ const duration = document.getElementById('desiredDuration').value;
119
+ const openaiKey = document.getElementById('openaiApiKey').value;
120
+ const videoGenKey = document.getElementById('videoGenApiKey').value;
121
+ const statusMessagesDiv = document.getElementById('statusMessages');
122
+ const errorMessageDiv = document.getElementById('errorMessage');
123
+ const generateButton = document.getElementById('generateButton');
124
+ const resetButton = document.getElementById('resetButton');
125
+ const statusSection = document.getElementById('statusSection');
126
+ const videoOutputSection = document.getElementById('videoOutputSection');
127
+ const videoTitleSpan = document.getElementById('videoTitle');
128
+
129
+ // Reset status and hide video output
130
+ statusMessagesDiv.innerHTML = '';
131
+ errorMessageDiv.classList.add('hidden');
132
+ videoOutputSection.classList.add('hidden');
133
+ resetButton.classList.add('hidden');
134
+ generateButton.disabled = true;
135
+ statusSection.querySelector('h3 i').classList.remove('fa-check-circle', 'text-green-500', 'fa-times-circle', 'text-red-500');
136
+ statusSection.querySelector('h3 i').classList.add('fa-spinner', 'fa-spin', 'mr-2');
137
+ statusSection.querySelector('h3').innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Status Updates';
138
+
139
+
140
+ // Simulate tutorial generation process with delays
141
+ simulateStep(statusMessagesDiv, "Generating tutorial script...", 1000, () => {
142
+ simulateStep(statusMessagesDiv, "Creating voiceover...", 2000, () => {
143
+ simulateStep(statusMessagesDiv, "Synthesizing video scenes...", 3000, () => {
144
+ simulateStep(statusMessagesDiv, "Finalizing and rendering...", 2500, () => {
145
+ // Simulate success
146
+ statusMessagesDiv.innerHTML = '<p class="text-green-600"><i class="fas fa-check-circle text-green-500 mr-1"></i> Tutorial generation complete!</p>';
147
+ statusSection.querySelector('h3 i').classList.remove('fa-spinner', 'fa-spin', 'mr-2');
148
+ statusSection.querySelector('h3 i').classList.add('fa-check-circle', 'text-green-500', 'mr-2');
149
+ statusSection.querySelector('h3').innerHTML = '<i class="fas fa-check-circle text-green-500 mr-2"></i> Status Updates';
150
+
151
+ videoTitleSpan.textContent = topic + " in " + duration + " Minutes";
152
+ videoOutputSection.classList.remove('hidden');
153
+ generateButton.disabled = false;
154
+ generateButton.classList.add('hidden');
155
+ resetButton.classList.remove('hidden');
156
+ }, false);
157
+ }, false);
158
+ }, false);
159
+ }, false);
160
+
161
+
162
+ });
163
+
164
+ document.getElementById('resetButton').addEventListener('click', function() {
165
+ const statusMessagesDiv = document.getElementById('statusMessages');
166
+ const errorMessageDiv = document.getElementById('errorMessage');
167
+ const generateButton = document.getElementById('generateButton');
168
+ const resetButton = document.getElementById('resetButton');
169
+ const statusSection = document.getElementById('statusSection');
170
+ const videoOutputSection = document.getElementById('videoOutputSection');
171
+
172
+ statusMessagesDiv.innerHTML = '<p class="text-gray-600"><i class="fas fa-check-circle text-green-500 mr-1"></i> Ready to generate tutorial. Please click "Generate Tutorial".</p>';
173
+ errorMessageDiv.classList.add('hidden');
174
+ videoOutputSection.classList.add('hidden');
175
+ generateButton.disabled = false;
176
+ generateButton.classList.remove('hidden');
177
+ resetButton.classList.add('hidden');
178
+ statusSection.querySelector('h3 i').classList.remove('fa-times-circle', 'text-red-500', 'fa-spinner', 'fa-spin', 'mr-2');
179
+ statusSection.querySelector('h3 i').classList.add('fa-check-circle', 'text-green-500', 'mr-2');
180
+ statusSection.querySelector('h3').innerHTML = '<i class="fas fa-check-circle text-green-500 mr-2"></i> Status Updates';
181
+ });
182
+
183
+
184
+ function simulateStep(statusDiv, message, delay, callback, isSuccess = true) {
185
+ setTimeout(function() {
186
+ const messageElement = document.createElement('p');
187
+ if (isSuccess) {
188
+ messageElement.classList.add('text-gray-600');
189
+ messageElement.innerHTML = `<i class="fas fa-check-circle text-green-500 mr-1"></i> ${message}`;
190
+ } else {
191
+ messageElement.classList.add('text-red-500');
192
+ messageElement.innerHTML = `<i class="fas fa-times-circle text-red-500 mr-1"></i> ${message}`;
193
+ document.getElementById('errorMessage').textContent = "Error during tutorial generation. Please check API keys and try again.";
194
+ document.getElementById('errorMessage').classList.remove('hidden');
195
+ document.getElementById('statusSection').querySelector('h3 i').classList.remove('fa-spinner', 'fa-spin', 'mr-2');
196
+ document.getElementById('statusSection').querySelector('h3 i').classList.add('fa-times-circle', 'text-red-500', 'mr-2');
197
+ document.getElementById('statusSection').querySelector('h3').innerHTML = '<i class="fas fa-times-circle text-red-500 mr-2"></i> Status Updates';
198
+ document.getElementById('generateButton').disabled = false;
199
+ document.getElementById('generateButton').classList.add('hidden');
200
+ document.getElementById('resetButton').classList.remove('hidden');
201
+
202
+ }
203
+ statusDiv.appendChild(messageElement);
204
+ statusDiv.scrollTop = statusDiv.scrollHeight; // Auto scroll to bottom
205
+ if (callback) callback();
206
+ }, delay);
207
+ }
208
+ </script>
209
+
210
+ </body>
211
+ </html>