Spaces:
Runtime error
Runtime error
Update templates/index.html
Browse files- templates/index.html +25 -8
templates/index.html
CHANGED
@@ -3,16 +3,27 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>
|
7 |
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
|
8 |
</head>
|
9 |
<body>
|
10 |
-
<
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
<script>
|
18 |
async function playWelcomeAudio() {
|
@@ -42,7 +53,13 @@
|
|
42 |
});
|
43 |
|
44 |
let result = await response.json();
|
45 |
-
document.getElementById("
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
};
|
47 |
|
48 |
mediaRecorder.start();
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Biryani Hub</title>
|
7 |
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
|
8 |
</head>
|
9 |
<body>
|
10 |
+
<div class="container">
|
11 |
+
<h1>Biryani Hub</h1>
|
12 |
+
|
13 |
+
<label for="name">Name</label>
|
14 |
+
<input type="text" id="name" placeholder="Your name will appear here..." readonly>
|
15 |
+
|
16 |
+
<label for="email">Email</label>
|
17 |
+
<input type="text" id="email" placeholder="Your email will appear here..." readonly>
|
18 |
+
|
19 |
+
<button id="mic-button" onclick="recordAudio()">
|
20 |
+
🎙️ Click to Speak
|
21 |
+
</button>
|
22 |
+
|
23 |
+
<p class="instructions">Please say your name when ready</p>
|
24 |
+
|
25 |
+
<audio id="audio-player" controls></audio>
|
26 |
+
</div>
|
27 |
|
28 |
<script>
|
29 |
async function playWelcomeAudio() {
|
|
|
53 |
});
|
54 |
|
55 |
let result = await response.json();
|
56 |
+
document.getElementById("name").value = result.text || result.error;
|
57 |
+
|
58 |
+
// Prompt for Email after Name
|
59 |
+
setTimeout(() => {
|
60 |
+
let emailPrompt = new Audio("/static/email_prompt.mp3");
|
61 |
+
emailPrompt.play();
|
62 |
+
}, 2000);
|
63 |
};
|
64 |
|
65 |
mediaRecorder.start();
|