tra-analysis/website/public/stats/scripts.js

33 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-02-06 23:51:58 +00:00
/* Set the width of the side navigation to 250px and the left margin of the page content to 250px and add a black background color to body */
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
document.body.style.backgroundColor = "rgba(0,0,0,0.4)";
}
/* Set the width of the side navigation to 0 and the left margin of the page content to 0, and the background color of body to white */
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft = "0";
document.body.style.backgroundColor = "white";
}
2019-02-07 00:12:39 +00:00
2019-02-07 00:20:31 +00:00
window.onload=function(){
2019-02-07 00:19:18 +00:00
document.getElementById('sideload').style.display = 'block';
2019-02-09 17:27:46 +00:00
user= firebase.auth().currentUser
if (user != null) {
if (user.displayName != null) {
document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName;
} else if (user.email != null) {
document.getElementById('status').innerHTML = "You are signed in as: " + user.email;
} else if (user.phoneNumber != null) {
document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber;
} else {
document.getElementById('status').innerHTML = "You are signed in.";
}
}else{
window.location.replace('../');
}
2019-02-07 00:19:18 +00:00
}