From: Kim Nguyễn Date: Sun, 27 Sep 2015 07:35:30 +0000 (+0200) Subject: . X-Git-Url: http://git.nguyen.vg/gitweb/?p=hacks%2FsimpleWebSlides.git;a=commitdiff_plain;h=6f82af14634b5c8b7d3af8fa27300c4ae0d27d50 . --- diff --git a/simpleWebSlides.css b/simpleWebSlides.css index 430c05a..3a56dd2 100644 --- a/simpleWebSlides.css +++ b/simpleWebSlides.css @@ -17,9 +17,8 @@ body { text-align: center; vertical-align:middle; } -.sws-cover { - justify-content: center; - -webkit-justify-content: center; + +.sws-cover .sws-content { text-align:center; } @@ -71,10 +70,22 @@ body > h1, body > h2, body > h3, body > a.sws-previous { } +:root.sws-by-width body { + font-size: 4vh; +} +:root.sws-by-height.sws-aspect-4-3 body { + font-size: 3vw; +} +:root.sws-by-height.sws-aspect-16-9 body { + font-size: 2.25vw; +} +:root.sws-by-height.sws-aspect-16-10 body { + font-size: 2.5vw; +} :root.sws-by-width.sws-aspect-4-3 .sws-canvas { - width:133.3vh; - height:100vh; + width:133.3vh; + height:100vh; } :root.sws-by-width.sws-aspect-16-9 .sws-canvas { @@ -315,10 +326,10 @@ p { width: 100%; } font-size: large; } -/* embedded SVG images are inlined and their height matches twice the size of a small letter x */ +/* embedded SVG images are inlined and their height matches twice the font-size */ object[type="image/svg+xml"] { display:inline-block; font-size:inherit; - height: 2.5ex; + height: 2em; vertical-align:middle; } \ No newline at end of file diff --git a/simpleWebSlides.js b/simpleWebSlides.js index 798d2ac..80eecb0 100644 --- a/simpleWebSlides.js +++ b/simpleWebSlides.js @@ -722,13 +722,12 @@ SWS.Presentation = new function () { }); }; self.changeAspect = function() { + if (_print_mode) return; var newClass = $("#sws-aspect-select").val(); var args = newClass.split("-"); var targetRatio = (args[2] - 0) / (args[3] - 0); var realRatio = window.innerWidth / window.innerHeight; var byClass = (targetRatio > realRatio ) ? "sws-by-height" : "sws-by-width"; - console.log(byClass); - if ($("html").hasClass(newClass) && $("html").hasClass(byClass)) return; @@ -857,18 +856,28 @@ SWS.Presentation = new function () { if (!($(this).hasClass("sws-option-noheader"))) { canvas.append($('
')); }; + if (!$(this).hasClass("sws-cover")) { var title = $($(this).find("h1")[0]); var title_div = $('
'); title_div.append(title); canvas.append(title_div); - } + }; + var inner = $('
'); var content = $('
'); $(this).find('script[type="text/javascript"]').remove(); content.append($(this)); inner.append(content); canvas.append(inner); + var that = this; + [ "sws-cover", "sws-toc" ].forEach( + function(v) { + if ($(that).hasClass(v)) { + inner.addClass(v); + $(that).removeClass(v); + } + }); if (!($(this).hasClass("sws-option-nofooter"))) { canvas.append($('