Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +69 -64
templates/index.html
CHANGED
@@ -11,67 +11,66 @@
|
|
11 |
|
12 |
<style>
|
13 |
body {
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
<body>
|
73 |
<div class="container">
|
74 |
-
|
75 |
<h1>Welcome to Biryani Hub 🍽 🍗</h1>
|
76 |
|
77 |
<label for="name">Your Name</label>
|
@@ -99,6 +98,7 @@
|
|
99 |
let nameCaptured = "";
|
100 |
let emailCaptured = "";
|
101 |
let mobileCaptured = "";
|
|
|
102 |
if ('webkitSpeechRecognition' in window) {
|
103 |
recognition = new webkitSpeechRecognition();
|
104 |
recognition.continuous = false;
|
@@ -107,11 +107,13 @@
|
|
107 |
} else {
|
108 |
alert("Speech Recognition API is not supported in this browser.");
|
109 |
}
|
|
|
110 |
function speak(text, callback) {
|
111 |
const speech = new SpeechSynthesisUtterance(text);
|
112 |
speech.onend = callback;
|
113 |
window.speechSynthesis.speak(speech);
|
114 |
}
|
|
|
115 |
function startListeningForName() {
|
116 |
recognition.start();
|
117 |
recognition.onresult = function(event) {
|
@@ -121,6 +123,7 @@
|
|
121 |
setTimeout(confirmName, 500);
|
122 |
};
|
123 |
}
|
|
|
124 |
function confirmName() {
|
125 |
speak("You said " + nameCaptured + ". Is it okay, or do you want to change it?", function() {
|
126 |
recognition.start();
|
@@ -135,6 +138,7 @@
|
|
135 |
};
|
136 |
});
|
137 |
}
|
|
|
138 |
function startListeningForEmail() {
|
139 |
recognition.start();
|
140 |
recognition.onresult = function(event) {
|
@@ -155,6 +159,7 @@
|
|
155 |
});
|
156 |
};
|
157 |
}
|
|
|
158 |
function startListeningForMobile() {
|
159 |
recognition.start();
|
160 |
recognition.onresult = function(event) {
|
@@ -177,6 +182,7 @@
|
|
177 |
});
|
178 |
};
|
179 |
}
|
|
|
180 |
function autoConfirm() {
|
181 |
document.getElementById('confirmName').textContent = document.getElementById('name').value;
|
182 |
document.getElementById('confirmEmail').textContent = document.getElementById('email').value;
|
@@ -184,6 +190,7 @@
|
|
184 |
document.getElementById('confirmation').style.display = 'block';
|
185 |
setTimeout(autoSubmit, 3000);
|
186 |
}
|
|
|
187 |
function autoSubmit() {
|
188 |
var name = document.getElementById('name').value;
|
189 |
var email = document.getElementById('email').value;
|
@@ -206,13 +213,11 @@
|
|
206 |
}
|
207 |
});
|
208 |
}
|
|
|
209 |
window.onload = function () {
|
210 |
-
|
211 |
-
|
212 |
-
setTimeout(startListeningForName, 5000);
|
213 |
};
|
214 |
</script>
|
215 |
</body>
|
216 |
</html>
|
217 |
-
|
218 |
-
|
|
|
11 |
|
12 |
<style>
|
13 |
body {
|
14 |
+
font-family: 'Roboto', sans-serif;
|
15 |
+
background: linear-gradient(135deg, #f4c542, #ff8f6a);
|
16 |
+
margin: 0;
|
17 |
+
display: flex;
|
18 |
+
justify-content: center;
|
19 |
+
align-items: center;
|
20 |
+
height: 100vh;
|
21 |
+
text-align: center;
|
22 |
+
}
|
23 |
+
.container {
|
24 |
+
background-color: #87ceeb; /* Light blue */
|
25 |
+
padding: 40px 50px;
|
26 |
+
border-radius: 10px;
|
27 |
+
width: 400px;
|
28 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
29 |
+
}
|
30 |
+
h1 {
|
31 |
+
font-size: 30px;
|
32 |
+
font-weight: bold;
|
33 |
+
color: #ff6a00;
|
34 |
+
}
|
35 |
+
label {
|
36 |
+
font-size: 16px;
|
37 |
+
margin-top: 20px;
|
38 |
+
display: block;
|
39 |
+
text-align: left;
|
40 |
+
font-weight: bold;
|
41 |
+
}
|
42 |
+
input[type="text"] {
|
43 |
+
width: 100%;
|
44 |
+
padding: 12px;
|
45 |
+
font-size: 16px;
|
46 |
+
border: 2px solid #ccc;
|
47 |
+
border-radius: 8px;
|
48 |
+
margin-top: 8px;
|
49 |
+
box-sizing: border-box;
|
50 |
+
}
|
51 |
+
input[type="text"]:focus {
|
52 |
+
border-color: #ff6a00;
|
53 |
+
outline: none;
|
54 |
+
}
|
55 |
+
.info {
|
56 |
+
margin-top: 20px;
|
57 |
+
font-size: 16px;
|
58 |
+
color: #ff6a00;
|
59 |
+
font-weight: bold;
|
60 |
+
}
|
61 |
+
.status {
|
62 |
+
font-size: 14px;
|
63 |
+
color: gray;
|
64 |
+
margin-top: 20px;
|
65 |
+
}
|
66 |
+
.image-logo {
|
67 |
+
width: 80px;
|
68 |
+
margin-bottom: 20px;
|
69 |
+
}
|
70 |
+
</style>
|
71 |
+
|
72 |
<body>
|
73 |
<div class="container">
|
|
|
74 |
<h1>Welcome to Biryani Hub 🍽 🍗</h1>
|
75 |
|
76 |
<label for="name">Your Name</label>
|
|
|
98 |
let nameCaptured = "";
|
99 |
let emailCaptured = "";
|
100 |
let mobileCaptured = "";
|
101 |
+
|
102 |
if ('webkitSpeechRecognition' in window) {
|
103 |
recognition = new webkitSpeechRecognition();
|
104 |
recognition.continuous = false;
|
|
|
107 |
} else {
|
108 |
alert("Speech Recognition API is not supported in this browser.");
|
109 |
}
|
110 |
+
|
111 |
function speak(text, callback) {
|
112 |
const speech = new SpeechSynthesisUtterance(text);
|
113 |
speech.onend = callback;
|
114 |
window.speechSynthesis.speak(speech);
|
115 |
}
|
116 |
+
|
117 |
function startListeningForName() {
|
118 |
recognition.start();
|
119 |
recognition.onresult = function(event) {
|
|
|
123 |
setTimeout(confirmName, 500);
|
124 |
};
|
125 |
}
|
126 |
+
|
127 |
function confirmName() {
|
128 |
speak("You said " + nameCaptured + ". Is it okay, or do you want to change it?", function() {
|
129 |
recognition.start();
|
|
|
138 |
};
|
139 |
});
|
140 |
}
|
141 |
+
|
142 |
function startListeningForEmail() {
|
143 |
recognition.start();
|
144 |
recognition.onresult = function(event) {
|
|
|
159 |
});
|
160 |
};
|
161 |
}
|
162 |
+
|
163 |
function startListeningForMobile() {
|
164 |
recognition.start();
|
165 |
recognition.onresult = function(event) {
|
|
|
182 |
});
|
183 |
};
|
184 |
}
|
185 |
+
|
186 |
function autoConfirm() {
|
187 |
document.getElementById('confirmName').textContent = document.getElementById('name').value;
|
188 |
document.getElementById('confirmEmail').textContent = document.getElementById('email').value;
|
|
|
190 |
document.getElementById('confirmation').style.display = 'block';
|
191 |
setTimeout(autoSubmit, 3000);
|
192 |
}
|
193 |
+
|
194 |
function autoSubmit() {
|
195 |
var name = document.getElementById('name').value;
|
196 |
var email = document.getElementById('email').value;
|
|
|
213 |
}
|
214 |
});
|
215 |
}
|
216 |
+
|
217 |
window.onload = function () {
|
218 |
+
speak("Welcome to Biryani Hub. Please tell me your name to start the registration.");
|
219 |
+
setTimeout(startListeningForName, 5000);
|
|
|
220 |
};
|
221 |
</script>
|
222 |
</body>
|
223 |
</html>
|
|
|
|