From: Kim Nguyễn Date: Sun, 27 Sep 2015 15:04:21 +0000 (+0200) Subject: Make the presentation have the correct aspect ratio even when the window has a smalle... X-Git-Url: http://git.nguyen.vg/gitweb/?p=hacks%2FsimpleWebSlides.git;a=commitdiff_plain;h=98c49ac3402436a31a277fdbfcf09870dbb346b8 Make the presentation have the correct aspect ratio even when the window has a smaller aspect ratio. Sanitize the generic CSS. --- diff --git a/simpleWebSlides.css b/simpleWebSlides.css index 3a56dd2..bd42f5a 100644 --- a/simpleWebSlides.css +++ b/simpleWebSlides.css @@ -13,9 +13,9 @@ body { } .sws-canvas { + display:flex; + flex-direction:column; box-sizing: border-box; - text-align: center; - vertical-align:middle; } .sws-cover .sws-content { @@ -44,11 +44,12 @@ body { } .sws-header, .sws-title, .sws-inner-canvas, .sws-footer{ - display:inline-block; + display:block; margin:0; padding:0; width: 100%; box-sizing: border-box; + overflow:hidden; } @@ -71,16 +72,16 @@ body > h1, body > h2, body > h3, body > a.sws-previous { } :root.sws-by-width body { - font-size: 4vh; + font-size: 3.5vh; } :root.sws-by-height.sws-aspect-4-3 body { - font-size: 3vw; + font-size: 2.625vw; } :root.sws-by-height.sws-aspect-16-9 body { - font-size: 2.25vw; + font-size: 1.96875vw; } :root.sws-by-height.sws-aspect-16-10 body { - font-size: 2.5vw; + font-size: 2.1875vw; } :root.sws-by-width.sws-aspect-4-3 .sws-canvas { @@ -142,14 +143,14 @@ body > h1, body > h2, body > h3, body > a.sws-previous { /* Print Mode */ /* ****************************************** */ - :root.sws-print body { background: white; width: 297mm; - padding: 0pt 0pt 0pt 0pt; - margin: 0pt 0pt 0pt 0pt; - + padding: 0; + margin: 0; + font-size: 21pt; } + @media print { @page { @@ -179,6 +180,10 @@ body > h1, body > h2, body > h3, body > a.sws-previous { } + + + + p { width: 100%; } /* counters for the toc */ diff --git a/simpleWebSlides.js b/simpleWebSlides.js index 80eecb0..a0e0ef8 100644 --- a/simpleWebSlides.js +++ b/simpleWebSlides.js @@ -163,7 +163,7 @@ SWS.Config = new SWS.ConfigBuilder (); SWS.Effects = new function () { var self = this; - + self.objectDeactivateFadeOut = function (o) { if (o.is("embed")) return; o.animate({'opacity': '0'}, 200, @@ -395,7 +395,7 @@ SWS.Presentation = new function () { }; all.find("*").addBack().promise().done(function() { //wait for all elements to finish transitionning, in case a callback animate something - //an denable _input_events again. + //and enable _input_events again. _disable_input_events = false; }); }); @@ -487,6 +487,11 @@ SWS.Presentation = new function () { self.printMode = function () { _print_mode = true; + + var old_fx_status = $.fx.off; + //disable animation while printing. + + $.fx.off = true; var progress = $("
Rendering presentation: %
"); $("body").append(progress); @@ -513,7 +518,8 @@ SWS.Presentation = new function () { $("#sws-percent-progress").text(100); progress.remove(); window.status = 'Ready'; - window.print(); + $.fx.off = old_fx_status; + if (SWS.Utils.getParameterByName("dialog") != "off") window.print(); } }; loop(); diff --git a/themes/uPsud.css b/themes/uPsud.css index 8dba5a9..f08cea5 100644 --- a/themes/uPsud.css +++ b/themes/uPsud.css @@ -17,22 +17,16 @@ display: none; } -/* Title of the slide */ -.sws-title { - padding: 2vmin 0 2vmin 0; - height: 10%; - z-index:2; - vertical-align: middle; -} h1 { color: #00486c; font-size: larger; text-align: center; } -.sws-title h1 { - display:inline-block; + +.sws-title > h1 { margin:0; + padding:0; } .sws-cover { display:flex; @@ -65,12 +59,21 @@ h1 { } .sws-inner-canvas { - height: 85%; + height: 88%; z-index: 2; position: relative; /* to make z-index work */ + margin:0; +} + +/* Title of the slide */ +.sws-title { + height: 7%; + z-index:2; + } .sws-footer { + margin:0; height: 5%; text-align:right; padding-right:1ex; @@ -119,10 +122,7 @@ body { color: #696968; } -:root.sws-display .sws-canvas { - font-size: 2.2vw; -} - +/* :root.sws-print body { font-size: 21pt; } @@ -132,6 +132,7 @@ body { @media print { body { font-size: 21pt; } } +*/ p { display:block;