Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +12 -4
templates/index.html
CHANGED
@@ -101,10 +101,18 @@
|
|
101 |
recognition.start();
|
102 |
recognition.onresult = function(event) {
|
103 |
const transcript = event.results[0][0].transcript.trim();
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
};
|
109 |
}
|
110 |
|
|
|
101 |
recognition.start();
|
102 |
recognition.onresult = function(event) {
|
103 |
const transcript = event.results[0][0].transcript.trim();
|
104 |
+
|
105 |
+
// Remove all spaces from the name
|
106 |
+
const cleanedName = transcript.replace(/\s+/g, '');
|
107 |
+
|
108 |
+
if (!isNameCaptured) {
|
109 |
+
// If name is not yet captured, capture name first
|
110 |
+
nameInput.value = cleanedName; // Set the cleaned name without spaces
|
111 |
+
status.textContent = 'Listening for your email...'; // Prompt for email
|
112 |
+
recognition.stop(); // Stop listening for name
|
113 |
+
isNameCaptured = true; // Mark name as captured
|
114 |
+
recognition.start(); // Start listening for email
|
115 |
+
}
|
116 |
};
|
117 |
}
|
118 |
|