diff --git a/help-menu.html b/help-menu.html index 3c3078c..7ee00da 100755 --- a/help-menu.html +++ b/help-menu.html @@ -8,6 +8,7 @@
  • Open slide overview: Hit Ctrl twice.
  • Close slide overview: Esc
  • Open the help menu: H
  • +
  • Show laser pointer: P
  • Imprint and privacy policy diff --git a/onpoint.js b/onpoint.js index 48aa165..910a4d0 100755 --- a/onpoint.js +++ b/onpoint.js @@ -104,6 +104,9 @@ function onKeyPressed(event) { case 72: // H onHPressed(); break; + case 80: // P + onPPressed(); + break; } } @@ -112,6 +115,11 @@ function onHPressed() { toggleHelpMenu(); } +function onPPressed() { + if (!(document.activeElement === topicListSearch)) + togglePointer(); +} + function showNextFragment() { let fragments = [...slides[currentSlide].querySelectorAll('.fragment')] let visible = [...slides[currentSlide].querySelectorAll('.fragment.visible')] @@ -395,6 +403,10 @@ function toggleHelpMenu() { document.getElementById('help-menu-toggle').click(); } +function togglePointer() { + document.body.classList.toggle('laser-pointer-active'); +} + function hideHelpMenu() { document.getElementById('help-menu-checkbox').checked = false; } \ No newline at end of file diff --git a/test/images/pointer.svg b/test/images/pointer.svg new file mode 100644 index 0000000..f896715 --- /dev/null +++ b/test/images/pointer.svg @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/test/styles/style.css b/test/styles/style.css index 277e64b..7d1e481 100755 --- a/test/styles/style.css +++ b/test/styles/style.css @@ -22,6 +22,10 @@ h1 { opacity: 1; } +body.laser-pointer-active { + cursor: url("../images/pointer.svg"), auto; +} + @media screen { body { background: black;