making a slideshow in html

and css and javascript and all that jazz

Carston Wiebe

what do you need to know?

personal quirks

html format

<header>
  <h1>making a slideshow in html</h1>
  <h2>and css and javascript and all
    that jazz</h2>
  Carston Wiebe
  <br />
  <time>2025.01.31</time>
</header>
<section>
  <h2>html format</h2>
  <ul>
    <li>How do we represent a
      slideshow?</li>
  </ul>
</section>

css reset

* {
  box-sizing:border-box;
  padding:0px;
  margin:0px;
}
table {
  border-collapse:collapse;
}
a {
  text-decoration:none;
}
html {
  font:14pt Sarala;
  color:#eeeeee;
  background-color:#222222;
}

css grid

section {
  display:grid;
  gap:16px;
  grid-template:
    "hed hed hed hed hed hed" auto
    "nop c11 c11 c11 c11 emp" auto
    "nop c21 c21 c22 c22 emp" auto
    "c31 c31 c32 c32 c33 c33" auto
   / 1fr 1fr 1fr 1fr 1fr 1fr;
}
section > * {
  grid-area:c11;
}
section > h2 {
  grid-area:hed;
  text-align:center;
}
*.c21 { grid-area:c21; }
*.c22 { grid-area:c22; }
*.c31 { grid-area:c31; }
*.c32 { grid-area:c32; }
*.c33 { grid-area:c33; }

other things

no one wants to see the whole slideshow at once!

function changeSlide(event) {
  if (!event) {
    nextSlide();
  } else {
    switch (event.keyCode) {
      case 32:  // Space.
      case 39:  // Left.
      case 74:  // j.
        nextSlide();
        break;
      case 8:   // Backspace.
      case 37:  // Right.
      case 75:  // k.
        prevSlide();
    }
  }
}