fuzzyworld

hawk / commit

Added a greeting that will show up once you are signed-in.

3d3a11867311284420592f3480019e9e2390d5c8 · Pavel Safronov · 2023-10-12 16:28:17 -0700 · parents 620a07ee15a6

Added a greeting that will show up once you are signed-in.
 public/index.html | 3 ++-
 public/main.js    | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/public/index.html b/public/index.html
index c622578..0f8ce37 100644
--- a/public/index.html
+++ b/public/index.html
@@ -15,7 +15,7 @@
         #main,
         #controls,
         #sign-in-div {
-            margin-top: 2em;
+            /* margin-top: 2em; */
             text-align: center;
         }
 
@@ -70,6 +70,7 @@
             <button id="signin">Sign In</button>
         </div>
         <div id="controls">
+            <div id="greeting"></div>
             <span id="minutes">
                 <input id="minutes-input" type="number" min="0" max="59" value="5" />
                 <label for="minutes-input">minutes</label>
diff --git a/public/main.js b/public/main.js
index 35b66b8..79c14e1 100644
--- a/public/main.js
+++ b/public/main.js
@@ -34,5 +34,7 @@ signOutButton.addEventListener('click', signOut);
 if (showProfile) {
     getProfile().then(profile => {
         console.log(profile);
+        const greetingDiv = document.getElementById('greeting');
+        greetingDiv.innerHTML = `Hello, ${profile.display_name}! Let's find you a song!`;
     });
 }
\ No newline at end of file