From 058c35730b3b8b0d3572c6e96093f760c402b727 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Mon, 15 Aug 2016 11:30:12 +0800 Subject: Update to hide scrollbar (but scrollable) in the slide mode --- public/css/slide.css | 19 +++++++++++++++++++ public/js/slide.js | 4 ++++ public/views/slide.ejs | 49 +++++++++++++++++++++++++------------------------ 3 files changed, 48 insertions(+), 24 deletions(-) diff --git a/public/css/slide.css b/public/css/slide.css index bccb7e42..3f79084b 100644 --- a/public/css/slide.css +++ b/public/css/slide.css @@ -280,6 +280,25 @@ pre.mermaid > svg { max-width: 758px; } +html, body { + height: 100%; + width: 100%; + overflow: hidden; +} + +.container { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + overflow-y: scroll; +} + +.container.hidescrollbar { + right: -17px; +} + .reveal { height: 100vh; } diff --git a/public/js/slide.js b/public/js/slide.js index bdd8b3be..5b0f9bd0 100644 --- a/public/js/slide.js +++ b/public/js/slide.js @@ -110,3 +110,7 @@ Reveal.addEventListener('ready', function (event) { }, 0); }); Reveal.addEventListener('slidechanged', renderSlide); + +var isMacLike = navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i) ? true : false; + +if (!isMacLike) $('.container').addClass('hidescrollbar'); diff --git a/public/views/slide.ejs b/public/views/slide.ejs index 5b728b21..3c5498c6 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -46,33 +46,34 @@
+