Spaces:
Running
Running
an app that helps me to find any song guitar chords with the help of ai chat, when i input the song name initials or any form of audio clip like mp3, wav etc, it can suggest the song detail and chords detail, the capo position, then i need to send the lyrics and chords to teleprompter 4k video recording in vertical or horizontal format; after recording transfer to ai video background changer and then audio auto tuner like reverb and gain and compression etc then export to gallery or download to gallery to watch video with song lyrics on screen, i want to make it professional, please use open source api and open ai or publik ai - Initial Deployment
Browse files- README.md +7 -5
- index.html +1003 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: chordgenius
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: pink
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,1003 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>ChordGenius - AI Guitar Assistant</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
9 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/RecordRTC.min.js"></script>
|
10 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
11 |
+
<style>
|
12 |
+
.gradient-bg {
|
13 |
+
background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #1d4ed8 100%);
|
14 |
+
}
|
15 |
+
.chord-highlight {
|
16 |
+
background-color: rgba(255, 255, 0, 0.3);
|
17 |
+
border-radius: 4px;
|
18 |
+
padding: 0 2px;
|
19 |
+
}
|
20 |
+
.teleprompter-text {
|
21 |
+
font-size: 2.5rem;
|
22 |
+
line-height: 1.5;
|
23 |
+
transition: transform 0.3s ease;
|
24 |
+
}
|
25 |
+
.waveform {
|
26 |
+
height: 100px;
|
27 |
+
background: linear-gradient(to right, #3b82f6, #1d4ed8);
|
28 |
+
border-radius: 8px;
|
29 |
+
}
|
30 |
+
@media (max-width: 768px) {
|
31 |
+
.teleprompter-text {
|
32 |
+
font-size: 1.8rem;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
.recording-active {
|
36 |
+
animation: pulse 1.5s infinite;
|
37 |
+
}
|
38 |
+
@keyframes pulse {
|
39 |
+
0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
|
40 |
+
70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
|
41 |
+
100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
|
42 |
+
}
|
43 |
+
</style>
|
44 |
+
</head>
|
45 |
+
<body class="bg-gray-100 font-sans">
|
46 |
+
<div class="min-h-screen flex flex-col">
|
47 |
+
<!-- Header -->
|
48 |
+
<header class="gradient-bg text-white p-4 shadow-lg">
|
49 |
+
<div class="container mx-auto flex justify-between items-center">
|
50 |
+
<div class="flex items-center space-x-2">
|
51 |
+
<i class="fas fa-guitar text-3xl"></i>
|
52 |
+
<h1 class="text-2xl font-bold">ChordGenius</h1>
|
53 |
+
</div>
|
54 |
+
<nav class="hidden md:flex space-x-6">
|
55 |
+
<a href="#chord-finder" class="hover:text-blue-200 transition">Chord Finder</a>
|
56 |
+
<a href="#teleprompter" class="hover:text-blue-200 transition">Teleprompter</a>
|
57 |
+
<a href="#video-editor" class="hover:text-blue-200 transition">Video Editor</a>
|
58 |
+
</nav>
|
59 |
+
<button class="md:hidden text-2xl" id="mobile-menu-btn">
|
60 |
+
<i class="fas fa-bars"></i>
|
61 |
+
</button>
|
62 |
+
</div>
|
63 |
+
<!-- Mobile Menu -->
|
64 |
+
<div class="md:hidden hidden bg-blue-900 p-4" id="mobile-menu">
|
65 |
+
<div class="flex flex-col space-y-3">
|
66 |
+
<a href="#chord-finder" class="hover:text-blue-200 transition">Chord Finder</a>
|
67 |
+
<a href="#teleprompter" class="hover:text-blue-200 transition">Teleprompter</a>
|
68 |
+
<a href="#video-editor" class="hover:text-blue-200 transition">Video Editor</a>
|
69 |
+
</div>
|
70 |
+
</div>
|
71 |
+
</header>
|
72 |
+
|
73 |
+
<!-- Main Content -->
|
74 |
+
<main class="flex-grow container mx-auto p-4">
|
75 |
+
<!-- Chord Finder Section -->
|
76 |
+
<section id="chord-finder" class="mb-12 bg-white rounded-xl shadow-lg p-6">
|
77 |
+
<h2 class="text-2xl font-bold text-gray-800 mb-6 flex items-center">
|
78 |
+
<i class="fas fa-search mr-2 text-blue-600"></i> AI Chord Finder
|
79 |
+
</h2>
|
80 |
+
|
81 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
82 |
+
<!-- Input Section -->
|
83 |
+
<div class="space-y-6">
|
84 |
+
<div>
|
85 |
+
<label class="block text-gray-700 mb-2 font-medium">Search by Song Name or Artist</label>
|
86 |
+
<div class="flex">
|
87 |
+
<input type="text" id="song-search" placeholder="e.g. 'Hotel California' or 'The Beatles'"
|
88 |
+
class="flex-grow p-3 border border-gray-300 rounded-l-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
|
89 |
+
<button id="search-btn" class="bg-blue-600 text-white px-4 rounded-r-lg hover:bg-blue-700 transition">
|
90 |
+
<i class="fas fa-search"></i>
|
91 |
+
</button>
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
|
95 |
+
<div class="border-t pt-4">
|
96 |
+
<label class="block text-gray-700 mb-2 font-medium">Or Upload Audio File</label>
|
97 |
+
<div class="flex items-center space-x-4">
|
98 |
+
<label for="audio-upload" class="cursor-pointer bg-blue-100 text-blue-700 px-4 py-2 rounded-lg hover:bg-blue-200 transition flex items-center">
|
99 |
+
<i class="fas fa-upload mr-2"></i> Choose File
|
100 |
+
<input type="file" id="audio-upload" accept="audio/*" class="hidden">
|
101 |
+
</label>
|
102 |
+
<span id="file-name" class="text-gray-500">No file selected</span>
|
103 |
+
</div>
|
104 |
+
<div class="mt-4">
|
105 |
+
<button id="analyze-btn" class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition flex items-center disabled:opacity-50" disabled>
|
106 |
+
<i class="fas fa-microphone-alt mr-2"></i> Analyze Audio
|
107 |
+
</button>
|
108 |
+
</div>
|
109 |
+
</div>
|
110 |
+
|
111 |
+
<div id="audio-visualizer" class="waveform hidden mt-4"></div>
|
112 |
+
|
113 |
+
<div id="ai-chat" class="mt-6 hidden">
|
114 |
+
<h3 class="text-lg font-semibold text-gray-700 mb-2">AI Chord Assistant</h3>
|
115 |
+
<div class="bg-gray-50 p-4 rounded-lg h-48 overflow-y-auto mb-2" id="chat-messages">
|
116 |
+
<div class="text-sm text-gray-600">AI: Hi! I can help you find chords for any song. Ask me anything about guitar chords!</div>
|
117 |
+
</div>
|
118 |
+
<div class="flex">
|
119 |
+
<input type="text" id="chat-input" placeholder="Ask about chords, capo positions..."
|
120 |
+
class="flex-grow p-2 border border-gray-300 rounded-l-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
|
121 |
+
<button id="send-chat" class="bg-blue-600 text-white px-4 rounded-r-lg hover:bg-blue-700 transition">
|
122 |
+
<i class="fas fa-paper-plane"></i>
|
123 |
+
</button>
|
124 |
+
</div>
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
|
128 |
+
<!-- Results Section -->
|
129 |
+
<div>
|
130 |
+
<div id="loading-spinner" class="hidden flex justify-center items-center h-32">
|
131 |
+
<div class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500"></div>
|
132 |
+
</div>
|
133 |
+
|
134 |
+
<div id="song-results" class="hidden">
|
135 |
+
<div class="flex justify-between items-center mb-4">
|
136 |
+
<h3 class="text-xl font-bold text-gray-800" id="song-title">Song Title</h3>
|
137 |
+
<button id="send-to-teleprompter" class="bg-purple-600 text-white px-4 py-1 rounded-lg hover:bg-purple-700 transition flex items-center">
|
138 |
+
<i class="fas fa-arrow-right mr-2"></i> To Teleprompter
|
139 |
+
</button>
|
140 |
+
</div>
|
141 |
+
|
142 |
+
<div class="flex items-center space-x-4 mb-4">
|
143 |
+
<span class="text-gray-600" id="song-artist">Artist</span>
|
144 |
+
<span class="text-gray-600" id="song-year">Year</span>
|
145 |
+
</div>
|
146 |
+
|
147 |
+
<div class="mb-4">
|
148 |
+
<h4 class="font-semibold text-gray-700 mb-2">Key & Capo Information</h4>
|
149 |
+
<div class="bg-gray-50 p-3 rounded-lg">
|
150 |
+
<div class="grid grid-cols-2 gap-2">
|
151 |
+
<div>
|
152 |
+
<span class="text-gray-500">Key:</span>
|
153 |
+
<span class="font-medium" id="song-key">C Major</span>
|
154 |
+
</div>
|
155 |
+
<div>
|
156 |
+
<span class="text-gray-500">Capo:</span>
|
157 |
+
<span class="font-medium" id="song-capo">3rd fret</span>
|
158 |
+
</div>
|
159 |
+
<div>
|
160 |
+
<span class="text-gray-500">Difficulty:</span>
|
161 |
+
<span class="font-medium" id="song-difficulty">Intermediate</span>
|
162 |
+
</div>
|
163 |
+
<div>
|
164 |
+
<span class="text-gray-500">Tuning:</span>
|
165 |
+
<span class="font-medium" id="song-tuning">Standard</span>
|
166 |
+
</div>
|
167 |
+
</div>
|
168 |
+
</div>
|
169 |
+
</div>
|
170 |
+
|
171 |
+
<div>
|
172 |
+
<h4 class="font-semibold text-gray-700 mb-2">Chords Used</h4>
|
173 |
+
<div class="flex flex-wrap gap-2 mb-4" id="chord-bank">
|
174 |
+
<!-- Chords will be added here dynamically -->
|
175 |
+
</div>
|
176 |
+
|
177 |
+
<h4 class="font-semibold text-gray-700 mb-2">Lyrics with Chords</h4>
|
178 |
+
<div class="bg-gray-50 p-4 rounded-lg h-64 overflow-y-auto font-mono text-sm" id="song-lyrics">
|
179 |
+
<!-- Lyrics with chords will be added here -->
|
180 |
+
</div>
|
181 |
+
</div>
|
182 |
+
</div>
|
183 |
+
</div>
|
184 |
+
</div>
|
185 |
+
</section>
|
186 |
+
|
187 |
+
<!-- Teleprompter Section -->
|
188 |
+
<section id="teleprompter" class="mb-12 bg-white rounded-xl shadow-lg p-6">
|
189 |
+
<h2 class="text-2xl font-bold text-gray-800 mb-6 flex items-center">
|
190 |
+
<i class="fas fa-scroll mr-2 text-purple-600"></i> 4K Teleprompter
|
191 |
+
</h2>
|
192 |
+
|
193 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
194 |
+
<!-- Controls -->
|
195 |
+
<div class="space-y-6">
|
196 |
+
<div>
|
197 |
+
<label class="block text-gray-700 mb-2 font-medium">Teleprompter Text</label>
|
198 |
+
<textarea id="teleprompter-input" rows="10" class="w-full p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Paste lyrics with chords here or use the 'To Teleprompter' button from Chord Finder"></textarea>
|
199 |
+
</div>
|
200 |
+
|
201 |
+
<div class="grid grid-cols-2 gap-4">
|
202 |
+
<div>
|
203 |
+
<label class="block text-gray-700 mb-2 font-medium">Scroll Speed</label>
|
204 |
+
<input type="range" id="scroll-speed" min="1" max="10" value="5" class="w-full">
|
205 |
+
<div class="flex justify-between text-xs text-gray-500">
|
206 |
+
<span>Slow</span>
|
207 |
+
<span>Fast</span>
|
208 |
+
</div>
|
209 |
+
</div>
|
210 |
+
<div>
|
211 |
+
<label class="block text-gray-700 mb-2 font-medium">Font Size</label>
|
212 |
+
<input type="range" id="font-size" min="1" max="5" value="3" class="w-full">
|
213 |
+
<div class="flex justify-between text-xs text-gray-500">
|
214 |
+
<span>Small</span>
|
215 |
+
<span>Large</span>
|
216 |
+
</div>
|
217 |
+
</div>
|
218 |
+
</div>
|
219 |
+
|
220 |
+
<div class="grid grid-cols-2 gap-4">
|
221 |
+
<div>
|
222 |
+
<label class="block text-gray-700 mb-2 font-medium">Text Color</label>
|
223 |
+
<select id="text-color" class="w-full p-2 border border-gray-300 rounded-lg">
|
224 |
+
<option value="text-white">White</option>
|
225 |
+
<option value="text-yellow-300">Yellow</option>
|
226 |
+
<option value="text-green-400">Green</option>
|
227 |
+
<option value="text-blue-300">Blue</option>
|
228 |
+
</select>
|
229 |
+
</div>
|
230 |
+
<div>
|
231 |
+
<label class="block text-gray-700 mb-2 font-medium">Background</label>
|
232 |
+
<select id="bg-color" class="w-full p-2 border border-gray-300 rounded-lg">
|
233 |
+
<option value="bg-black">Black</option>
|
234 |
+
<option value="bg-gray-800">Dark Gray</option>
|
235 |
+
<option value="bg-blue-900">Navy Blue</option>
|
236 |
+
<option value="bg-transparent">Transparent</option>
|
237 |
+
</select>
|
238 |
+
</div>
|
239 |
+
</div>
|
240 |
+
|
241 |
+
<div class="grid grid-cols-2 gap-4">
|
242 |
+
<div>
|
243 |
+
<label class="block text-gray-700 mb-2 font-medium">Orientation</label>
|
244 |
+
<select id="orientation" class="w-full p-2 border border-gray-300 rounded-lg">
|
245 |
+
<option value="horizontal">Horizontal</option>
|
246 |
+
<option value="vertical">Vertical</option>
|
247 |
+
</select>
|
248 |
+
</div>
|
249 |
+
<div>
|
250 |
+
<label class="block text-gray-700 mb-2 font-medium">Mirror Mode</label>
|
251 |
+
<select id="mirror-mode" class="w-full p-2 border border-gray-300 rounded-lg">
|
252 |
+
<option value="normal">Normal</option>
|
253 |
+
<option value="mirrored">Mirrored</option>
|
254 |
+
</select>
|
255 |
+
</div>
|
256 |
+
</div>
|
257 |
+
|
258 |
+
<div class="flex space-x-4 pt-4">
|
259 |
+
<button id="start-teleprompter" class="flex-grow bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 transition flex items-center justify-center">
|
260 |
+
<i class="fas fa-play mr-2"></i> Start Teleprompter
|
261 |
+
</button>
|
262 |
+
<button id="reset-teleprompter" class="bg-gray-200 text-gray-800 px-4 py-2 rounded-lg hover:bg-gray-300 transition">
|
263 |
+
<i class="fas fa-redo"></i>
|
264 |
+
</button>
|
265 |
+
</div>
|
266 |
+
</div>
|
267 |
+
|
268 |
+
<!-- Preview -->
|
269 |
+
<div>
|
270 |
+
<div class="bg-black rounded-lg overflow-hidden relative" style="aspect-ratio: 16/9;">
|
271 |
+
<div id="teleprompter-display" class="h-full w-full flex items-center justify-center overflow-hidden relative">
|
272 |
+
<div id="teleprompter-text" class="teleprompter-text text-white text-center p-4">
|
273 |
+
Your teleprompter text will appear here. Adjust settings on the left to customize appearance.
|
274 |
+
</div>
|
275 |
+
</div>
|
276 |
+
</div>
|
277 |
+
|
278 |
+
<div class="mt-4 grid grid-cols-2 gap-4">
|
279 |
+
<button id="start-recording" class="bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700 transition flex items-center justify-center">
|
280 |
+
<i class="fas fa-circle mr-2"></i> Start Recording
|
281 |
+
</button>
|
282 |
+
<button id="stop-recording" class="bg-gray-600 text-white px-4 py-2 rounded-lg hover:bg-gray-700 transition flex items-center justify-center disabled:opacity-50" disabled>
|
283 |
+
<i class="fas fa-stop mr-2"></i> Stop Recording
|
284 |
+
</button>
|
285 |
+
</div>
|
286 |
+
|
287 |
+
<div class="mt-4 hidden" id="recording-status">
|
288 |
+
<div class="flex items-center text-red-600">
|
289 |
+
<i class="fas fa-circle mr-2"></i>
|
290 |
+
<span>Recording in progress...</span>
|
291 |
+
</div>
|
292 |
+
<div class="mt-2 text-sm text-gray-600">
|
293 |
+
<span id="recording-timer">00:00:00</span>
|
294 |
+
</div>
|
295 |
+
</div>
|
296 |
+
</div>
|
297 |
+
</div>
|
298 |
+
</section>
|
299 |
+
|
300 |
+
<!-- Video Editor Section -->
|
301 |
+
<section id="video-editor" class="bg-white rounded-xl shadow-lg p-6">
|
302 |
+
<h2 class="text-2xl font-bold text-gray-800 mb-6 flex items-center">
|
303 |
+
<i class="fas fa-film mr-2 text-green-600"></i> AI Video Editor
|
304 |
+
</h2>
|
305 |
+
|
306 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
307 |
+
<!-- Video Preview -->
|
308 |
+
<div class="lg:col-span-2">
|
309 |
+
<div class="bg-black rounded-lg overflow-hidden" style="aspect-ratio: 16/9;">
|
310 |
+
<video id="video-preview" controls class="w-full h-full" style="display: none;"></video>
|
311 |
+
<canvas id="video-canvas" class="w-full h-full" style="display: none;"></canvas>
|
312 |
+
<div id="no-video" class="h-full flex items-center justify-center text-gray-400">
|
313 |
+
<div class="text-center">
|
314 |
+
<i class="fas fa-video text-4xl mb-2"></i>
|
315 |
+
<p>Your recorded video will appear here</p>
|
316 |
+
</div>
|
317 |
+
</div>
|
318 |
+
</div>
|
319 |
+
|
320 |
+
<div class="mt-4 flex flex-wrap gap-2">
|
321 |
+
<button id="play-video" class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition flex items-center disabled:opacity-50" disabled>
|
322 |
+
<i class="fas fa-play mr-2"></i> Play
|
323 |
+
</button>
|
324 |
+
<button id="pause-video" class="bg-yellow-500 text-white px-4 py-2 rounded-lg hover:bg-yellow-600 transition flex items-center disabled:opacity-50" disabled>
|
325 |
+
<i class="fas fa-pause mr-2"></i> Pause
|
326 |
+
</button>
|
327 |
+
<button id="apply-effects" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition flex items-center disabled:opacity-50" disabled>
|
328 |
+
<i class="fas fa-magic mr-2"></i> AI Enhance
|
329 |
+
</button>
|
330 |
+
<button id="export-video" class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 transition flex items-center disabled:opacity-50" disabled>
|
331 |
+
<i class="fas fa-download mr-2"></i> Export
|
332 |
+
</button>
|
333 |
+
</div>
|
334 |
+
</div>
|
335 |
+
|
336 |
+
<!-- AI Effects Panel -->
|
337 |
+
<div>
|
338 |
+
<div class="bg-gray-50 rounded-lg p-4">
|
339 |
+
<h3 class="font-semibold text-gray-700 mb-3">AI Video Effects</h3>
|
340 |
+
|
341 |
+
<div class="space-y-4">
|
342 |
+
<div>
|
343 |
+
<label class="block text-gray-700 mb-2">Background Replacement</label>
|
344 |
+
<select id="bg-replacement" class="w-full p-2 border border-gray-300 rounded-lg">
|
345 |
+
<option value="none">None</option>
|
346 |
+
<option value="blur">Blur Background</option>
|
347 |
+
<option value="studio">Studio Background</option>
|
348 |
+
<option value="nature">Nature Scene</option>
|
349 |
+
<option value="stage">Concert Stage</option>
|
350 |
+
<option value="custom">Custom Image</option>
|
351 |
+
</select>
|
352 |
+
<div id="custom-bg-upload" class="mt-2 hidden">
|
353 |
+
<label class="block text-gray-700 mb-1 text-sm">Upload Background</label>
|
354 |
+
<input type="file" id="bg-image-upload" accept="image/*" class="w-full text-sm">
|
355 |
+
</div>
|
356 |
+
</div>
|
357 |
+
|
358 |
+
<div>
|
359 |
+
<label class="block text-gray-700 mb-2">Lighting Adjustment</label>
|
360 |
+
<select id="lighting-effect" class="w-full p-2 border border-gray-300 rounded-lg">
|
361 |
+
<option value="none">None</option>
|
362 |
+
<option value="warm">Warm Tone</option>
|
363 |
+
<option value="cool">Cool Tone</option>
|
364 |
+
<option value="dramatic">Dramatic Lighting</option>
|
365 |
+
<option value="soft">Soft Lighting</option>
|
366 |
+
</select>
|
367 |
+
</div>
|
368 |
+
|
369 |
+
<div>
|
370 |
+
<label class="block text-gray-700 mb-2">AI Audio Enhancement</label>
|
371 |
+
<select id="audio-effect" class="w-full p-2 border border-gray-300 rounded-lg">
|
372 |
+
<option value="none">None</option>
|
373 |
+
<option value="studio">Studio Quality</option>
|
374 |
+
<option value="reverb">Add Reverb</option>
|
375 |
+
<option value="compression">Compression</option>
|
376 |
+
<option value="auto-tune">Auto-Tune</option>
|
377 |
+
<option value="custom">Custom Settings</option>
|
378 |
+
</select>
|
379 |
+
|
380 |
+
<div id="audio-custom-settings" class="mt-2 hidden space-y-2">
|
381 |
+
<div>
|
382 |
+
<label class="block text-gray-700 text-sm">Reverb</label>
|
383 |
+
<input type="range" id="reverb-level" min="0" max="100" value="0" class="w-full">
|
384 |
+
</div>
|
385 |
+
<div>
|
386 |
+
<label class="block text-gray-700 text-sm">Compression</label>
|
387 |
+
<input type="range" id="compression-level" min="0" max="100" value="50" class="w-full">
|
388 |
+
</div>
|
389 |
+
<div>
|
390 |
+
<label class="block text-gray-700 text-sm">Gain</label>
|
391 |
+
<input type="range" id="gain-level" min="-10" max="10" value="0" class="w-full">
|
392 |
+
</div>
|
393 |
+
</div>
|
394 |
+
</div>
|
395 |
+
|
396 |
+
<div>
|
397 |
+
<label class="block text-gray-700 mb-2">Text Overlay</label>
|
398 |
+
<div class="flex items-center space-x-2">
|
399 |
+
<input type="checkbox" id="show-chords" class="rounded text-blue-600">
|
400 |
+
<label for="show-chords">Show Chords</label>
|
401 |
+
</div>
|
402 |
+
<div class="flex items-center space-x-2 mt-1">
|
403 |
+
<input type="checkbox" id="show-lyrics" class="rounded text-blue-600" checked>
|
404 |
+
<label for="show-lyrics">Show Lyrics</label>
|
405 |
+
</div>
|
406 |
+
</div>
|
407 |
+
|
408 |
+
<button id="preview-effects" class="w-full bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition flex items-center justify-center disabled:opacity-50" disabled>
|
409 |
+
<i class="fas fa-eye mr-2"></i> Preview Effects
|
410 |
+
</button>
|
411 |
+
</div>
|
412 |
+
</div>
|
413 |
+
|
414 |
+
<div class="mt-4 bg-gray-50 rounded-lg p-4">
|
415 |
+
<h3 class="font-semibold text-gray-700 mb-3">Export Settings</h3>
|
416 |
+
<div class="space-y-3">
|
417 |
+
<div>
|
418 |
+
<label class="block text-gray-700 mb-1 text-sm">Resolution</label>
|
419 |
+
<select id="export-resolution" class="w-full p-2 border border-gray-300 rounded-lg text-sm">
|
420 |
+
<option value="1080">1080p (Full HD)</option>
|
421 |
+
<option value="720">720p (HD)</option>
|
422 |
+
<option value="4k" selected>4K (UHD)</option>
|
423 |
+
</select>
|
424 |
+
</div>
|
425 |
+
<div>
|
426 |
+
<label class="block text-gray-700 mb-1 text-sm">Format</label>
|
427 |
+
<select id="export-format" class="w-full p-2 border border-gray-300 rounded-lg text-sm">
|
428 |
+
<option value="mp4" selected>MP4</option>
|
429 |
+
<option value="mov">MOV</option>
|
430 |
+
<option value="webm">WebM</option>
|
431 |
+
</select>
|
432 |
+
</div>
|
433 |
+
<div>
|
434 |
+
<label class="block text-gray-700 mb-1 text-sm">Quality</label>
|
435 |
+
<select id="export-quality" class="w-full p-2 border border-gray-300 rounded-lg text-sm">
|
436 |
+
<option value="high">High</option>
|
437 |
+
<option value="medium" selected>Medium</option>
|
438 |
+
<option value="low">Low</option>
|
439 |
+
</select>
|
440 |
+
</div>
|
441 |
+
</div>
|
442 |
+
</div>
|
443 |
+
</div>
|
444 |
+
</div>
|
445 |
+
</section>
|
446 |
+
</main>
|
447 |
+
|
448 |
+
<!-- Footer -->
|
449 |
+
<footer class="gradient-bg text-white p-6 mt-12">
|
450 |
+
<div class="container mx-auto">
|
451 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
|
452 |
+
<div>
|
453 |
+
<h3 class="text-xl font-bold mb-4">ChordGenius</h3>
|
454 |
+
<p class="text-blue-200">Your AI-powered guitar companion for finding chords, creating teleprompter videos, and professional video editing.</p>
|
455 |
+
</div>
|
456 |
+
<div>
|
457 |
+
<h4 class="font-semibold mb-4">Features</h4>
|
458 |
+
<ul class="space-y-2">
|
459 |
+
<li><a href="#chord-finder" class="text-blue-200 hover:text-white transition">AI Chord Finder</a></li>
|
460 |
+
<li><a href="#teleprompter" class="text-blue-200 hover:text-white transition">4K Teleprompter</a></li>
|
461 |
+
<li><a href="#video-editor" class="text-blue-200 hover:text-white transition">AI Video Editor</a></li>
|
462 |
+
</ul>
|
463 |
+
</div>
|
464 |
+
<div>
|
465 |
+
<h4 class="font-semibold mb-4">Connect</h4>
|
466 |
+
<div class="flex space-x-4">
|
467 |
+
<a href="#" class="text-2xl text-blue-200 hover:text-white transition"><i class="fab fa-facebook"></i></a>
|
468 |
+
<a href="#" class="text-2xl text-blue-200 hover:text-white transition"><i class="fab fa-twitter"></i></a>
|
469 |
+
<a href="#" class="text-2xl text-blue-200 hover:text-white transition"><i class="fab fa-instagram"></i></a>
|
470 |
+
<a href="#" class="text-2xl text-blue-200 hover:text-white transition"><i class="fab fa-youtube"></i></a>
|
471 |
+
</div>
|
472 |
+
</div>
|
473 |
+
</div>
|
474 |
+
<div class="border-t border-blue-800 mt-8 pt-6 text-center text-blue-200">
|
475 |
+
<p>© 2023 ChordGenius. All rights reserved.</p>
|
476 |
+
</div>
|
477 |
+
</div>
|
478 |
+
</footer>
|
479 |
+
</div>
|
480 |
+
|
481 |
+
<script>
|
482 |
+
// Mobile Menu Toggle
|
483 |
+
document.getElementById('mobile-menu-btn').addEventListener('click', function() {
|
484 |
+
const menu = document.getElementById('mobile-menu');
|
485 |
+
menu.classList.toggle('hidden');
|
486 |
+
});
|
487 |
+
|
488 |
+
// Sample data for demonstration
|
489 |
+
const sampleSongs = {
|
490 |
+
"hotel california": {
|
491 |
+
title: "Hotel California",
|
492 |
+
artist: "Eagles",
|
493 |
+
year: "1976",
|
494 |
+
key: "B minor",
|
495 |
+
capo: "No capo (or 7th fret for easier chords)",
|
496 |
+
difficulty: "Intermediate",
|
497 |
+
tuning: "Standard",
|
498 |
+
chords: ["Bm", "F#", "A", "E", "G", "D", "Em", "F#7"],
|
499 |
+
lyrics: `
|
500 |
+
[Intro]
|
501 |
+
Bm F# A E G D Em F#7
|
502 |
+
|
503 |
+
[Verse 1]
|
504 |
+
Bm F#
|
505 |
+
On a dark desert highway
|
506 |
+
A E
|
507 |
+
Cool wind in my hair
|
508 |
+
G D
|
509 |
+
Warm smell of colitas
|
510 |
+
Em F#7
|
511 |
+
Rising up through the air
|
512 |
+
|
513 |
+
[Chorus]
|
514 |
+
Bm F# A E
|
515 |
+
Welcome to the Hotel California
|
516 |
+
G D Em F#7
|
517 |
+
Such a lovely place (such a lovely place)
|
518 |
+
Bm F# A E
|
519 |
+
Plenty of room at the Hotel California
|
520 |
+
G D Em F#7
|
521 |
+
Any time of year (any time of year)
|
522 |
+
`
|
523 |
+
},
|
524 |
+
"wonderwall": {
|
525 |
+
title: "Wonderwall",
|
526 |
+
artist: "Oasis",
|
527 |
+
year: "1995",
|
528 |
+
key: "F# minor (capo 2)",
|
529 |
+
capo: "2nd fret",
|
530 |
+
difficulty: "Beginner",
|
531 |
+
tuning: "Standard",
|
532 |
+
chords: ["Em7", "G", "D", "A7sus4", "C", "D7"],
|
533 |
+
lyrics: `
|
534 |
+
[Intro]
|
535 |
+
Em7 G D A7sus4
|
536 |
+
|
537 |
+
[Verse 1]
|
538 |
+
Em7 G
|
539 |
+
Today is gonna be the day
|
540 |
+
D A7sus4
|
541 |
+
That they're gonna throw it back to you
|
542 |
+
Em7 G
|
543 |
+
By now you should've somehow
|
544 |
+
D A7sus4
|
545 |
+
Realized what you gotta do
|
546 |
+
|
547 |
+
[Chorus]
|
548 |
+
C D7
|
549 |
+
I don't believe that anybody
|
550 |
+
Em7 G
|
551 |
+
Feels the way I do
|
552 |
+
C D7
|
553 |
+
About you now
|
554 |
+
`
|
555 |
+
}
|
556 |
+
};
|
557 |
+
|
558 |
+
// Chord Finder Functionality
|
559 |
+
document.getElementById('search-btn').addEventListener('click', function() {
|
560 |
+
const searchTerm = document.getElementById('song-search').value.toLowerCase();
|
561 |
+
showLoading(true);
|
562 |
+
|
563 |
+
// Simulate API call with timeout
|
564 |
+
setTimeout(() => {
|
565 |
+
if (sampleSongs[searchTerm]) {
|
566 |
+
displaySongResults(sampleSongs[searchTerm]);
|
567 |
+
} else {
|
568 |
+
// If no exact match, try to find partial matches
|
569 |
+
const matches = Object.keys(sampleSongs).filter(song =>
|
570 |
+
song.includes(searchTerm) || sampleSongs[song].artist.toLowerCase().includes(searchTerm)
|
571 |
+
);
|
572 |
+
|
573 |
+
if (matches.length > 0) {
|
574 |
+
displaySongResults(sampleSongs[matches[0]]);
|
575 |
+
} else {
|
576 |
+
document.getElementById('chat-messages').innerHTML += `
|
577 |
+
<div class="text-sm text-gray-600 mt-2">AI: I couldn't find an exact match for "${searchTerm}". Try being more specific or upload an audio file for analysis.</div>
|
578 |
+
`;
|
579 |
+
showLoading(false);
|
580 |
+
}
|
581 |
+
}
|
582 |
+
}, 1500);
|
583 |
+
});
|
584 |
+
|
585 |
+
// File Upload Handling
|
586 |
+
document.getElementById('audio-upload').addEventListener('change', function(e) {
|
587 |
+
const file = e.target.files[0];
|
588 |
+
if (file) {
|
589 |
+
document.getElementById('file-name').textContent = file.name;
|
590 |
+
document.getElementById('analyze-btn').disabled = false;
|
591 |
+
|
592 |
+
// Simple audio visualization for demo
|
593 |
+
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
594 |
+
const fileReader = new FileReader();
|
595 |
+
|
596 |
+
fileReader.onload = function(e) {
|
597 |
+
audioContext.decodeAudioData(e.target.result).then(function(buffer) {
|
598 |
+
visualizeAudio(buffer);
|
599 |
+
});
|
600 |
+
};
|
601 |
+
|
602 |
+
fileReader.readAsArrayBuffer(file);
|
603 |
+
}
|
604 |
+
});
|
605 |
+
|
606 |
+
function visualizeAudio(buffer) {
|
607 |
+
const audioVisualizer = document.getElementById('audio-visualizer');
|
608 |
+
audioVisualizer.classList.remove('hidden');
|
609 |
+
|
610 |
+
// Simple waveform visualization
|
611 |
+
const canvas = document.createElement('canvas');
|
612 |
+
canvas.width = audioVisualizer.offsetWidth;
|
613 |
+
canvas.height = audioVisualizer.offsetHeight;
|
614 |
+
audioVisualizer.innerHTML = '';
|
615 |
+
audioVisualizer.appendChild(canvas);
|
616 |
+
|
617 |
+
const ctx = canvas.getContext('2d');
|
618 |
+
const data = buffer.getChannelData(0);
|
619 |
+
const step = Math.ceil(data.length / canvas.width);
|
620 |
+
const amp = canvas.height / 2;
|
621 |
+
|
622 |
+
ctx.fillStyle = 'rgba(255, 255, 255, 0.2)';
|
623 |
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
624 |
+
|
625 |
+
ctx.beginPath();
|
626 |
+
ctx.strokeStyle = '#ffffff';
|
627 |
+
ctx.lineWidth = 2;
|
628 |
+
|
629 |
+
for (let i = 0; i < canvas.width; i++) {
|
630 |
+
const min = 1.0;
|
631 |
+
const max = -1.0;
|
632 |
+
|
633 |
+
for (let j = 0; j < step; j++) {
|
634 |
+
const datum = data[(i * step) + j];
|
635 |
+
if (datum < min) min = datum;
|
636 |
+
if (datum > max) max = datum;
|
637 |
+
}
|
638 |
+
|
639 |
+
ctx.moveTo(i, (1 + min) * amp);
|
640 |
+
ctx.lineTo(i, (1 + max) * amp);
|
641 |
+
}
|
642 |
+
|
643 |
+
ctx.stroke();
|
644 |
+
}
|
645 |
+
|
646 |
+
document.getElementById('analyze-btn').addEventListener('click', function() {
|
647 |
+
showLoading(true);
|
648 |
+
|
649 |
+
// Simulate AI audio analysis with timeout
|
650 |
+
setTimeout(() => {
|
651 |
+
displaySongResults(sampleSongs['hotel california']); // Default to Hotel California for demo
|
652 |
+
document.getElementById('chat-messages').innerHTML += `
|
653 |
+
<div class="text-sm text-gray-600 mt-2">AI: I've analyzed your audio file and detected the song "Hotel California" by Eagles. Here are the chords and lyrics.</div>
|
654 |
+
`;
|
655 |
+
}, 2000);
|
656 |
+
});
|
657 |
+
|
658 |
+
function showLoading(show) {
|
659 |
+
const loadingSpinner = document.getElementById('loading-spinner');
|
660 |
+
const songResults = document.getElementById('song-results');
|
661 |
+
|
662 |
+
if (show) {
|
663 |
+
loadingSpinner.classList.remove('hidden');
|
664 |
+
songResults.classList.add('hidden');
|
665 |
+
} else {
|
666 |
+
loadingSpinner.classList.add('hidden');
|
667 |
+
songResults.classList.remove('hidden');
|
668 |
+
}
|
669 |
+
}
|
670 |
+
|
671 |
+
function displaySongResults(song) {
|
672 |
+
document.getElementById('song-title').textContent = song.title;
|
673 |
+
document.getElementById('song-artist').textContent = song.artist;
|
674 |
+
document.getElementById('song-year').textContent = song.year;
|
675 |
+
document.getElementById('song-key').textContent = song.key;
|
676 |
+
document.getElementById('song-capo').textContent = song.capo;
|
677 |
+
document.getElementById('song-difficulty').textContent = song.difficulty;
|
678 |
+
document.getElementById('song-tuning').textContent = song.tuning;
|
679 |
+
|
680 |
+
// Display chords
|
681 |
+
const chordBank = document.getElementById('chord-bank');
|
682 |
+
chordBank.innerHTML = '';
|
683 |
+
song.chords.forEach(chord => {
|
684 |
+
const chordElement = document.createElement('div');
|
685 |
+
chordElement.className = 'bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm font-medium';
|
686 |
+
chordElement.textContent = chord;
|
687 |
+
chordBank.appendChild(chordElement);
|
688 |
+
});
|
689 |
+
|
690 |
+
// Display lyrics with chords
|
691 |
+
const lyricsElement = document.getElementById('song-lyrics');
|
692 |
+
lyricsElement.innerHTML = '';
|
693 |
+
|
694 |
+
// Process lyrics to highlight chords
|
695 |
+
const lines = song.lyrics.split('\n');
|
696 |
+
lines.forEach(line => {
|
697 |
+
const lineElement = document.createElement('div');
|
698 |
+
lineElement.className = 'mb-1';
|
699 |
+
|
700 |
+
// Simple chord detection (in real app, would need more sophisticated parsing)
|
701 |
+
const words = line.split(/(\[.*?\])|(\b[A-Za-z0-9#]+\b)/g).filter(Boolean);
|
702 |
+
|
703 |
+
words.forEach(word => {
|
704 |
+
if (song.chords.includes(word)) {
|
705 |
+
const chordSpan = document.createElement('span');
|
706 |
+
chordSpan.className = 'chord-highlight text-blue-600 font-bold';
|
707 |
+
chordSpan.textContent = word;
|
708 |
+
lineElement.appendChild(chordSpan);
|
709 |
+
} else {
|
710 |
+
lineElement.appendChild(document.createTextNode(word));
|
711 |
+
}
|
712 |
+
});
|
713 |
+
|
714 |
+
lyricsElement.appendChild(lineElement);
|
715 |
+
});
|
716 |
+
|
717 |
+
// Show AI chat
|
718 |
+
document.getElementById('ai-chat').classList.remove('hidden');
|
719 |
+
|
720 |
+
showLoading(false);
|
721 |
+
}
|
722 |
+
|
723 |
+
// AI Chat Functionality
|
724 |
+
document.getElementById('send-chat').addEventListener('click', function() {
|
725 |
+
const chatInput = document.getElementById('chat-input');
|
726 |
+
const message = chatInput.value.trim();
|
727 |
+
|
728 |
+
if (message) {
|
729 |
+
// Add user message to chat
|
730 |
+
const chatMessages = document.getElementById('chat-messages');
|
731 |
+
chatMessages.innerHTML += `
|
732 |
+
<div class="text-right text-sm text-blue-700 mb-2">You: ${message}</div>
|
733 |
+
`;
|
734 |
+
|
735 |
+
// Simulate AI response
|
736 |
+
setTimeout(() => {
|
737 |
+
let response = "I'm not sure how to answer that. Can you be more specific?";
|
738 |
+
|
739 |
+
if (message.toLowerCase().includes('capo')) {
|
740 |
+
const currentSong = document.getElementById('song-title').textContent;
|
741 |
+
const capoPosition = document.getElementById('song-capo').textContent;
|
742 |
+
response = `For ${currentSong}, the recommended capo position is ${capoPosition}.`;
|
743 |
+
} else if (message.toLowerCase().includes('chord') || message.toLowerCase().includes('play')) {
|
744 |
+
const chords = Array.from(document.querySelectorAll('#chord-bank div')).map(el => el.textContent).join(', ');
|
745 |
+
response = `The main chords used in this song are: ${chords}. Would you like me to explain how to play any of these chords?`;
|
746 |
+
} else if (message.toLowerCase().includes('easy') || message.toLowerCase().includes('simpl')) {
|
747 |
+
response = "You can simplify some chords by using power chords or open chord variations. For example, try playing Bm as Bm7 or just the root and fifth.";
|
748 |
+
}
|
749 |
+
|
750 |
+
chatMessages.innerHTML += `
|
751 |
+
<div class="text-sm text-gray-600 mt-2">AI: ${response}</div>
|
752 |
+
`;
|
753 |
+
chatMessages.scrollTop = chatMessages.scrollHeight;
|
754 |
+
}, 500);
|
755 |
+
|
756 |
+
chatInput.value = '';
|
757 |
+
chatMessages.scrollTop = chatMessages.scrollHeight;
|
758 |
+
}
|
759 |
+
});
|
760 |
+
|
761 |
+
// Send to Teleprompter
|
762 |
+
document.getElementById('send-to-teleprompter').addEventListener('click', function() {
|
763 |
+
const lyrics = document.getElementById('song-lyrics').textContent;
|
764 |
+
document.getElementById('teleprompter-input').value = lyrics;
|
765 |
+
|
766 |
+
// Scroll to teleprompter section
|
767 |
+
document.getElementById('teleprompter').scrollIntoView({ behavior: 'smooth' });
|
768 |
+
});
|
769 |
+
|
770 |
+
// Teleprompter Functionality
|
771 |
+
let teleprompterInterval;
|
772 |
+
let scrollPosition = 0;
|
773 |
+
|
774 |
+
document.getElementById('start-teleprompter').addEventListener('click', function() {
|
775 |
+
const text = document.getElementById('teleprompter-input').value;
|
776 |
+
if (!text) return;
|
777 |
+
|
778 |
+
const speed = document.getElementById('scroll-speed').value;
|
779 |
+
const fontSize = document.getElementById('font-size').value;
|
780 |
+
const textColor = document.getElementById('text-color').value;
|
781 |
+
const bgColor = document.getElementById('bg-color').value;
|
782 |
+
const orientation = document.getElementById('orientation').value;
|
783 |
+
const mirrorMode = document.getElementById('mirror-mode').value;
|
784 |
+
|
785 |
+
const teleprompterText = document.getElementById('teleprompter-text');
|
786 |
+
teleprompterText.innerHTML = text.replace(/\n/g, '<br>');
|
787 |
+
teleprompterText.className = `teleprompter-text ${textColor} text-center p-4`;
|
788 |
+
|
789 |
+
const teleprompterDisplay = document.getElementById('teleprompter-display');
|
790 |
+
teleprompterDisplay.className = `h-full w-full flex items-center justify-center overflow-hidden relative ${bgColor}`;
|
791 |
+
|
792 |
+
// Set font size based on slider (1-5)
|
793 |
+
const sizeMap = {1: '1.5rem', 2: '2rem', 3: '2.5rem', 4: '3rem', 5: '3.5rem'};
|
794 |
+
teleprompterText.style.fontSize = sizeMap[fontSize];
|
795 |
+
|
796 |
+
// Handle orientation
|
797 |
+
if (orientation === 'vertical') {
|
798 |
+
teleprompterDisplay.style.aspectRatio = '9/16';
|
799 |
+
} else {
|
800 |
+
teleprompterDisplay.style.aspectRatio = '16/9';
|
801 |
+
}
|
802 |
+
|
803 |
+
// Handle mirror mode
|
804 |
+
if (mirrorMode === 'mirrored') {
|
805 |
+
teleprompterText.style.transform = 'scaleX(-1)';
|
806 |
+
} else {
|
807 |
+
teleprompterText.style.transform = 'scaleX(1)';
|
808 |
+
}
|
809 |
+
|
810 |
+
// Start scrolling
|
811 |
+
scrollPosition = 0;
|
812 |
+
teleprompterText.style.transform += ` translateY(${scrollPosition}px)`;
|
813 |
+
|
814 |
+
clearInterval(teleprompterInterval);
|
815 |
+
teleprompterInterval = setInterval(() => {
|
816 |
+
scrollPosition -= 1;
|
817 |
+
teleprompterText.style.transform = (mirrorMode === 'mirrored' ? 'scaleX(-1)' : 'scaleX(1)') + ` translateY(${scrollPosition}px)`;
|
818 |
+
|
819 |
+
// Reset if scrolled past end
|
820 |
+
if (scrollPosition < -teleprompterText.offsetHeight) {
|
821 |
+
scrollPosition = teleprompterDisplay.offsetHeight;
|
822 |
+
}
|
823 |
+
}, 100 - (speed * 9));
|
824 |
+
});
|
825 |
+
|
826 |
+
document.getElementById('reset-teleprompter').addEventListener('click', function() {
|
827 |
+
clearInterval(teleprompterInterval);
|
828 |
+
scrollPosition = 0;
|
829 |
+
document.getElementById('teleprompter-text').style.transform = 'translateY(0)';
|
830 |
+
});
|
831 |
+
|
832 |
+
// Video Recording Functionality
|
833 |
+
let mediaRecorder;
|
834 |
+
let recordedChunks = [];
|
835 |
+
let recordingStartTime;
|
836 |
+
let timerInterval;
|
837 |
+
|
838 |
+
document.getElementById('start-recording').addEventListener('click', async function() {
|
839 |
+
try {
|
840 |
+
const stream = await navigator.mediaDevices.getDisplayMedia({
|
841 |
+
video: {
|
842 |
+
width: { ideal: 3840 },
|
843 |
+
height: { ideal: 2160 },
|
844 |
+
frameRate: { ideal: 60 }
|
845 |
+
},
|
846 |
+
audio: true
|
847 |
+
});
|
848 |
+
|
849 |
+
mediaRecorder = new MediaRecorder(stream);
|
850 |
+
|
851 |
+
mediaRecorder.ondataavailable = function(e) {
|
852 |
+
if (e.data.size > 0) {
|
853 |
+
recordedChunks.push(e.data);
|
854 |
+
}
|
855 |
+
};
|
856 |
+
|
857 |
+
mediaRecorder.onstop = function() {
|
858 |
+
const blob = new Blob(recordedChunks, { type: 'video/webm' });
|
859 |
+
const videoUrl = URL.createObjectURL(blob);
|
860 |
+
|
861 |
+
const videoPreview = document.getElementById('video-preview');
|
862 |
+
videoPreview.src = videoUrl;
|
863 |
+
videoPreview.style.display = 'block';
|
864 |
+
document.getElementById('no-video').style.display = 'none';
|
865 |
+
|
866 |
+
// Enable video editor buttons
|
867 |
+
document.getElementById('play-video').disabled = false;
|
868 |
+
document.getElementById('pause-video').disabled = false;
|
869 |
+
document.getElementById('apply-effects').disabled = false;
|
870 |
+
document.getElementById('export-video').disabled = false;
|
871 |
+
document.getElementById('preview-effects').disabled = false;
|
872 |
+
|
873 |
+
// Stop all tracks
|
874 |
+
stream.getTracks().forEach(track => track.stop());
|
875 |
+
|
876 |
+
// Clear timer
|
877 |
+
clearInterval(timerInterval);
|
878 |
+
document.getElementById('recording-status').classList.add('hidden');
|
879 |
+
};
|
880 |
+
|
881 |
+
recordedChunks = [];
|
882 |
+
mediaRecorder.start(100); // Collect data every 100ms
|
883 |
+
recordingStartTime = Date.now();
|
884 |
+
|
885 |
+
// Update timer
|
886 |
+
timerInterval = setInterval(updateRecordingTimer, 1000);
|
887 |
+
|
888 |
+
// Update UI
|
889 |
+
document.getElementById('recording-status').classList.remove('hidden');
|
890 |
+
document.getElementById('start-recording').disabled = true;
|
891 |
+
document.getElementById('stop-recording').disabled = false;
|
892 |
+
document.getElementById('start-recording').classList.add('recording-active');
|
893 |
+
|
894 |
+
} catch (err) {
|
895 |
+
console.error('Error recording:', err);
|
896 |
+
alert('Could not start recording. Please make sure to select a window or screen to record.');
|
897 |
+
}
|
898 |
+
});
|
899 |
+
|
900 |
+
function updateRecordingTimer() {
|
901 |
+
const elapsed = Math.floor((Date.now() - recordingStartTime) / 1000);
|
902 |
+
const hours = Math.floor(elapsed / 3600).toString().padStart(2, '0');
|
903 |
+
const minutes = Math.floor((elapsed % 3600) / 60).toString().padStart(2, '0');
|
904 |
+
const seconds = (elapsed % 60).toString().padStart(2, '0');
|
905 |
+
|
906 |
+
document.getElementById('recording-timer').textContent = `${hours}:${minutes}:${seconds}`;
|
907 |
+
}
|
908 |
+
|
909 |
+
document.getElementById('stop-recording').addEventListener('click', function() {
|
910 |
+
if (mediaRecorder && mediaRecorder.state !== 'inactive') {
|
911 |
+
mediaRecorder.stop();
|
912 |
+
document.getElementById('start-recording').disabled = false;
|
913 |
+
document.getElementById('stop-recording').disabled = true;
|
914 |
+
document.getElementById('start-recording').classList.remove('recording-active');
|
915 |
+
}
|
916 |
+
});
|
917 |
+
|
918 |
+
// Video Editor Functionality
|
919 |
+
document.getElementById('play-video').addEventListener('click', function() {
|
920 |
+
const video = document.getElementById('video-preview');
|
921 |
+
video.play();
|
922 |
+
});
|
923 |
+
|
924 |
+
document.getElementById('pause-video').addEventListener('click', function() {
|
925 |
+
const video = document.getElementById('video-preview');
|
926 |
+
video.pause();
|
927 |
+
});
|
928 |
+
|
929 |
+
document.getElementById('bg-replacement').addEventListener('change', function() {
|
930 |
+
const value = this.value;
|
931 |
+
const customUpload = document.getElementById('custom-bg-upload');
|
932 |
+
|
933 |
+
if (value === 'custom') {
|
934 |
+
customUpload.classList.remove('hidden');
|
935 |
+
} else {
|
936 |
+
customUpload.classList.add('hidden');
|
937 |
+
}
|
938 |
+
});
|
939 |
+
|
940 |
+
document.getElementById('audio-effect').addEventListener('change', function() {
|
941 |
+
const value = this.value;
|
942 |
+
const customSettings = document.getElementById('audio-custom-settings');
|
943 |
+
|
944 |
+
if (value === 'custom') {
|
945 |
+
customSettings.classList.remove('hidden');
|
946 |
+
} else {
|
947 |
+
customSettings.classList.add('hidden');
|
948 |
+
}
|
949 |
+
});
|
950 |
+
|
951 |
+
document.getElementById('preview-effects').addEventListener('click', function() {
|
952 |
+
// In a real app, this would apply the selected effects to a preview
|
953 |
+
alert('In the full app, this would show a preview of your selected effects before applying them.');
|
954 |
+
});
|
955 |
+
|
956 |
+
document.getElementById('apply-effects').addEventListener('click', function() {
|
957 |
+
// Simulate AI processing
|
958 |
+
showLoading(true);
|
959 |
+
const videoCanvas = document.getElementById('video-canvas');
|
960 |
+
const videoPreview = document.getElementById('video-preview');
|
961 |
+
|
962 |
+
setTimeout(() => {
|
963 |
+
// In a real app, this would apply the selected effects using AI/WebGL
|
964 |
+
videoPreview.style.display = 'none';
|
965 |
+
videoCanvas.style.display = 'block';
|
966 |
+
|
967 |
+
const ctx = videoCanvas.getContext('2d');
|
968 |
+
videoCanvas.width = videoPreview.videoWidth;
|
969 |
+
videoCanvas.height = videoPreview.videoHeight;
|
970 |
+
|
971 |
+
// Draw a sample effect (in real app, would apply actual AI effects)
|
972 |
+
ctx.filter = 'contrast(1.2) brightness(1.1) saturate(1.3)';
|
973 |
+
ctx.drawImage(videoPreview, 0, 0, videoCanvas.width, videoCanvas.height);
|
974 |
+
|
975 |
+
showLoading(false);
|
976 |
+
alert('AI effects applied successfully! The video has been enhanced with better lighting and background.');
|
977 |
+
}, 2000);
|
978 |
+
});
|
979 |
+
|
980 |
+
document.getElementById('export-video').addEventListener('click', function() {
|
981 |
+
// In a real app, this would export the final video
|
982 |
+
alert('Video exported successfully! In the full app, this would save to your device or gallery.');
|
983 |
+
|
984 |
+
// Simulate download
|
985 |
+
const link = document.createElement('a');
|
986 |
+
link.href = document.getElementById('video-preview').src;
|
987 |
+
link.download = 'chordgenius-video.mp4';
|
988 |
+
document.body.appendChild(link);
|
989 |
+
link.click();
|
990 |
+
document.body.removeChild(link);
|
991 |
+
});
|
992 |
+
|
993 |
+
// Initialize the app
|
994 |
+
document.addEventListener('DOMContentLoaded', function() {
|
995 |
+
// Show AI chat by default with welcome message
|
996 |
+
document.getElementById('ai-chat').classList.remove('hidden');
|
997 |
+
|
998 |
+
// For demo purposes, show the Hotel California results
|
999 |
+
displaySongResults(sampleSongs['hotel california']);
|
1000 |
+
});
|
1001 |
+
</script>
|
1002 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=tushkum/chordgenius" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
1003 |
+
</html>
|