Skip to content

Commit

Permalink
Add time slide
Browse files Browse the repository at this point in the history
  • Loading branch information
RealOrangeOne committed Aug 7, 2024
1 parent baea9bc commit 727950c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ <h1>Robot Hacking!</h1>
<h4>Aim for the day</h4>
<h2>Use sensors for intelligent movement</h2>
</section>
<section>
<h4>The time is:</h4>
<h1 class="current-time"></h1>
</section>
</div>
</div>
<script src="./index.js" type="module"></script>
Expand Down
10 changes: 10 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import Reveal from 'reveal.js';

function setTime() {
const time = (new Date()).toLocaleTimeString();

for (const e of document.getElementsByClassName("current-time")) {
e.innerText = time;
}
}

window.addEventListener("load", function() {
let deck = new Reveal({});
deck.initialize({
Expand All @@ -8,4 +16,6 @@ window.addEventListener("load", function() {
hash: true,
controls: false,
});

setInterval(setTime, 500);
});

0 comments on commit 727950c

Please sign in to comment.