lokesh341 commited on
Commit
a43603b
·
verified ·
1 Parent(s): d5bb658

Update templates/index.html

Browse files
Files changed (1) hide show
  1. 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
- <form action="/register" method="POST">
76
- <label for="name">Your Name</label>
77
- <input type="text" id="name" name="name" required>
78
 
79
- <label for="email">Your Email</label>
80
- <input type="email" id="email" name="email" required>
81
 
82
- <label for="mobile">Your Mobile Number</label>
83
- <input type="text" id="mobile" name="phone" required>
84
 
85
- <label for="password">Your Password</label>
86
- <input type="password" id="password" name="password" required>
87
 
88
- <button class="confirm-button" type="submit">Register</button>
89
- </form>
90
  </div>
91
 
92
  <div class="container" id="loginForm" style="display: none;">
93
  <h2>Login</h2>
94
- <form action="/login" method="POST">
95
- <label for="loginEmail">Your Email</label>
96
- <input type="email" id="loginEmail" name="email" required>
 
 
97
 
98
- <label for="loginMobile">Your Mobile Number</label>
99
- <input type="text" id="loginMobile" name="phone" required>
100
 
101
- <label for="loginPassword">Your Password</label>
102
- <input type="password" id="loginPassword" name="password" required>
103
 
104
- <button class="confirm-button" type="submit">Login</button>
105
- </form>
 
 
 
 
 
 
 
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>