Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 22, 2024
1 parent 11b47bc commit d2c982b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions docs/source/_static/template.diff
Original file line number Diff line number Diff line change
Expand Up @@ -15,64 +15,64 @@
<script>
document.addEventListener('DOMContentLoaded', function () {
var revealContainer = document.querySelector('.reveal');

// Append dynamic content to each section
var sections = revealContainer.querySelectorAll('.slides > section');
sections.forEach(function (section) {
// Create a new clock container
var clockContainer = document.createElement('div');
clockContainer.className = 'clock';

// Append the new clock container to the section
section.appendChild(clockContainer);
});

// Function to update the clock content
function updateClock() {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();

// Format the time as HH:MM:SS
var timeString = pad(hours) + ":" + pad(minutes) + ":" + pad(seconds);

// Update the content of all clock containers
var clockContainers = document.querySelectorAll('.clock');
clockContainers.forEach(function (container) {
container.innerText = timeString;
});
}

// Function to pad zero for single-digit numbers
function pad(number) {
return String(number).padStart(2, "0");
}

// Update the clock every second
setInterval(updateClock, 1000);

// Register a reveal.js event to update the clock on each slide change
Reveal.addEventListener('slidechanged', function (event) {
updateClock();
});

// Initial update
updateClock();
});
</script>

<!-- define the style of the clock -->
<style>
.clock {
position: fixed;
position: fixed;
bottom: 10px;
left: 10px;
font-size: 24px;
font-family: "Arial", sans-serif;
color: #333;
}

/* control the relative position of the clock to the slides */
.reveal .slides > section.present, .reveal .slides > section > section.present {
min-height: 100% !important;
Expand All @@ -90,7 +90,7 @@
left: 0 !important;
right: 0 !important;
}

.print-pdf .reveal .slides > section.present, .print-pdf .reveal .slides > section > section.present {
min-height: 770px !important;
position: relative !important;
Expand Down
8 changes: 4 additions & 4 deletions docs/source/_static/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,14 @@
<script>
document.addEventListener('DOMContentLoaded', function () {
var revealContainer = document.querySelector('.reveal');

// Append dynamic content to each section
var sections = revealContainer.querySelectorAll('.slides > section');
sections.forEach(function (section) {
// Create a new clock container
var clockContainer = document.createElement('div');
clockContainer.className = 'clock';

// Append the new clock container to the section
section.appendChild(clockContainer);
});
Expand Down Expand Up @@ -389,11 +389,11 @@
updateClock();
});
</script>

<!-- define the style of the clock -->
<style>
.clock {
position: fixed;
position: fixed;
bottom: 10px;
left: 10px;
font-size: 24px;
Expand Down

0 comments on commit d2c982b

Please sign in to comment.