forked from ayush-that/FinVeda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
registerpage.html
168 lines (158 loc) · 6.53 KB
/
registerpage.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
<!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="loginPage.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="shortcut icon" href="/assets/images/favicon2.webp" type="image/png" />
</head>
<body>
<div class="container">
<div class="forms-container">
<div class="sign-in-signup">
<form action="#" class="sign-in-form">
<h2 class="title">Create Account</h2>
<div class="input-field">
<i class="fas fa-user"></i>
<input type="text" placeholder=" Full Name" required />
</div>
<div class="input-field">
<i class="fa-solid fa-envelope"></i>
<input type="email" placeholder="Email" required />
</div>
<div class="input-field">
<i class="fas fa-lock"></i>
<input type="password" placeholder="Password" id="password" />
<i class="fas fa-eye password-toggle" onclick="togglePassword('password', this)"></i>
</div>
<div class="input-field">
<i class="fas fa-lock"></i>
<input type="password" placeholder=" Confirm Password" id="confirm-password" />
<i class="fas fa-eye password-toggle" onclick="togglePassword('confirm-password', this)"></i>
</div>
<button type="submit" class="btn solid" onclick="handleregister(event)">Register</button>
</form>
<p class="social-text" style="position: relative; bottom: 30px;">Or Sign Up using social platforms</p>
<div class="social-media" style="position: relative; bottom: 30px;">
<a href="https://www.google.com" target="_blank" class="social-icon" id="google">
<i class="fab fa-google"></i>
</a>
<a href="https://www.facebook.com" target="_blank" class="social-icon" id="google">
<i class="fab fa-facebook"></i>
</a>
<a href="https://www.x.com" target="_blank" class="social-icon" id="x">
<i class="fab fa-x"></i>
</a>
<button class="social-icon" id="githubSignInBtn">
<i class="fab fa-github"></i>
</button>
</div>
<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"></i>
<input type="password" placeholder="Password" id="signup-password" />
<i class="fas fa-eye password-toggle" onclick="togglePassword('signup-password', this)"></i>
</div>
<div class="password-strength">
<div id="strength-weak"></div>
<div id="strength-medium"></div>
<div id="strength-strong"></div>
</div>
<input type="submit" class="btn" value="Sign up" />
</form>
</div>
</div>
<script src="https://www.gstatic.com/firebasejs/9.18.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.18.0/firebase-auth-compat.js"></script>
<script src="firebase.js"></script>
<script>
// Home button
document.getElementById('home-btn').addEventListener('click', function() {
window.location.href = "index.html";
});
function togglePassword(inputId, eyeIcon) {
const passwordField = document.getElementById(inputId);
const isPasswordVisible = passwordField.type === "text";
if (isPasswordVisible) {
passwordField.type = "password";
eyeIcon.classList.remove("fa-eye-slash");
eyeIcon.classList.add("fa-eye");
} else {
passwordField.type = "text";
eyeIcon.classList.remove("fa-eye");
eyeIcon.classList.add("fa-eye-slash");
}
}
</script>
<script>
function handleregister(event) {
// Prevent the form from submitting
event.preventDefault();
// Getting the values of the input fields
const fullName = document.querySelector('.sign-in-form input[type="text"]').value;
const email = document.querySelector('.sign-in-form input[type="email"]').value;
const password = document.querySelector('.sign-in-form input[type="password"]').value;
const confirmPassword = document.querySelectorAll('.sign-in-form input[type="password"]')[1].value;
// Checking if all fields are filled
if (!fullName || !email || !password || !confirmPassword) {
alert("Please fill all fields.");
return;
}
// Checking if password and confirm password match
if (password !== confirmPassword) {
alert("Passwords do not match.");
return;
}
alert("Your Account has been Created Successfully!");
window.location.href = "index.html"; // Redirect to index.html
}
</script>
<div class="panels-container">
<div class="panel left-panel">
<div class="content">
<h3>Already Have a Account ?</h3>
<p>
Discover new experiences with BuddyTrail! <br>Signing in to your Account.
</p>
<a href="./loginPage.html">
<button class="btn transparent" id="sign-up-btn">
Login
</button>
</a>
</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 back to our community
</p>
<a href="./loginPage.html">
<button class="btn transparent" id="sign-in-btn">
Sign in
</button>
</a>
</div>
<img src="img/register.svg" class="image" alt="" />
</div>
</div>
</div>
<a href="index.html" class="homeBtn">
<i class="fas fa-home"></i>
</a>
<script src="auth.js"></script>
<script type="module" src="SignIn-Up-withGithub.js"></script>
</body>
</html>