geethareddy commited on
Commit
6c16179
·
verified ·
1 Parent(s): b501cb0

templates/signup.html

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