Commit d7cfb7c6 authored by svilayphiou's avatar svilayphiou

Spread and zoom

Note: the zoom makes huge vertical margins between the pages
parent 23c53749
......@@ -135,6 +135,9 @@ if($("body").hasClass("p-mode")){
e.preventDefault();
$(this).toggleClass("button-active");
$("html").toggleClass("spread");
w = parseInt($("html").css("width")) * 2;
console.log(w);
$("html").css("width", w + "px");
});
......@@ -187,6 +190,21 @@ if($("body").hasClass("p-mode")){
$(this).toggleClass("button-active");
$("#toc-pages").toggle();
});
// __________________________________ ZOOM __________________________________ //
$("#zoom").click(function(e){
e.preventDefault();
$(this).toggleClass("button-active");
$("#zoom-list").toggle();
});
$("#zoom-list a").click(function(e){
e.preventDefault();
zoom = $(this).attr("title") / 100 ;
unzoom = 1 / zoom;
console.log(zoom);
console.log(unzoom);
$(".page").css("-webkit-transform", "scale(" + zoom + ")");
$(".page").css("margin-bottom", "-" + zoom * 10 + "em");
});
}
......
......@@ -108,10 +108,11 @@ div#print-interface {
position: static;
}
div#toc {
div.dropdown {
display: inline-block;
position: relative;
ul#toc-pages {
ul {
padding: 0.5em 0;
display: none;
background-color: black;
......@@ -120,11 +121,12 @@ div#print-interface {
bottom: 2em;
height: 200pt;
width: 80pt;
overflow: auto;
overfl-ow: auto;
a {
padding: 0 1em;
color: white;
display: block;
&:hover {
background-color: white;
......@@ -161,29 +163,29 @@ div#print-interface {
html.spread {
width: @page-width-crop * 2;
.page {
outline: 1px solid black;
float: left;
&:first-child {
margin-left: @page-width !important;
}
&:nth-child(odd) {
margin-left: -@crop * 2;
left: 1px;
}
}
#page-1 {
margin-left: @page-width !important;
}
}
html {
width: @page-width-crop;
position: absolute;
}
body {
position: absolute;
width: @page-width-crop;
/*width: @page-width-crop;*/
width: 100%;
}
html,
......
......@@ -131,10 +131,23 @@
<button id="debug">Debug</button>
<button id="spread">Spread</button>
<button id="hi-res">Hi-res</button>
<div id="toc">
<div id="toc" class="dropdown">
<button id="goto">Go to</button>
<ul id="toc-pages"> </ul>
</div>
<div class="dropdown">
<button id="zoom">Zoom</button>
<ul id="zoom-list">
<li><a href="#" title="25">25&thinsp;%</a></li>
<li><a href="#" title="33">33&thinsp;%</a></li>
<li><a href="#" title="50">50&thinsp;%</a></li>
<li><a href="#" title="75">75&thinsp;%</a></li>
<li><a href="#" title="100">100&thinsp;%</a></li>
<li><a href="#" title="150">150&thinsp;%</a></li>
<li><a href="#" title="200">200&thinsp;%</a></li>
<li><a href="#" title="300">300&thinsp;%</a></li>
</ul>
</div>
</div>
{% endifequal %}
{% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment