Update templates/index.html
Browse files- templates/index.html +21 -21
templates/index.html
CHANGED
|
@@ -117,7 +117,7 @@
|
|
| 117 |
}
|
| 118 |
|
| 119 |
function askLoginOrRegister() {
|
| 120 |
-
speak("Welcome to Biryani Hub
|
| 121 |
recognition.start();
|
| 122 |
recognition.onresult = function (event) {
|
| 123 |
let response = event.results[0][0].transcript.trim().toLowerCase();
|
|
@@ -271,20 +271,20 @@
|
|
| 271 |
let emailCaptured = "";
|
| 272 |
let mobileCaptured = "";
|
| 273 |
|
| 274 |
-
if ('webkitSpeechRecognition' in window) {
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
} else {
|
| 280 |
-
|
| 281 |
-
}
|
| 282 |
|
| 283 |
-
function speak(text, callback) {
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
}
|
| 288 |
|
| 289 |
function startListeningForEmail() {
|
| 290 |
recognition.start();
|
|
@@ -349,13 +349,13 @@
|
|
| 349 |
};
|
| 350 |
}
|
| 351 |
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
|
| 360 |
window.onload = function () {
|
| 361 |
askLoginOrRegister();
|
|
|
|
| 117 |
}
|
| 118 |
|
| 119 |
function askLoginOrRegister() {
|
| 120 |
+
speak("Welcome to Biryani Hub Are you a new customer or an existing customer? Say 'new' to register or 'existing' to login.", function () {
|
| 121 |
recognition.start();
|
| 122 |
recognition.onresult = function (event) {
|
| 123 |
let response = event.results[0][0].transcript.trim().toLowerCase();
|
|
|
|
| 271 |
let emailCaptured = "";
|
| 272 |
let mobileCaptured = "";
|
| 273 |
|
| 274 |
+
// if ('webkitSpeechRecognition' in window) {
|
| 275 |
+
// recognition = new webkitSpeechRecognition();
|
| 276 |
+
// recognition.continuous = false;
|
| 277 |
+
// recognition.interimResults = false;
|
| 278 |
+
// recognition.lang = 'en-US';
|
| 279 |
+
// } else {
|
| 280 |
+
// alert("Speech Recognition API is not supported in this browser.");
|
| 281 |
+
// }
|
| 282 |
|
| 283 |
+
// function speak(text, callback) {
|
| 284 |
+
// const speech = new SpeechSynthesisUtterance(text);
|
| 285 |
+
// speech.onend = callback;
|
| 286 |
+
// window.speechSynthesis.speak(speech);
|
| 287 |
+
// }
|
| 288 |
|
| 289 |
function startListeningForEmail() {
|
| 290 |
recognition.start();
|
|
|
|
| 349 |
};
|
| 350 |
}
|
| 351 |
|
| 352 |
+
function startProcess() {
|
| 353 |
+
speak("Welcome to Biryani Hub", function() {
|
| 354 |
+
speak("Tell me your email, and I will confirm it with you.", function() {
|
| 355 |
+
setTimeout(startListeningForEmail, 500);
|
| 356 |
+
});
|
| 357 |
+
});
|
| 358 |
+
}
|
| 359 |
|
| 360 |
window.onload = function () {
|
| 361 |
askLoginOrRegister();
|