-
Notifications
You must be signed in to change notification settings - Fork 3
/
signUp.js
36 lines (31 loc) · 1.12 KB
/
signUp.js
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
// alert("Your passwords are currently visible to us, this site is in testing mode.")
const signUp = document.getElementById('signUp');
const image = document.getElementById('coolGuy') // For GSAP animations
signUp.addEventListener("click", (event) => {
event.preventDefault();
const name = document.getElementById('name').value;
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
const confirmPassword = document.getElementById('password_confirmation').value;
if (confirmPassword === password) {
if (!userExists(email)) {
const success = addUser(name, email, password);
if (success) {
alert("User successfully registered!");
} else {
alert("Error: User could not be registered.");
}
} else {
alert("Error: A user with this email already exists.");
}
} else {
alert("Error: Passwords do not match.");
}
});
gsap.from(image, {
x: "-200%",
opacity: 0,
duration: 1,
delay:0,
ease: "power2.out"
})