forked from mansiruhil13/Bobble-AI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
up.html
217 lines (189 loc) · 9.16 KB
/
up.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Register & Login</title>
<link rel="stylesheet" href="src\css/up.css" />
<link rel="shortcut icon" href="ambulance.png" type="image/x-icon">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
</head>
<body>
<div class="container">
<div class="forms-container">
<div class="signin-signup">
<form action="#" class="sign-in-form">
<h2 class="title">Sign in</h2>
<div class="input-field">
<i class="fas fa-user"></i>
<input type="text" placeholder="Username" />
</div>
<div class="input-field">
<i class="fas fa-lock" id="toggle-password"></i>
<input type="password" placeholder="Password" id="password-input" />
</div>
<input type="submit" value="Login" class="btn solid" />
<p class="social-text">Or Sign in with social platforms</p>
<div class="social-media">
<a href="https://www.google.com" target="_blank" class="social-icon">
<i class="fab fa-google" style="font-size: 24px; color: #4285F4;"></i>
</a>
<a href="https://facebook.com/YourPage" target="_blank" class="social-icon">
<i class="fab fa-facebook-f" style="font-size: 24px; color: #4267B2;"></i>
</a>
<a href="https://github.com/YourGitHubProfile" target="_blank" class="social-icon">
<i class="fab fa-github" style="font-size: 24px; color: #333;"></i>
</a>
</div>
</form>
<form action="#" class="sign-up-form">
<h2 class="title">Sign up</h2>
<div class="input-field">
<i class="fas fa-user"></i>
<input type="text" placeholder="Username" />
</div>
<div class="input-field">
<i class="fas fa-envelope"></i>
<input type="email" placeholder="Email" />
</div>
<div class="input-field">
<i class="fas fa-lock" id="toggle-password-signup"></i>
<input type="password" placeholder="Password" id="password-input-signup" />
</div>
<input type="submit" class="btn" value="Sign up" />
<p class="social-text">Or Sign up with social platforms</p>
<div class="social-media">
<a href="https://www.google.com" target="_blank" class="social-icon">
<i class="fab fa-google" style="font-size: 24px; color: #4285F4;"></i>
</a>
<a href="https://facebook.com/YourPage" target="_blank" class="social-icon">
<i class="fab fa-facebook-f" style="font-size: 24px; color: #4267B2;"></i>
</a>
<a href="https://github.com/YourGitHubProfile" target="_blank" class="social-icon">
<i class="fab fa-github" style="font-size: 24px; color: #333;"></i> </a>
</div>
</form>
</div>
</div>
<div class="panels-container">
<a href="index.html" class="homeBtn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 20" width="30" height="30">
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
</svg>
</a>
<div class="panel left-panel">
<div class="content">
<h3>New here ?</h3>
<p>
Discover new experiences with AmbuFlow! <br>Get access to exclusive content and features. <br> Create your account.
</p>
<a href="index.html" class="homeBtn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox=" 0 0 24 20" width="30" height="30">
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
</svg>
</a>
<button class="btn transparent" id="sign-up-btn">
Sign up
</button>
</div>
<img src="img/log.svg" class="image" alt="" />
</div>
<div class="panel right-panel">
<div class="content">
<h3>One of us ?</h3>
<p>
Welcome to our community
</p>
<button class="btn transparent" id="sign-in-btn">
Sign in
</button>
</div>
<img src="img/register.svg" class="image" alt="" />
</div>
</div>
</div>
<script>
const sign_in_btn = document.querySelector("#sign-in-btn");
const sign_up_btn = document.querySelector("#sign-up-btn");
const container = document.querySelector(".container");
// Add sign-up-mode class to container by default
container.classList.add("sign-up-mode");
sign_up_btn.addEventListener("click", () => {
container.classList.add("sign-up-mode");
});
sign_in_btn.addEventListener("click", () => {
container.classList.remove("sign-up-mode");
});
// Sign in form submission
document.querySelector(".sign-in-form").addEventListener('submit', function(event) {
event.preventDefault();
// Get the input values
const username = document.querySelector(".sign-in-form input[type='text']").value;
const password = document.querySelector(".sign-in-form input[type='password']").value;
// Dummy login logic for demo purposes
if (username === 'admin' && password === 'password') {
alert('Login successful!');
// Redirect to dashboard page
window.location.href = 'index.html';
} else {
alert('Invalid username or password');
}
});
// Sign up form submission
document.querySelector(".sign-up-form").addEventListener('submit', function(event) {
event.preventDefault();
// Get the input values
const username = document.querySelector(".sign-up-form input[type='text']").value;
const email = document.querySelector(".sign-up-form input[type='email']").value;
const password = document.querySelector(".sign-up-form input[type='password']").value;
if (username === '' || email === '' || password === '') {
alert('Please fill in all fields');
return;
}
// Dummy signup logic for demo purposes
localStorage.setItem('username', username);
localStorage.setItem('email', email);
localStorage.setItem('password', password);
localStorage.setItem('isLoggedIn', 'true');
alert('Signup successful!'); // Redirect to dashboard page
window.location.href = 'index.html';
});
// Toggle password visibility
function togglePassword(fieldId, icon) {
const field = document.getElementById(fieldId);
const isPassword = field.type === 'password';
// Toggle between 'password' and 'text'
field.type = isPassword ? 'text' : 'password';
// Change the icon class between eye and eye-slash
icon.classList.toggle('fa-lock-open', isPassword);
icon.classList.toggle('fa-lock', !isPassword);
}
document.getElementById("toggle-password").addEventListener("click", function() {
togglePassword("password-input", this);
});
document.getElementById("toggle-password-signup").addEventListener("click", function() {
togglePassword("password-input-signup", this);
});
// Check password strength
function checkPasswordStrength() {
const password = document.querySelector(".sign-up-form input[type='password']").value;
const strengthWeak = document.getElementById('strength-weak');
const strengthMedium = document.getElementById('strength-medium');
const strengthStrong = document.getElementById('strength-strong');
let strength = 0;
if (password.length >= 8) strength++;
if (password.match(/[A-Z]/)) strength++;
if (password.match(/[a-z]/)) strength++;
if (password.match(/[0-9]/)) strength++;
if (password.match(/[^a-zA-Z0-9]/)) strength++;
strengthWeak.className = '';
strengthMedium.className = '';
strengthStrong.className = '';
if (strength >= 1) strengthWeak.className = 'weak';
if (strength >= 3) strengthMedium.className = 'medium';
if (strength >= 5) strengthStrong.className = 'strong';
}
document.querySelector(".sign-up-form input[type='password']").addEventListener('input', checkPasswordStrength);
</script>
</body>
</html>