Various JavaScript hacks

Presentation pack

This lets you scroll the space by the hard-coded shift values via keyboard (to advance slides). You can toggle the chrome. It also increases h1 size.

let xShift = 996;
let yShift = 800;

document.body.addEventListener("keydown", (e) => {
  if (document.querySelector(".card-details")) return;
  e.key === "l"
    ? window.scrollBy({ left: xShift, behavior: "smooth" })
    : e.key === "h"
    ? window.scrollBy({ left: -xShift, behavior: "smooth" })
    : e.key === "j"
    ? window.scrollBy({ top: yShift, behavior: "smooth" })
    : e.key === "k"
    ? window.scrollBy({ top: -yShift, behavior: "smooth" })
    : null;
});

let toggleChrome = () => {
  const display =
    document.querySelector("header").style.display === "none" ? "" : "none";
  document.querySelector("header").style.display = display;
  document.querySelector("footer").style.display = display;
  document.querySelector(".footer-wrap").style.display = display;
};

document.body.addEventListener("keydown", (e) => {
  if (document.querySelector(".card-details")) return;
  if (e.key === "d") toggleChrome();
});


let styles = `
    .name-segment .markdown h1 { font-size: 44px; }
`

let styleSheet = document.createElement("style")
styleSheet.innerText = styles
document.head.appendChild(styleSheet)
2 Likes