mirror of
https://github.com/gmemstr/gmemstr.github.io.git
synced 2024-09-20 04:31:09 +01:00
Time in top corner returns current time properly
This commit is contained in:
parent
97d5b9989f
commit
0640d0f330
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 107 KiB |
BIN
assets/pogo.png
BIN
assets/pogo.png
Binary file not shown.
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 81 KiB |
27
index.html
27
index.html
|
@ -14,9 +14,9 @@
|
||||||
<header>
|
<header>
|
||||||
<img src="https://avatars2.githubusercontent.com/u/1878840?s=400&u=b433687936e1e1c1bfd858737d8323c6a5b58c33&v=4" alt="Github Profile Picture" class="profile-img">
|
<img src="https://avatars2.githubusercontent.com/u/1878840?s=400&u=b433687936e1e1c1bfd858737d8323c6a5b58c33&v=4" alt="Github Profile Picture" class="profile-img">
|
||||||
<div class="status">
|
<div class="status">
|
||||||
<span class="time">10:32 <small>AM</small></span>
|
<span id="time">10:32 <small>AM</small></span>
|
||||||
<span class="wifi"><i class="fas fa-wifi"></i></span>
|
<span id="wifi"><i class="fas fa-wifi"></i></span>
|
||||||
<span class="battery">100% <i class="fas fa-battery-full"></i></span>
|
<span id="battery">100% <i class="fas fa-battery-full"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
@ -26,13 +26,13 @@
|
||||||
<a href="https://github.com/gmemstr/pogo"><img src="assets/pogo.png" alt="Pogo Logo" class="project-img"></a>
|
<a href="https://github.com/gmemstr/pogo"><img src="assets/pogo.png" alt="Pogo Logo" class="project-img"></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="project" id="platypus">
|
<div class="project" id="platypus">
|
||||||
<img src="assets/platypus.png" alt="Platypus Logo" class="project-img">
|
<a href="https://github.com/gmemstr/platypus"><img src="assets/platypus.png" alt="Platypus Logo" class="project-img"></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="project" id="placeholder">
|
<div class="project" id="gitgalaxy">
|
||||||
<img src="https://placehold.it/400x400" alt="Placeholder Logo" class="project-img">
|
<img src="assets/gitgalaxy.png" alt="Git Galaxy Logo" class="project-img">
|
||||||
</div>
|
</div>
|
||||||
<div class="project" id="placeholder">
|
<div class="project" id="nodemc">
|
||||||
<img src="https://placehold.it/400x400" alt="Placeholder Logo" class="project-img">
|
<img src="assets/nodemc.png" alt="NodeMC Logo" class="project-img">
|
||||||
</div>
|
</div>
|
||||||
<div class="project" id="placeholder">
|
<div class="project" id="placeholder">
|
||||||
<img src="https://placehold.it/400x400" alt="Placeholder Logo" class="project-img">
|
<img src="https://placehold.it/400x400" alt="Placeholder Logo" class="project-img">
|
||||||
|
@ -59,4 +59,15 @@
|
||||||
</main>
|
</main>
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
var date = new Date();
|
||||||
|
var hours = date.getHours();
|
||||||
|
var minutes = date.getMinutes();
|
||||||
|
var ampm = hours >= 12 ? 'pm' : 'am';
|
||||||
|
hours = hours % 12;
|
||||||
|
hours = hours ? hours : 12; // the hour '0' should be '12'
|
||||||
|
minutes = minutes < 10 ? '0'+minutes : minutes;
|
||||||
|
var strTime = hours + ':' + minutes + ' <small>' + ampm.toUpperCase() + '</small>';
|
||||||
|
document.getElementById("time").innerHTML=strTime;
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
Loading…
Reference in a new issue