From 040692b421bbbd2ed1ad1f5527f9649b824d5266 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Mon, 30 Apr 2018 16:36:49 +0200 Subject: [PATCH] Some display adjustments, make keys actually work in modern browsers --- linuxwochen2018/index.html | 21 +++++++++++---------- linuxwochen2018/slides.css | 13 ++++++++----- linuxwochen2018/slides.js | 30 ++++++++++++++++++------------ 3 files changed, 37 insertions(+), 27 deletions(-) diff --git a/linuxwochen2018/index.html b/linuxwochen2018/index.html index dfea7a8..3384c53 100755 --- a/linuxwochen2018/index.html +++ b/linuxwochen2018/index.html @@ -86,7 +86,7 @@
A-Frame - aframe-io + alt="Boy with VR headset">

diff --git a/linuxwochen2018/slides.css b/linuxwochen2018/slides.css index af56611..caadf1d 100644 --- a/linuxwochen2018/slides.css +++ b/linuxwochen2018/slides.css @@ -358,7 +358,7 @@ pre { margin: 0; } /***** small stuff *****/ -.small, +small, .small { font-size: 0.75em; } @@ -409,7 +409,7 @@ h1.endslidetext { h2.endslidetext, h3.endslidetext { - font-size: 2em; + font-size: 1.5em; } h2.endslidetext > span, @@ -427,15 +427,18 @@ h3.endslidetext > span { } .endslidetext:nth-child(3) { - top: 21rem; + top: 17rem; } @media (min-resolution: 1.3dppx) { + .endslidetext:first-child { + top: .5rem; + } .endslidetext:nth-child(2) { - top: 6rem; + top: 9rem; } .endslidetext:nth-child(3) { - top: 11rem; + top: 14rem; } } diff --git a/linuxwochen2018/slides.js b/linuxwochen2018/slides.js index 3107289..0064698 100644 --- a/linuxwochen2018/slides.js +++ b/linuxwochen2018/slides.js @@ -192,25 +192,31 @@ function timerFired() { function handleKeyPress(e) { e = e || event; - switch (e.keyCode) { + switch (e.key) { // See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#Constants_for_keyCode_value - case e.DOM_VK_LEFT: - case e.DOM_VK_DOWN: - case e.DOM_VK_PAGE_DOWN: - case e.DOM_VK_H: //8bitdo Zero "X" + case "ArrowLeft": + case "ArrowDown": + case "Left": // non-standard, old browsers + case "Down": // non-standard, old browsers + case "PageDown": + case "H": //8bitdo Zero "X" + case "h": //8bitdo Zero "X" go("prev"); break; - case e.DOM_VK_RIGHT: - case e.DOM_VK_UP: - case e.DOM_VK_PAGE_UP: - case e.DOM_VK_J: //8bitdo Zero "B" + case "ArrowRight": + case "ArrowUp": + case "Right": // non-standard, old browsers + case "Up": // non-standard, old browsers + case "PageUp": + case "J": //8bitdo Zero "B" + case "j": //8bitdo Zero "B" go("next"); break; - case e.DOM_VK_HOME: + case "Home": go("start"); break; - case e.DOM_VK_END: + case "End": go("toc"); break; } } window.onclick = handleClick; - window.onkeypress = handleKeyPress; + window.onkeydown = handleKeyPress; })(); -- 2.43.0