.
authorKim Nguyễn <kn@lri.fr>
Sun, 27 Sep 2015 07:35:30 +0000 (09:35 +0200)
committerKim Nguyễn <kn@lri.fr>
Sun, 27 Sep 2015 07:35:30 +0000 (09:35 +0200)
simpleWebSlides.css
simpleWebSlides.js
themes/uPsud.css

index 430c05a..3a56dd2 100644 (file)
@@ -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
index 798d2ac..80eecb0 100644 (file)
@@ -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($('<div class="sws-header"/>'));
             };
+
             if (!$(this).hasClass("sws-cover")) {
                 var title = $($(this).find("h1")[0]);
                 var title_div = $('<div class="sws-title" />');
                 title_div.append(title);
                 canvas.append(title_div);
-            }
+            };
+
             var inner = $('<div class="sws-inner-canvas"/>');
             var content = $('<div class="sws-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($('<div class="sws-footer"/>'));
index df89ad5..8dba5a9 100644 (file)
@@ -35,24 +35,26 @@ h1 {
     margin:0;
 }
 
+.sws-cover { display:flex;
+            flex-direction:column;
+            justify-content: center;
+          }
+
+
 .sws-toc { position: absolute;
           left: 0;
           bottom: 0;
           right: 0;
           top:0;
         }
-.sws-toc > ul {
-    display:inline-block;
-}
 
-.sws-toc::before {
-    display:inline-block;
-    content: "";
-    height:100%;
-    width: 0px;
-    vertical-align:middle;
+.sws-toc > .sws-content {
+    position:absolute;
+    top: 20%;
+    width:100%;
 }
 
+
 .sws-canvas {
     color: #696968;
     background: #fff;