lokesh341 commited on
Commit
a92c97e
·
verified ·
1 Parent(s): a3b71ca

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +7 -7
templates/index.html CHANGED
@@ -60,15 +60,15 @@
60
  <h1>Biryani Hub</h1>
61
 
62
  <!-- Name Input Field -->
63
- <label for="name">Name:</label>
64
  <input type="text" id="name" placeholder="Your name will appear here..." readonly>
65
 
66
  <!-- Email Input Field -->
67
- <label for="email">Email:</label>
68
  <input type="text" id="email" placeholder="Your email will appear here..." readonly>
69
 
70
  <!-- Info Message for Listening -->
71
- <p class="info">Listening will start automatically...</p>
72
 
73
  <!-- Status Message -->
74
  <p class="status" id="status">Initializing...</p>
@@ -89,19 +89,20 @@
89
  alert("Speech Recognition API is not supported in this browser.");
90
  }
91
 
92
- // Function to make the welcome message speak automatically when the page loads
93
  function welcomeMessage() {
94
  const welcomeMsg = "Welcome to Biryani Hub. Please say your name after the beep.";
95
  const speech = new SpeechSynthesisUtterance(welcomeMsg);
96
  window.speechSynthesis.speak(speech);
97
  }
98
 
99
- // Function to handle starting the listening process after the welcome message
100
  function startListening() {
101
  const status = document.getElementById('status');
102
  const nameInput = document.getElementById('name');
103
  const emailInput = document.getElementById('email');
104
 
 
105
  status.textContent = 'Listening for your name...';
106
  recognition.start(); // Start voice recognition
107
 
@@ -134,7 +135,7 @@
134
  };
135
  }
136
 
137
- // Make sure to start listening as soon as the page loads
138
  window.onload = function () {
139
  welcomeMessage(); // Automatically say the welcome message
140
  setTimeout(startListening, 5000); // Start listening after the welcome message
@@ -142,4 +143,3 @@
142
  </script>
143
  </body>
144
  </html>
145
-
 
60
  <h1>Biryani Hub</h1>
61
 
62
  <!-- Name Input Field -->
63
+ <label for="name">Your Name</label>
64
  <input type="text" id="name" placeholder="Your name will appear here..." readonly>
65
 
66
  <!-- Email Input Field -->
67
+ <label for="email">Your Email</label>
68
  <input type="text" id="email" placeholder="Your email will appear here..." readonly>
69
 
70
  <!-- Info Message for Listening -->
71
+ <p class="info" id="infoMessage">Listening will start automatically...</p>
72
 
73
  <!-- Status Message -->
74
  <p class="status" id="status">Initializing...</p>
 
89
  alert("Speech Recognition API is not supported in this browser.");
90
  }
91
 
92
+ // Function to speak the welcome message automatically when the page loads
93
  function welcomeMessage() {
94
  const welcomeMsg = "Welcome to Biryani Hub. Please say your name after the beep.";
95
  const speech = new SpeechSynthesisUtterance(welcomeMsg);
96
  window.speechSynthesis.speak(speech);
97
  }
98
 
99
+ // Function to start listening after the welcome message
100
  function startListening() {
101
  const status = document.getElementById('status');
102
  const nameInput = document.getElementById('name');
103
  const emailInput = document.getElementById('email');
104
 
105
+ // Change status to indicate that we're listening for the name
106
  status.textContent = 'Listening for your name...';
107
  recognition.start(); // Start voice recognition
108
 
 
135
  };
136
  }
137
 
138
+ // Start the process when the page is loaded
139
  window.onload = function () {
140
  welcomeMessage(); // Automatically say the welcome message
141
  setTimeout(startListening, 5000); // Start listening after the welcome message
 
143
  </script>
144
  </body>
145
  </html>