text-align: center;
vertical-align:middle;
}
-.sws-cover {
- justify-content: center;
- -webkit-justify-content: center;
+
+.sws-cover .sws-content {
text-align:center;
}
}
+: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 {
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
});
};
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;
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"/>'));
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;