Uniform the slides rendering in present and print mode

This commit is contained in:
yflory
2017-03-17 15:30:27 +01:00
parent 2add39ee40
commit a5f11d0d0d
4 changed files with 337 additions and 334 deletions

View File

@@ -48,7 +48,7 @@ body {
@media print {
@page {
margin: 0;
size: auto;
size: landscape;
}
body {
.CodeMirror, #cme_toolbox {
@@ -66,7 +66,7 @@ body {
overflow: visible;
}
html {
#print {
.cp #print {
display: block;
visibility: visible;
* {
@@ -75,17 +75,26 @@ body {
}
}
}
.cp {
/* Slide position (print mode) */
#print {
position: relative;
display: none;
font-size: 11.25vw;
.slide-frame {
display: flex !important;
justify-content: center;
align-items: center;
flex-flow: column;
padding: 5vh 0;
height: 100vh;
width: 100%;
display: block !important;
// justify-content: center;
//align-items: center;
// flex-flow: column;
padding: 2.5%;
margin-top: ~"calc((100vh - 56.25vw)/2)";
border-top: 1px solid black;
border-bottom: 1px solid black;
height: 56.25vw;
width: 100vw;
page-break-after: always;
position: relative;
box-sizing: border-box;
@@ -99,137 +108,91 @@ body {
position: absolute;
right: 5vh;
bottom: 5vh;
font-size: 15px;
}
.slideDate {
position: absolute;
left: 5vh;
bottom: 5vh;
font-size: 15px;
}
.slideTitle {
position: absolute;
top: 5vh;
left: 0px; right: 0px;
text-align: center;
font-size: 15px;
}
}
}
.cp {
&.slide {
#modal {
.button {
position: absolute;
cursor: pointer;
font-size: 30px;
opacity: 0.6;
display: none;
}
.button:hover {
opacity: 1;
display: block !important;
}
#button_exit {
left: 20px;
top: 20px;
z-index: 9001;
}
#button_left {
left: 6vw;
bottom: 10vh;
}
#button_right {
right: 6vw;
bottom: 10vh;
}
#content {
h1, h2, h3, h4, h5, h6 {
text-align: center;
}
}
&.shown {
display: block;
position: fixed;
top: 0px;
left: 0px;
z-index: 100;
background-color: black;
color: white;
height: 100vh;
width: 100%;
}
}
#modal #content {
p, ul, ol { font-size: 26px; }
img {
position: relative;
min-width: 1%;
max-width: 90%;
max-height: 90%;
margin: auto;
}
}
}
/* Slide position (present mode) */
div.modal, div#modal {
display: none;
#content {
box-sizing: border-box;
border: 1px solid white;
vertical-align: middle;
padding: 2.5vw;
/* center things as much as possible
margin-top: 50vh;
margin-bottom: 50vh;
transform: translateY(-50%);
*/
width: 100vw;
height: 56.25vw; // height:width ratio = 9/16 = .5625
max-height: 100vh;
max-width: 177.78vh; // 16/9 = 1.778
margin: auto;
/* Navigation buttons */
.button {
position: absolute;
top:0;bottom:0; // vertical center
left:0;right:0; // horizontal center
cursor: pointer;
font-size: 30px;
opacity: 0.6;
display: none;
}
.button:hover {
opacity: 1;
display: block !important;
}
#button_exit {
left: 20px;
top: 20px;
z-index: 9001;
}
#button_left {
left: 6vw;
bottom: 10vh;
}
#button_right {
right: 6vw;
bottom: 10vh;
}
&.shown {
display: block;
position: fixed;
top: 0px;
left: 0px;
z-index: 100;
background-color: black;
color: white;
height: 100vh;
width: 100%;
}
#content {
font-size: 20vh;
.slide-frame {
box-sizing: border-box;
border: 1px solid white;
p, li, pre, code {
.size(2.75);
}
vertical-align: middle;
// padding: 2.5vw;
h1 { .size(5); }
h2 { .size(4.2); }
h3 { .size(3.6); }
h4 { .size (3); }
h5 { .size(2.2); }
h6 { .size(1.6); }
/* center things as much as possible
h1, h2, h3, h4, h5, h6 {
color: inherit;
text-align: center;
}
margin-top: 50vh;
margin-bottom: 50vh;
transform: translateY(-50%);
pre > code {
display: block;
position: relative;
border: 1px solid #333;
width: 90%;
*/
padding: 2.5%;
width: 100vw;
height: 56.25vw; // height:width ratio = 9/16 = .5625
max-height: 100vh;
max-width: 177.78vh; // 16/9 = 1.778
margin: auto;
padding-left: .25vw;
}
ul, ol {
min-width: 50%;
max-width: 100%;
display: table;
margin: 0 auto;
position: absolute;
top:0;bottom:0; // vertical center
left:0;right:0; // horizontal center
}
}
@@ -260,55 +223,60 @@ div.modal, div#modal {
&.shown {
display: block;
}
}
table {
margin: 30px;
border-collapse: collapse;
tr {
td {
/* Slide content */
div#modal #content, #print {
.slide-frame {
p, li, pre, code {
.size(2.75);
p, li, pre, code {
font-size: 100%;
line-height: 1em;
}
}
ul, ol {
ul, ol {
margin: 0;
}
}
input {
height: 100%;
h1 { .size(5); }
h2 { .size(4.2); }
h3 { .size(3.6); }
h4 { .size (3); }
h5 { .size(2.2); }
h6 { .size(1.6); }
h1, h2, h3, h4, h5, h6 {
color: inherit;
text-align: center;
}
pre > code {
display: block;
position: relative;
border: 1px solid #333;
width: 90%;
border: 3px solid @base;
margin: auto;
padding-left: .25vw;
}
thead {
tr {
th {
span.remove {
}
}
}
ul, ol {
min-width: 50%;
max-width: 100%;
display: table;
margin: 0 auto;
}
tbody {
tr {
td {
// p, ul, ol { padding-left: 10%; }
}
}
}
tfoot {
tr {
td {
z-index: 4000;
cursor: pointer;
}
}
img {
position: relative;
min-width: 1%;
max-width: 90%;
max-height: 90%;
margin: auto;
}
}
#addtime,
#adddate {
color: @cp-green;
border: 1px solid @cp-green;
padding: 15px;
}
#adddate { .top-left; }
#addtime { .bottom-left; }
}
}