Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
momentollogy committed Apr 13, 2023
1 parent 510585a commit 8c2c3ca
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ <h1>Arduino Piano Buzzer Song Creator V1 <br> <small>by momentollogy</small><br>
<!-- ... existing script tag ... -->

<div class="g-signin2" data-onsuccess="onSignIn" data-onfailure="handleSignInFailure"></div>
<button onclick="signOut()">Sign out</button>
<button id="signinButton" onclick="signOut()">Sign Out</button>




Expand Down Expand Up @@ -150,18 +151,21 @@ <h1>Arduino Piano Buzzer Song Creator V1 <br> <small>by momentollogy</small><br>

function updateSignInStatus(googleUser) {
const signInButton = document.getElementById('signinButton');
const gSignIn = document.getElementsByClassName('g-signin2')[0];

if (googleUser) {
signInButton.innerText = 'Sign Out';
signInButton.onclick = signOut;
signInButton.style.display = 'block';
gSignIn.style.display = 'none';
} else {
signInButton.innerText = 'Sign In';
signInButton.onclick = () => {
gapi.auth2.getAuthInstance().signIn().then(onSignIn);
};
signInButton.style.display = 'none';
gSignIn.style.display = 'block';
}
}

function handleSignInFailure(error) {
console.error('Error during sign-in:', error);
}



async function initClient(token) {
Expand Down

0 comments on commit 8c2c3ca

Please sign in to comment.