-
Notifications
You must be signed in to change notification settings - Fork 0
/
Signup.js
48 lines (34 loc) · 1.24 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
37
38
39
40
41
42
43
44
45
46
47
48
// modal add
const addModal = document.querySelector('.add-modal');
const btnAdd = document.querySelector('.btn-add');
const tableUsers = document.querySelector('.carousel-inner');
const addModalForm = document.querySelector('.formcard')
// click submit in add modal form
addModalForm.addEventListener('submit', e => {
e.preventDefault();
const email = document.getElementById("email").value;
const password = document.getElementById("password").value;
firebase
.auth()
.createUserWithEmailAndPassword(email, password)
db.collection('users').add({
username: addModalForm.userName.value,
email: addModalForm.email.value,
about: addModalForm.inputAbout.value,
github: addModalForm.inputgithub.value,
linkedin: addModalForm.inputlinkedIn.value,
phone: addModalForm.inputPhone.value,
college: addModalForm.inputcollege.value,
yos: addModalForm.inputstudy.value,
});
});
// changing the webpage on authorization
firebase.auth().onAuthStateChanged((user) => {
if (user) {
location.replace("welcome.html");
}
})
// loader functionality
setTimeout(function(){
$('.loader_bg').fadeToggle();
}, 1500);