diff options
| author | Andrew Lee <andrew@alee14.me> | 2024-12-28 13:09:27 -0500 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2024-12-28 13:09:27 -0500 |
| commit | b2748a5c55255014d5d5ea02fec38c4125e08e25 (patch) | |
| tree | bd83292e4eb5be716ed32d92bf8d9e0fd2138616 /views/dashboard.ejs | |
| parent | 39cbc8c286227eca935248ad9237d66fa6f45f6e (diff) | |
| download | freeso-discord-auth-b2748a5c55255014d5d5ea02fec38c4125e08e25.tar.gz freeso-discord-auth-b2748a5c55255014d5d5ea02fec38c4125e08e25.tar.bz2 freeso-discord-auth-b2748a5c55255014d5d5ea02fec38c4125e08e25.zip | |
Ability to change password; Sim time on dashboard
Diffstat (limited to 'views/dashboard.ejs')
| -rw-r--r-- | views/dashboard.ejs | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/views/dashboard.ejs b/views/dashboard.ejs index 1c7996b..b7c82d5 100644 --- a/views/dashboard.ejs +++ b/views/dashboard.ejs @@ -9,12 +9,44 @@ <body> <div class="background"></div> <div class="container"> - <img src="img/logo.png" alt="logo" width="200"> + <img src="/img/logo.png" alt="logo" width="200"> <h1>Welcome, <%= username %>!</h1> - <h2>FreeSO Username: <%= fso_username %></h2> - <a href="#" class="button">Change Password</a> - <a href="#" class="button">Download bnbSO Client</a> + <h2>bnbSO Username: <%= fso_username %></h2> + <h2 id="simtime"></h2> + <a href="/password" class="button">Change Password</a> + <a href="https://fso-builds.riperiperi.workers.dev" class="button">Download bnbSO Client</a> <a href="/logout" class="button logout">Logout</a> </div> + <script> + function updateTSOClock() { + const currentTime = new Date(), + utcMinutes = currentTime.getUTCMinutes(), + utcSeconds = currentTime.getUTCSeconds(); + let timePeriod = 'AM', totalSeconds = 0; + if (currentTime.getUTCHours() % 2 === 1) { + totalSeconds = 3600; + timePeriod = 'PM'; + } + totalSeconds += utcMinutes * 60 + utcSeconds; + let hour = Math.floor(totalSeconds / 300); + if (hour > 12) { + hour -= 12; + } + if (hour === 0) { + hour = 12; + } + let minute = Math.floor(totalSeconds % 300 / 5); + if (minute < 10) { + minute = '0' + minute; + } + const simTimeElement = document.querySelector('#simtime'); + if (simTimeElement) { + simTimeElement.textContent = `${hour}:${minute} ${timePeriod}`; + } + } + + setInterval(updateTSOClock, 1000); + updateTSOClock(); + </script> </body> -</html>
\ No newline at end of file +</html> |
