Spaces:
Running
Running
Update templates/index.html
Browse files- templates/index.html +78 -23
templates/index.html
CHANGED
@@ -49,6 +49,17 @@
|
|
49 |
border-color: #ff6a00;
|
50 |
outline: none;
|
51 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
.confirm-button, .switch-button {
|
53 |
padding: 10px 20px;
|
54 |
background-color: #ff6a00;
|
@@ -61,48 +72,92 @@
|
|
61 |
.confirm-button:hover, .switch-button:hover {
|
62 |
background-color: #e65e00;
|
63 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
</style>
|
65 |
</head>
|
66 |
<body>
|
67 |
<div class="container" id="welcomePage">
|
68 |
<h1>Welcome to Biriyani Hub 🍽</h1>
|
69 |
-
<h2>Welcome! Are you a new customer or an existing one?</h2>
|
70 |
-
<p>🔊 Please say 'new' to register or 'existing' to login.</p>
|
71 |
</div>
|
72 |
|
73 |
<div class="container" id="registrationForm" style="display: none;">
|
74 |
<h2>Register</h2>
|
75 |
-
<
|
76 |
-
|
77 |
-
<input type="text" id="name" name="name" required>
|
78 |
|
79 |
-
|
80 |
-
|
81 |
|
82 |
-
|
83 |
-
|
84 |
|
85 |
-
|
86 |
-
|
87 |
|
88 |
-
|
89 |
-
</form>
|
90 |
</div>
|
91 |
|
92 |
<div class="container" id="loginForm" style="display: none;">
|
93 |
<h2>Login</h2>
|
94 |
-
<
|
95 |
-
|
96 |
-
|
|
|
|
|
97 |
|
98 |
-
|
99 |
-
|
100 |
|
101 |
-
|
102 |
-
|
103 |
|
104 |
-
|
105 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
</body>
|
108 |
-
</html>
|
|
|
49 |
border-color: #ff6a00;
|
50 |
outline: none;
|
51 |
}
|
52 |
+
.info {
|
53 |
+
font-size: 16px;
|
54 |
+
color: #ff6a00;
|
55 |
+
font-weight: bold;
|
56 |
+
margin-top: 10px;
|
57 |
+
}
|
58 |
+
.status {
|
59 |
+
font-size: 14px;
|
60 |
+
color: gray;
|
61 |
+
margin-top: 10px;
|
62 |
+
}
|
63 |
.confirm-button, .switch-button {
|
64 |
padding: 10px 20px;
|
65 |
background-color: #ff6a00;
|
|
|
72 |
.confirm-button:hover, .switch-button:hover {
|
73 |
background-color: #e65e00;
|
74 |
}
|
75 |
+
.confirm-details {
|
76 |
+
margin-top: 20px;
|
77 |
+
font-size: 18px;
|
78 |
+
font-weight: bold;
|
79 |
+
color: #333;
|
80 |
+
}
|
81 |
+
.details {
|
82 |
+
font-size: 16px;
|
83 |
+
margin: 5px 0;
|
84 |
+
}
|
85 |
</style>
|
86 |
</head>
|
87 |
<body>
|
88 |
<div class="container" id="welcomePage">
|
89 |
<h1>Welcome to Biriyani Hub 🍽</h1>
|
90 |
+
<h2 class="info" id="infoMessage">Welcome! Are you a new customer or an existing one?</h2>
|
91 |
+
<p class="status" id="status">🔊 Please say 'new' to register or 'existing' to login.</p>
|
92 |
</div>
|
93 |
|
94 |
<div class="container" id="registrationForm" style="display: none;">
|
95 |
<h2>Register</h2>
|
96 |
+
<label for="name">Your Name</label>
|
97 |
+
<input type="text" id="name" placeholder="Listening for name..." readonly>
|
|
|
98 |
|
99 |
+
<label for="email">Your Email</label>
|
100 |
+
<input type="text" id="email" placeholder="Listening for email..." readonly>
|
101 |
|
102 |
+
<label for="mobile">Your Mobile Number</label>
|
103 |
+
<input type="text" id="mobile" placeholder="Listening for mobile number..." readonly>
|
104 |
|
105 |
+
<label for="password">Your Password</label>
|
106 |
+
<input type="password" id="password" placeholder="Listening for password..." readonly>
|
107 |
|
108 |
+
<p class="status" id="registrationStatus">Listening... 🗣</p>
|
|
|
109 |
</div>
|
110 |
|
111 |
<div class="container" id="loginForm" style="display: none;">
|
112 |
<h2>Login</h2>
|
113 |
+
<label for="loginEmail">Your Email</label>
|
114 |
+
<input type="text" id="loginEmail" placeholder="Listening for email..." readonly>
|
115 |
+
|
116 |
+
<label for="loginMobile">Your Mobile Number</label>
|
117 |
+
<input type="text" id="loginMobile" placeholder="Listening for mobile number..." readonly>
|
118 |
|
119 |
+
<label for="loginPassword">Your Password</label>
|
120 |
+
<input type="password" id="loginPassword" placeholder="Listening for password..." readonly>
|
121 |
|
122 |
+
<p class="status" id="loginStatus">Listening... 🗣</p>
|
123 |
+
</div>
|
124 |
|
125 |
+
<div class="container" id="confirmationPage" style="display: none;">
|
126 |
+
<h2>Confirm Your Details</h2>
|
127 |
+
<div class="confirm-details">
|
128 |
+
<p class="details"><strong>Name:</strong> <span id="confirmName"></span></p>
|
129 |
+
<p class="details"><strong>Email:</strong> <span id="confirmEmail"></span></p>
|
130 |
+
<p class="details"><strong>Phone:</strong> <span id="confirmPhone"></span></p>
|
131 |
+
<p class="details"><strong>Password:</strong> <span id="confirmPassword"></span></p>
|
132 |
+
</div>
|
133 |
+
<button class="confirm-button" onclick="submitRegistration()">Confirm & Submit</button>
|
134 |
</div>
|
135 |
+
|
136 |
+
<script>
|
137 |
+
function submitRegistration() {
|
138 |
+
const name = document.getElementById('name').value;
|
139 |
+
const email = document.getElementById('email').value;
|
140 |
+
const phone = document.getElementById('mobile').value;
|
141 |
+
const password = document.getElementById('password').value;
|
142 |
+
|
143 |
+
fetch('/register', {
|
144 |
+
method: 'POST',
|
145 |
+
headers: { 'Content-Type': 'application/json' },
|
146 |
+
body: JSON.stringify({ name, email, phone, password })
|
147 |
+
})
|
148 |
+
.then(response => response.json())
|
149 |
+
.then(data => {
|
150 |
+
if (data.success) {
|
151 |
+
alert('Registration successful!');
|
152 |
+
window.location.reload();
|
153 |
+
} else {
|
154 |
+
alert('Error: ' + data.error);
|
155 |
+
}
|
156 |
+
})
|
157 |
+
.catch(error => {
|
158 |
+
alert('An error occurred. Please try again.');
|
159 |
+
});
|
160 |
+
}
|
161 |
+
</script>
|
162 |
</body>
|
163 |
+
</html>
|