geethareddy commited on
Commit
9fb13a8
·
verified ·
1 Parent(s): 2160d19

Create signup.html

Browse files
Files changed (1) hide show
  1. templates/signup.html +193 -0
templates/signup.html ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Sign Up - AI Coach</title>
7
+ <style>
8
+ body {
9
+ font-family: 'Roboto', Arial, sans-serif;
10
+ margin: 0;
11
+ padding: 0;
12
+ background: linear-gradient(135deg, #f0f2f5 0%, #e9ecef 100%);
13
+ color: #2d3748;
14
+ line-height: 1.6;
15
+ display: flex;
16
+ justify-content: center;
17
+ align-items: center;
18
+ height: 100vh;
19
+ }
20
+ .signup-container {
21
+ background-color: #fff;
22
+ padding: 40px;
23
+ border-radius: 12px;
24
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
25
+ width: 100%;
26
+ max-width: 400px;
27
+ text-align: center;
28
+ }
29
+ h2 {
30
+ color: #1a3c7a;
31
+ font-size: 28px;
32
+ font-weight: 700;
33
+ margin-bottom: 20px;
34
+ }
35
+ .input-group {
36
+ margin-bottom: 20px;
37
+ text-align: left;
38
+ }
39
+ label {
40
+ display: block;
41
+ font-size: 15px;
42
+ font-weight: 500;
43
+ color: #4a5568;
44
+ margin-bottom: 8px;
45
+ }
46
+ input, select {
47
+ width: 100%;
48
+ padding: 12px;
49
+ border: 2px solid #e2e8f0;
50
+ border-radius: 8px;
51
+ font-size: 15px;
52
+ box-sizing: border-box;
53
+ transition: border-color 0.3s ease, box-shadow 0.3s ease;
54
+ }
55
+ input:focus, select:focus {
56
+ border-color: #ed8936;
57
+ outline: none;
58
+ box-shadow: 0 0 8px rgba(237, 137, 54, 0.3);
59
+ }
60
+ .checkbox-group {
61
+ display: flex;
62
+ align-items: center;
63
+ gap: 10px;
64
+ }
65
+ .checkbox-group input {
66
+ width: auto;
67
+ margin: 0;
68
+ }
69
+ button {
70
+ width: 100%;
71
+ padding: 12px;
72
+ background: linear-gradient(to right, #f6ad55, #ed8936);
73
+ color: #fff;
74
+ border: none;
75
+ border-radius: 8px;
76
+ cursor: pointer;
77
+ font-size: 16px;
78
+ font-weight: 600;
79
+ transition: transform 0.1s ease, background 0.3s ease;
80
+ }
81
+ button:hover {
82
+ background: linear-gradient(to right, #ed8936, #dd6b20);
83
+ transform: scale(1.02);
84
+ }
85
+ .login-link {
86
+ margin-top: 20px;
87
+ font-size: 14px;
88
+ color: #4a5568;
89
+ }
90
+ .login-link a {
91
+ color: #ed8936;
92
+ text-decoration: none;
93
+ font-weight: 500;
94
+ }
95
+ .login-link a:hover {
96
+ text-decoration: underline;
97
+ }
98
+ .error-message {
99
+ color: #f56565;
100
+ font-size: 14px;
101
+ margin-top: 10px;
102
+ display: none;
103
+ }
104
+ .error-message.visible {
105
+ display: block;
106
+ }
107
+ @media (max-width: 500px) {
108
+ .signup-container {
109
+ padding: 20px;
110
+ margin: 20px;
111
+ }
112
+ h2 {
113
+ font-size: 24px;
114
+ }
115
+ input, select, button {
116
+ font-size: 14px;
117
+ padding: 10px;
118
+ }
119
+ }
120
+ </style>
121
+ <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
122
+ </head>
123
+ <body>
124
+ <div class="signup-container">
125
+ <h2>AI Coach Sign Up</h2>
126
+ <div class="input-group">
127
+ <label for="username">Username</label>
128
+ <input type="text" id="username" placeholder="Enter your username">
129
+ </div>
130
+ <div class="input-group">
131
+ <label for="password">Password</label>
132
+ <input type="password" id="password" placeholder="Enter your password">
133
+ </div>
134
+ <div class="input-group">
135
+ <label for="project_id">Project ID</label>
136
+ <input type="text" id="project_id" placeholder="Enter your project ID (e.g., PROJ_001)">
137
+ </div>
138
+ <div class="input-group">
139
+ <label for="engagement_score">Engagement Score (%)</label>
140
+ <input type="number" id="engagement_score" min="0" max="100" placeholder="Enter engagement score (0-100)">
141
+ </div>
142
+ <div class="input-group checkbox-group">
143
+ <label for="kpi_flag">KPI Flag</label>
144
+ <input type="checkbox" id="kpi_flag">
145
+ </div>
146
+ <button onclick="signup()">Sign Up</button>
147
+ <p id="error-message" class="error-message"></p>
148
+ <p class="login-link">Already have an account? <a href="/login">Login here</a></p>
149
+ </div>
150
+
151
+ <script>
152
+ async function signup() {
153
+ const username = document.getElementById('username').value.trim();
154
+ const password = document.getElementById('password').value.trim();
155
+ const project_id = document.getElementById('project_id').value.trim();
156
+ const engagement_score = parseFloat(document.getElementById('engagement_score').value) || 85;
157
+ const kpi_flag = document.getElementById('kpi_flag').checked;
158
+ const errorMessage = document.getElementById('error-message');
159
+
160
+ if (!username || !password) {
161
+ errorMessage.textContent = 'Please enter both username and password.';
162
+ errorMessage.classList.add('visible');
163
+ return;
164
+ }
165
+
166
+ if (engagement_score < 0 || engagement_score > 100) {
167
+ errorMessage.textContent = 'Engagement score must be between 0 and 100.';
168
+ errorMessage.classList.add('visible');
169
+ return;
170
+ }
171
+
172
+ try {
173
+ const response = await fetch('/signup', {
174
+ method: 'POST',
175
+ headers: { 'Content-Type': 'application/json' },
176
+ body: JSON.stringify({ username, password, project_id, engagement_score, kpi_flag })
177
+ });
178
+ const result = await response.json();
179
+
180
+ if (result.status === 'success') {
181
+ window.location.href = '/';
182
+ } else {
183
+ errorMessage.textContent = result.message || 'Signup failed. Please try again.';
184
+ errorMessage.classList.add('visible');
185
+ }
186
+ } catch (error) {
187
+ errorMessage.textContent = 'Error during signup: ' + error.message;
188
+ errorMessage.classList.add('visible');
189
+ }
190
+ }
191
+ </script>
192
+ </body>
193
+ </html>