-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
60 lines (54 loc) · 2.47 KB
/
main.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function toggle() {
var blur = document.getElementById('blur');
blur.classList.toggle('active');
var popup = document.getElementById('popup');
popup.classList.toggle('active');
}
function signin() {
let signupbtn = document.getElementById("signupbtn");
let signinbtn = document.getElementById("signinbtn");
let email = document.getElementById("email");
let password = document.getElementById("password");
let repeatPassword = document.getElementById("repeatpassword");
let title = document.getElementById("title");
title.innerHTML = "Sign in";
repeatPassword.style.maxHeight = "0";
}
function signup() {
let signupbtn = document.getElementById("signupbtn");
let signinbtn = document.getElementById("signinbtn");
let email = document.getElementById("email");
let password = document.getElementById("password");
let repeatPassword = document.getElementById("repeatpassword");
let title = document.getElementById("title");
title.innerHTML = "Sign up";
repeatPassword.style.maxHeight = "65px";
}
function submit() {
let title = document.getElementById("title").innerHTML;
}
console.log(document.getElementById("signupbtn"))
document.getElementById("form").addEventListener("submit", signup)
document.getElementById("form").addEventListener("submit", submit)
document.getElementById("swapbutton").addEventListener("click", function () {
var signinbtn = document.getElementById("signinbtn");
var signupbtn = document.getElementById("signupbtn");
var repeatpassword = document.getElementById("repeatpassword");
var title = document.getElementById("title");
signinbtn.classList.toggle("hide");
signupbtn.classList.toggle("show");
repeatpassword.classList.toggle("hide");
if (title.innerHTML === "Sign In") {
title.innerHTML = "Sign Up";
document.getElementById("swapbutton").value = "Sign In";
document.getElementById("signupbtn").classList.toggle("hide");
document.getElementById("signupbtn").innerHTML = "Sign in";
document.getElementById("signinbtn").classList.toggle("show");
} else {
title.innerHTML = "Sign In";
document.getElementById("swapbutton").value = "Sign Up";
document.getElementById("signupbtn").innerHTML = "Sign up"
document.getElementById("signupbtn").classList.toggle("hide");
document.getElementById("signupbtn").classList.toggle("show");
}
});