-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
30 lines (27 loc) · 1.3 KB
/
script.js
File metadata and controls
30 lines (27 loc) · 1.3 KB
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
/* Set the width of the sidebar to 250px and the left margin of the page content to 250px */
function openNav() {
document.getElementById("mySidebar").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
}
/* Set the width of the sidebar to 0 and the left margin of the page content to 0 */
function closeNav() {
document.getElementById("mySidebar").style.width = "0";
document.getElementById("main").style.marginLeft = "0";
}
function onSignIn(googleUser) {
// Useful data for your client-side scripts:
var profile = googleUser.getBasicProfile();
document.getElementById('profileinfo').innerHTML = "<br><a>" + profile.getName() + "</a>" + "<a href='mailto:'" + profile.getEmail() + "'>" + profile.getEmail() + "</a><br><img style='margin-left: 32px;' src='" + profile.getImageUrl() + "'/>";
document.getElementById('signin').style.display="none";
document.getElementById('signout').style.display="block";
document.getElementById('name').value = profile.getName();
document.getElementById('email').value = profile.getEmail();
document.getElementById('pfp').value = profile.getImageUrl();
// document.location = "index.html";
}
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () {
document.location = "login.html";
});
}