Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +101 -72
templates/index.html
CHANGED
@@ -4,101 +4,130 @@
|
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>Biryani Hub Registration</title>
|
7 |
-
<link
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
|
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 |
-
body: formData
|
60 |
-
});
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
65 |
|
66 |
-
|
|
|
|
|
67 |
const status = document.getElementById('status');
|
68 |
const nameInput = document.getElementById('name');
|
69 |
const emailInput = document.getElementById('email');
|
70 |
|
71 |
status.textContent = 'Playing welcome message...';
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
const nameAudio = await recordAudio();
|
79 |
-
const nameText = await transcribeAudio(nameAudio);
|
80 |
-
nameInput.value = nameText;
|
81 |
-
|
82 |
-
status.textContent = 'Asking for your email...';
|
83 |
-
await playAudio('{{ url_for("static", filename="ask_email.mp3") }}');
|
84 |
-
|
85 |
-
status.textContent = 'Listening for your email...';
|
86 |
-
const emailAudio = await recordAudio();
|
87 |
-
const emailText = await transcribeAudio(emailAudio);
|
88 |
-
emailInput.value = emailText;
|
89 |
-
|
90 |
-
status.textContent = 'Playing thank you message...';
|
91 |
-
await playAudio('{{ url_for("static", filename="thank_you.mp3") }}');
|
92 |
-
|
93 |
-
status.textContent = 'Registration complete.';
|
94 |
|
95 |
-
//
|
96 |
setTimeout(() => {
|
97 |
-
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
-
|
102 |
</script>
|
103 |
</body>
|
104 |
</html>
|
|
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>Biryani Hub Registration</title>
|
7 |
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
|
8 |
+
<style>
|
9 |
+
body {
|
10 |
+
font-family: 'Roboto', sans-serif;
|
11 |
+
background: linear-gradient(135deg, #f4c542, #ff8f6a); /* Light gradient background */
|
12 |
+
margin: 0;
|
13 |
+
display: flex;
|
14 |
+
justify-content: center;
|
15 |
+
align-items: center;
|
16 |
+
height: 100vh;
|
17 |
+
text-align: center;
|
18 |
+
}
|
19 |
|
20 |
+
.container {
|
21 |
+
background: white;
|
22 |
+
padding: 40px 50px;
|
23 |
+
border-radius: 10px;
|
24 |
+
width: 400px;
|
25 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
26 |
+
}
|
27 |
|
28 |
+
h1 {
|
29 |
+
font-size: 30px;
|
30 |
+
font-weight: bold;
|
31 |
+
color: #ff6a00; /* Bright orange for title */
|
32 |
+
}
|
33 |
|
34 |
+
label {
|
35 |
+
font-size: 18px;
|
36 |
+
margin-top: 20px;
|
37 |
+
display: block;
|
38 |
+
text-align: left;
|
39 |
+
}
|
40 |
|
41 |
+
input[type="text"] {
|
42 |
+
width: 100%;
|
43 |
+
padding: 10px;
|
44 |
+
font-size: 16px;
|
45 |
+
border: 1px solid #ccc;
|
46 |
+
border-radius: 5px;
|
47 |
+
margin-top: 8px;
|
|
|
48 |
}
|
49 |
|
50 |
+
.info {
|
51 |
+
margin-top: 20px;
|
52 |
+
font-size: 16px;
|
53 |
+
color: #ff6a00;
|
54 |
+
font-weight: bold;
|
55 |
+
}
|
56 |
|
57 |
+
.btn {
|
58 |
+
margin-top: 30px;
|
59 |
+
padding: 12px;
|
60 |
+
background-color: #ff6a00;
|
61 |
+
color: white;
|
62 |
+
font-size: 18px;
|
63 |
+
font-weight: bold;
|
64 |
+
border: none;
|
65 |
+
border-radius: 5px;
|
66 |
+
cursor: pointer;
|
67 |
+
transition: background-color 0.3s;
|
68 |
+
}
|
69 |
|
70 |
+
.btn:hover {
|
71 |
+
background-color: #ff5500;
|
72 |
+
}
|
|
|
73 |
|
74 |
+
.status {
|
75 |
+
font-size: 14px;
|
76 |
+
color: gray;
|
77 |
+
margin-top: 20px;
|
78 |
}
|
79 |
+
</style>
|
80 |
+
</head>
|
81 |
+
<body>
|
82 |
+
<div class="container">
|
83 |
+
<h1>Biryani Hub</h1>
|
84 |
+
|
85 |
+
<!-- Name Input Field -->
|
86 |
+
<label for="name">Name:</label>
|
87 |
+
<input type="text" id="name" placeholder="Your name will appear here..." readonly>
|
88 |
|
89 |
+
<!-- Email Input Field -->
|
90 |
+
<label for="email">Email:</label>
|
91 |
+
<input type="text" id="email" placeholder="Your email will appear here..." readonly>
|
92 |
|
93 |
+
<!-- Info Message for Listening -->
|
94 |
+
<p class="info">Listening will start automatically...</p>
|
|
|
|
|
95 |
|
96 |
+
<!-- Welcome Button -->
|
97 |
+
<button class="btn" id="startListeningBtn">Welcome to Biryani Hub</button>
|
98 |
+
|
99 |
+
<!-- Status Message -->
|
100 |
+
<p class="status" id="status">Initializing...</p>
|
101 |
+
</div>
|
102 |
|
103 |
+
<script>
|
104 |
+
// This function simulates the speech recognition and fills in the fields after listening
|
105 |
+
async function startListening() {
|
106 |
const status = document.getElementById('status');
|
107 |
const nameInput = document.getElementById('name');
|
108 |
const emailInput = document.getElementById('email');
|
109 |
|
110 |
status.textContent = 'Playing welcome message...';
|
111 |
+
|
112 |
+
// Simulate listening for name
|
113 |
+
setTimeout(() => {
|
114 |
+
nameInput.value = "John Doe"; // Simulated name input from voice
|
115 |
+
status.textContent = 'Listening for your email...';
|
116 |
+
}, 5000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
+
// Simulate listening for email after 5 seconds
|
119 |
setTimeout(() => {
|
120 |
+
emailInput.value = "[email protected]"; // Simulated email input from voice
|
121 |
+
status.textContent = 'Registration complete.';
|
122 |
+
|
123 |
+
// Auto refresh after 15 seconds
|
124 |
+
setTimeout(() => {
|
125 |
+
location.reload();
|
126 |
+
}, 15000); // 15 seconds auto-refresh
|
127 |
+
}, 10000);
|
128 |
}
|
129 |
|
130 |
+
document.getElementById('startListeningBtn').addEventListener('click', startListening);
|
131 |
</script>
|
132 |
</body>
|
133 |
</html>
|