Update templates/index.html
Browse files- templates/index.html +37 -5
templates/index.html
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
<head>
|
@@ -10,7 +11,7 @@
|
|
10 |
|
11 |
<body>
|
12 |
<div class="container">
|
13 |
-
|
14 |
<h1>Welcome to Biryani Hub 🍽 🍗</h1>
|
15 |
|
16 |
<label for="name">Your Name</label>
|
@@ -116,11 +117,42 @@
|
|
116 |
});
|
117 |
};
|
118 |
}
|
119 |
-
|
120 |
-
|
121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
});
|
|
|
|
|
|
|
|
|
|
|
123 |
};
|
124 |
</script>
|
125 |
</body>
|
126 |
-
</html>
|
|
|
|
|
|
1 |
+
|
2 |
<!DOCTYPE html>
|
3 |
<html lang="en">
|
4 |
<head>
|
|
|
11 |
|
12 |
<body>
|
13 |
<div class="container">
|
14 |
+
|
15 |
<h1>Welcome to Biryani Hub 🍽 🍗</h1>
|
16 |
|
17 |
<label for="name">Your Name</label>
|
|
|
117 |
});
|
118 |
};
|
119 |
}
|
120 |
+
function autoConfirm() {
|
121 |
+
document.getElementById('confirmName').textContent = document.getElementById('name').value;
|
122 |
+
document.getElementById('confirmEmail').textContent = document.getElementById('email').value;
|
123 |
+
document.getElementById('confirmPhone').textContent = document.getElementById('mobile').value;
|
124 |
+
document.getElementById('confirmation').style.display = 'block';
|
125 |
+
setTimeout(autoSubmit, 3000);
|
126 |
+
}
|
127 |
+
function autoSubmit() {
|
128 |
+
var name = document.getElementById('name').value;
|
129 |
+
var email = document.getElementById('email').value;
|
130 |
+
var phone = document.getElementById('mobile').value;
|
131 |
+
fetch('/submit', {
|
132 |
+
method: 'POST',
|
133 |
+
headers: { 'Content-Type': 'application/json' },
|
134 |
+
body: JSON.stringify({ name: name, email: email, phone: phone })
|
135 |
+
})
|
136 |
+
.then(response => response.json())
|
137 |
+
.then(data => {
|
138 |
+
if (data.success) {
|
139 |
+
document.getElementById('status').textContent = 'Your details were submitted successfully!';
|
140 |
+
document.getElementById('confirmation').style.display = 'none';
|
141 |
+
speak("Your registration is complete. Thank you for registering.");
|
142 |
+
setTimeout(() => location.reload(), 5000);
|
143 |
+
} else {
|
144 |
+
document.getElementById('status').textContent = 'There was an error submitting your details.';
|
145 |
+
speak("There was an error submitting your details. Please try again.");
|
146 |
+
}
|
147 |
});
|
148 |
+
}
|
149 |
+
window.onload = function () {
|
150 |
+
speak("Welcome to Biryani Hub.");
|
151 |
+
|
152 |
+
setTimeout(startListeningForName, 4000);
|
153 |
};
|
154 |
</script>
|
155 |
</body>
|
156 |
+
</html>
|
157 |
+
|
158 |
+
|