Subbu1304 commited on
Commit
f714d76
Β·
verified Β·
1 Parent(s): f7bd5a3

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +60 -12
templates/index.html CHANGED
@@ -17,7 +17,7 @@
17
  text-align: center;
18
  }
19
  .container {
20
- background: lightblue;
21
  padding: 40px 50px;
22
  border-radius: 10px;
23
  width: 400px;
@@ -29,18 +29,24 @@
29
  color: #ff6a00;
30
  }
31
  label {
32
- font-size: 18px;
33
  margin-top: 20px;
34
  display: block;
35
  text-align: left;
 
36
  }
37
  input[type="text"] {
38
  width: 100%;
39
- padding: 10px;
40
  font-size: 16px;
41
- border: 1px solid #ccc;
42
- border-radius: 5px;
43
  margin-top: 8px;
 
 
 
 
 
44
  }
45
  .info {
46
  margin-top: 20px;
@@ -53,11 +59,16 @@
53
  color: gray;
54
  margin-top: 20px;
55
  }
 
 
 
 
56
  </style>
57
  </head>
58
  <body>
59
  <div class="container">
60
- <h1>Welcome to Biryani Hub</h1>
 
61
 
62
  <label for="name">Your Name</label>
63
  <input type="text" id="name" placeholder="Your name will appear here..." readonly>
@@ -65,14 +76,18 @@
65
  <label for="email">Your Email</label>
66
  <input type="text" id="email" placeholder="Your email will appear here..." readonly>
67
 
68
- <p class="info" id="infoMessage">Listening will start automatically...</p>
69
- <p class="status" id="status">Initializing...</p>
 
 
 
70
  </div>
71
 
72
  <script>
73
  let recognition;
74
  let nameCaptured = "";
75
  let emailCaptured = "";
 
76
  if ('webkitSpeechRecognition' in window) {
77
  recognition = new webkitSpeechRecognition();
78
  recognition.continuous = false;
@@ -115,13 +130,46 @@
115
  emailCaptured = event.results[0][0].transcript.trim().replace(/\bat\b/g, '@').replace(/\s+/g, '');
116
  document.getElementById('email').value = emailCaptured;
117
  recognition.stop();
118
- speak("Your registration is complete. Thank you for registering.");
119
- setTimeout(() => location.reload(), 20000);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  };
121
  }
122
  function startProcess() {
123
  speak("Welcome to Biryani Hub", function() {
124
- speak("Tell me your name, and I will confirm it with you.", startListeningForName);
 
 
125
  });
126
  }
127
  window.onload = function () {
@@ -129,4 +177,4 @@
129
  };
130
  </script>
131
  </body>
132
- </html>
 
17
  text-align: center;
18
  }
19
  .container {
20
+ background-color: #87ceeb; /* Light blue */
21
  padding: 40px 50px;
22
  border-radius: 10px;
23
  width: 400px;
 
29
  color: #ff6a00;
30
  }
31
  label {
32
+ font-size: 16px;
33
  margin-top: 20px;
34
  display: block;
35
  text-align: left;
36
+ font-weight: bold;
37
  }
38
  input[type="text"] {
39
  width: 100%;
40
+ padding: 12px;
41
  font-size: 16px;
42
+ border: 2px solid #ccc;
43
+ border-radius: 8px;
44
  margin-top: 8px;
45
+ box-sizing: border-box;
46
+ }
47
+ input[type="text"]:focus {
48
+ border-color: #ff6a00;
49
+ outline: none;
50
  }
51
  .info {
52
  margin-top: 20px;
 
59
  color: gray;
60
  margin-top: 20px;
61
  }
62
+ .image-logo {
63
+ width: 80px;
64
+ margin-bottom: 20px;
65
+ }
66
  </style>
67
  </head>
68
  <body>
69
  <div class="container">
70
+ <h1>Welcome to Biryani Hub 🍽 πŸ—</h1>
71
+
72
 
73
  <label for="name">Your Name</label>
74
  <input type="text" id="name" placeholder="Your name will appear here..." readonly>
 
76
  <label for="email">Your Email</label>
77
  <input type="text" id="email" placeholder="Your email will appear here..." readonly>
78
 
79
+ <label for="mobile">Your Mobile Number</label>
80
+ <input type="text" id="mobile" placeholder="Your mobile number will appear here..." readonly>
81
+
82
+ <p class="info" id="infoMessage">Listening πŸ—£πŸŽ™οΈ...</p>
83
+ <p class="status" id="status">πŸ”Š...</p>
84
  </div>
85
 
86
  <script>
87
  let recognition;
88
  let nameCaptured = "";
89
  let emailCaptured = "";
90
+ let mobileCaptured = "";
91
  if ('webkitSpeechRecognition' in window) {
92
  recognition = new webkitSpeechRecognition();
93
  recognition.continuous = false;
 
130
  emailCaptured = event.results[0][0].transcript.trim().replace(/\bat\b/g, '@').replace(/\s+/g, '');
131
  document.getElementById('email').value = emailCaptured;
132
  recognition.stop();
133
+ speak("You said " + emailCaptured + ". Is it correct?", function() {
134
+ recognition.start();
135
+ recognition.onresult = function(event) {
136
+ let confirmation = event.results[0][0].transcript.trim().toLowerCase();
137
+ recognition.stop();
138
+ if (confirmation.includes("ok") || confirmation.includes("yes")) {
139
+ setTimeout(() => speak("Great! Now, tell me your mobile number.", startListeningForMobile), 500);
140
+ } else {
141
+ speak("Let's try again. Tell me your email.", startListeningForEmail);
142
+ }
143
+ };
144
+ });
145
+ };
146
+ }
147
+ function startListeningForMobile() {
148
+ recognition.start();
149
+ recognition.onresult = function(event) {
150
+ mobileCaptured = event.results[0][0].transcript.trim().replace(/\s+/g, '');
151
+ document.getElementById('mobile').value = mobileCaptured;
152
+ recognition.stop();
153
+ speak("You said " + mobileCaptured + ". Is it correct?", function() {
154
+ recognition.start();
155
+ recognition.onresult = function(event) {
156
+ let confirmation = event.results[0][0].transcript.trim().toLowerCase();
157
+ recognition.stop();
158
+ if (confirmation.includes("ok") || confirmation.includes("yes")) {
159
+ speak("Your registration is complete. Thank you for registering.");
160
+ setTimeout(() => location.reload(), 20000);
161
+ } else {
162
+ speak("Let's try again. Tell me your mobile number.", startListeningForMobile);
163
+ }
164
+ };
165
+ });
166
  };
167
  }
168
  function startProcess() {
169
  speak("Welcome to Biryani Hub", function() {
170
+ speak("Tell me your name, and I will confirm it with you.", function() {
171
+ setTimeout(startListeningForName, 500);
172
+ });
173
  });
174
  }
175
  window.onload = function () {
 
177
  };
178
  </script>
179
  </body>
180
+ </html>