Swathi6 commited on
Commit
8e19799
·
verified ·
1 Parent(s): 732b770

Create templates/signup.html

Browse files
Files changed (1) hide show
  1. templates/signup.html +140 -0
templates/signup.html ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Signup</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ background: linear-gradient(to right, #6a11cb, #2575fc);
11
+ margin: 0;
12
+ display: flex;
13
+ justify-content: center;
14
+ align-items: center;
15
+ height: 100vh;
16
+ color: #fff;
17
+ }
18
+ .form-container {
19
+ background: #ffffff;
20
+ padding: 20px 30px;
21
+ border-radius: 10px;
22
+ width: 100%;
23
+ max-width: 400px;
24
+ text-align: center;
25
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
26
+ color: #333;
27
+ }
28
+ .form-container h2 {
29
+ margin-bottom: 20px;
30
+ color: #333;
31
+ }
32
+ .form-container label {
33
+ display: block;
34
+ text-align: left;
35
+ margin: 10px 0 5px;
36
+ }
37
+ .form-container input {
38
+ width: 100%;
39
+ padding: 10px;
40
+ margin-bottom: 15px;
41
+ border: 1px solid #ccc;
42
+ border-radius: 5px;
43
+ }
44
+ .form-container button {
45
+ width: 100%;
46
+ padding: 10px;
47
+ background-color: #6a11cb;
48
+ color: #fff;
49
+ border: none;
50
+ border-radius: 5px;
51
+ font-size: 16px;
52
+ cursor: pointer;
53
+ }
54
+ .form-container button:hover {
55
+ background-color: #2575fc;
56
+ }
57
+ .form-container p {
58
+ margin-top: 10px;
59
+ }
60
+ .form-container a {
61
+ color: #6a11cb;
62
+ text-decoration: none;
63
+ }
64
+ .form-container a:hover {
65
+ text-decoration: underline;
66
+ }
67
+ .error-message {
68
+ color: red;
69
+ margin-top: 10px;
70
+ }
71
+ </style>
72
+ </head>
73
+ <body>
74
+ <div class="form-container">
75
+ <h2>Signup</h2>
76
+ <form action="/signup" method="POST">
77
+ <label for="name">Name:</label>
78
+ <input type="text" id="name" name="name" placeholder="Enter your name" required>
79
+
80
+ <label for="phone">Phone:</label>
81
+ <input type="text" id="phone" name="phone" placeholder="Enter your phone number" required>
82
+
83
+ <label for="email">Email:</label>
84
+ <input type="email" id="email" name="email" placeholder="Enter your email" required>
85
+
86
+ <label for="password">Password:</label>
87
+ <input type="password" id="password" name="password" placeholder="Enter your password" required>
88
+ <label for="referral">Referral Code:</label>
89
+ <input type="text" id="referral" name="referral" placeholder="Enter referral code (optional)">
90
+
91
+ <button type="submit">Sign Up</button>
92
+ </form>
93
+ <p>Already have an account? <a href="/login">Login</a></p>
94
+ {% if error %}
95
+ <p class="error-message">{{ error }}</p>
96
+ {% endif %}
97
+ </div>
98
+
99
+ <script>
100
+ function sendOTP() {
101
+ const phone = document.getElementById('phone-number').value;
102
+ fetch('/send_otp', {
103
+ method: 'POST',
104
+ headers: { 'Content-Type': 'application/json' },
105
+ body: JSON.stringify({ phone })
106
+ })
107
+ .then(response => response.json())
108
+ .then(data => {
109
+ if (data.success) {
110
+ alert(data.message);
111
+ } else {
112
+ alert('Error sending OTP: ' + (data.error || 'Unknown error'));
113
+ }
114
+ })
115
+ .catch(error => console.error('Error:', error));
116
+ }
117
+
118
+ function verifyOTP() {
119
+ const phone = document.getElementById('phone').value;
120
+ const otp = document.getElementById('otp').value;
121
+
122
+ fetch('/verify_otp', {
123
+ method: 'POST',
124
+ headers: { 'Content-Type': 'application/json' },
125
+ body: JSON.stringify({ phone, otp })
126
+ })
127
+ .then(response => response.json())
128
+ .then(data => {
129
+ if (data.success) {
130
+ alert(data.message);
131
+ } else {
132
+ alert(data.error);
133
+ }
134
+ })
135
+ .catch(error => console.error('Error:', error));
136
+ }
137
+ </script>
138
+
139
+ </body>
140
+ </html>