Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
platformer update pls
Browse files Browse the repository at this point in the history
  • Loading branch information
smartfoloo committed Nov 2, 2023
1 parent 68f7573 commit 5c599c9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
15 changes: 10 additions & 5 deletions css/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ a:hover {
.nav .nav-links a {
transition: all 0.2s linear;
}
.nav .search-icon {
color: #fff;
font-size: 20px;
cursor: pointer;
}

.nav .navOpenBtn,
.nav .navCloseBtn {
Expand All @@ -80,6 +75,9 @@ a:hover {
.nav {
padding: 15px 30px;
}
.nav #clock {
display: none;
}
}
@media screen and (max-width: 600px) {
.nav .navOpenBtn,
Expand Down Expand Up @@ -162,4 +160,11 @@ option {
::-webkit-scrollbar-thumb {
background: #1f2228;
border-radius: 8px;
}

#clock {
color: #fff;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
1 change: 1 addition & 0 deletions games/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<img src="/favicon.png" class="logo-image">
Platformer.io
</a>
<div id="clock" class="clock hidden" onload="showTime()"></div>
<ul class="nav-links">
<i class="uil uil-times navCloseBtn"></i>
<li><a href="/index.html"><i class="fa-solid fa-house" style="margin-right: 5px;"></i>Home</a></li>
Expand Down
28 changes: 28 additions & 0 deletions js/games.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,33 @@ function removeLikedLabel(gameCard) {
}
}

function showTime() {
var date = new Date();
var h = date.getHours();
var m = date.getMinutes();
var s = date.getSeconds();
var session = "AM";

if (h == 0) {
h = 12;
}

if (h > 12) {
h = h - 12;
session = "PM";
}

h = (h < 10) ? "0" + h : h;
m = (m < 10) ? "0" + m : m;
s = (s < 10) ? "0" + s : s;

var time = h + ":" + m + ":" + s + " " + session;
document.getElementById("clock").innerText = time;
document.getElementById("clock").textContent = time;

setTimeout(showTime, 1000);

}
showTime();


0 comments on commit 5c599c9

Please sign in to comment.