forked from sudhay23/adblock-gdsc-induction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
31 lines (28 loc) · 1.14 KB
/
index.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
const firebaseConfig = {
apiKey: "AIzaSyA4SQqCf3U2vvTr_Bkbfl3bHZnGNxr1SMI",
authDomain: "inductionio-event.firebaseapp.com",
projectId: "inductionio-event",
storageBucket: "inductionio-event.appspot.com",
messagingSenderId: "101950700286",
appId: "1:101950700286:web:96dd44a34780fe43c143af",
measurementId: "G-4DYMK46ZVJ",
};
firebase.initializeApp(firebaseConfig);
const firestore = firebase.firestore();
// Challenge completed notice
if (localStorage.getItem("fullName")) {
const mainHolder = document.querySelector("main");
mainHolder.innerHTML =
"<h2>You already finished this challenge.<br/> Proceed for the other ones</h2>";
} else {
// New Participant
const loginForm = document.querySelector("#loginForm");
const fullNameInput = document.querySelector(".fullName");
const fullRollNumInput = document.querySelector(".fullRollNum");
loginForm.addEventListener("submit", (e) => {
e.preventDefault();
localStorage.setItem("fullName", fullNameInput.value);
localStorage.setItem("fullRollNum", fullRollNumInput.value);
location.assign("/pages/result.html");
});
}