Update templates/index.html
Browse files- templates/index.html +9 -40
templates/index.html
CHANGED
@@ -4,8 +4,9 @@
|
|
4 |
<head>
|
5 |
<meta charset="UTF-8">
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
-
<title>Biryani Hub
|
8 |
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
|
|
|
9 |
<style>
|
10 |
body {
|
11 |
font-family: 'Roboto', sans-serif;
|
@@ -18,11 +19,12 @@
|
|
18 |
text-align: center;
|
19 |
}
|
20 |
.container {
|
21 |
-
background-color: #fff;
|
22 |
padding: 40px 50px;
|
23 |
border-radius: 10px;
|
24 |
width: 450px;
|
25 |
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
|
|
26 |
}
|
27 |
h1 {
|
28 |
font-size: 30px;
|
@@ -85,11 +87,11 @@
|
|
85 |
<body>
|
86 |
<div class="container">
|
87 |
<h1>Welcome to Biryani Hub 🍽 🍗</h1>
|
88 |
-
|
89 |
<!-- Form Section -->
|
90 |
<div class="form-container">
|
91 |
<!-- Registration Form -->
|
92 |
-
<div class="form-section" id="registrationForm" style="display:
|
93 |
<h2 class="header">Register</h2>
|
94 |
<label for="name">Your Name</label>
|
95 |
<input type="text" id="name" placeholder="Your name will appear here..." readonly>
|
@@ -140,7 +142,7 @@
|
|
140 |
window.speechSynthesis.speak(speech);
|
141 |
}
|
142 |
|
143 |
-
//
|
144 |
function askLoginOrRegister() {
|
145 |
speak("Are you a new customer or an existing customer? Say 'new' for registration or 'existing' for login.", function() {
|
146 |
recognition.start();
|
@@ -235,47 +237,14 @@
|
|
235 |
let confirmation = event.results[0][0].transcript.trim().toLowerCase();
|
236 |
recognition.stop();
|
237 |
if (confirmation.includes("ok")) {
|
238 |
-
|
239 |
} else {
|
240 |
speak("Let's try again. Tell me your mobile number.", startListeningForMobile);
|
241 |
}
|
242 |
};
|
243 |
}
|
244 |
|
245 |
-
//
|
246 |
-
function autoConfirm() {
|
247 |
-
document.getElementById('confirmName').textContent = document.getElementById('name').value;
|
248 |
-
document.getElementById('confirmEmail').textContent = document.getElementById('email').value;
|
249 |
-
document.getElementById('confirmPhone').textContent = document.getElementById('mobile').value;
|
250 |
-
document.getElementById('confirmation').style.display = 'block';
|
251 |
-
setTimeout(autoSubmit, 3000);
|
252 |
-
}
|
253 |
-
|
254 |
-
// Submit details to backend
|
255 |
-
function autoSubmit() {
|
256 |
-
var name = document.getElementById('name').value;
|
257 |
-
var email = document.getElementById('email').value;
|
258 |
-
var phone = document.getElementById('mobile').value;
|
259 |
-
fetch('/submit', {
|
260 |
-
method: 'POST',
|
261 |
-
headers: { 'Content-Type': 'application/json' },
|
262 |
-
body: JSON.stringify({ name: name, email: email, phone: phone })
|
263 |
-
})
|
264 |
-
.then(response => response.json())
|
265 |
-
.then(data => {
|
266 |
-
if (data.success) {
|
267 |
-
document.getElementById('status').textContent = 'Your details were submitted successfully!';
|
268 |
-
document.getElementById('confirmation').style.display = 'none';
|
269 |
-
speak("Your registration is complete. Thank you for registering.");
|
270 |
-
setTimeout(() => location.reload(), 5000);
|
271 |
-
} else {
|
272 |
-
document.getElementById('status').textContent = 'There was an error submitting your details.';
|
273 |
-
speak("There was an error submitting your details. Please try again.");
|
274 |
-
}
|
275 |
-
});
|
276 |
-
}
|
277 |
-
|
278 |
-
// Start login process
|
279 |
function startListeningForLoginEmail() {
|
280 |
recognition.start();
|
281 |
recognition.onresult = function(event) {
|
|
|
4 |
<head>
|
5 |
<meta charset="UTF-8">
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<title>Biryani Hub Login & Registration</title>
|
8 |
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
|
9 |
+
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
|
10 |
<style>
|
11 |
body {
|
12 |
font-family: 'Roboto', sans-serif;
|
|
|
19 |
text-align: center;
|
20 |
}
|
21 |
.container {
|
22 |
+
background-color: #fff; /* White background for contrast */
|
23 |
padding: 40px 50px;
|
24 |
border-radius: 10px;
|
25 |
width: 450px;
|
26 |
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
27 |
+
margin-right: 20px;
|
28 |
}
|
29 |
h1 {
|
30 |
font-size: 30px;
|
|
|
87 |
<body>
|
88 |
<div class="container">
|
89 |
<h1>Welcome to Biryani Hub 🍽 🍗</h1>
|
90 |
+
|
91 |
<!-- Form Section -->
|
92 |
<div class="form-container">
|
93 |
<!-- Registration Form -->
|
94 |
+
<div class="form-section" id="registrationForm" style="display: block;">
|
95 |
<h2 class="header">Register</h2>
|
96 |
<label for="name">Your Name</label>
|
97 |
<input type="text" id="name" placeholder="Your name will appear here..." readonly>
|
|
|
142 |
window.speechSynthesis.speak(speech);
|
143 |
}
|
144 |
|
145 |
+
// Start by asking if the user is a new or existing customer
|
146 |
function askLoginOrRegister() {
|
147 |
speak("Are you a new customer or an existing customer? Say 'new' for registration or 'existing' for login.", function() {
|
148 |
recognition.start();
|
|
|
237 |
let confirmation = event.results[0][0].transcript.trim().toLowerCase();
|
238 |
recognition.stop();
|
239 |
if (confirmation.includes("ok")) {
|
240 |
+
submitRegistration();
|
241 |
} else {
|
242 |
speak("Let's try again. Tell me your mobile number.", startListeningForMobile);
|
243 |
}
|
244 |
};
|
245 |
}
|
246 |
|
247 |
+
// Start login process (similar to registration process but only email and phone)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
function startListeningForLoginEmail() {
|
249 |
recognition.start();
|
250 |
recognition.onresult = function(event) {
|