Commit 0ab95375 authored by svilayphiou's avatar svilayphiou

Put back the zoom button from VJ14 publication.

It is made using `-webkit-transform` because using the browser zooming
feature makes the rendering engine recalculate the layout, ending in
slight differences in word wraps.
parent da06dad5
......@@ -197,6 +197,38 @@
position: static;
}
div.dropdown {
display: inline-block;
position: relative;
ul {
padding: 0.5em 0;
display: none;
background-color: black;
position: absolute;
right: 0;
bottom: 2em;
height: 200pt;
width: 80pt;
overflow: auto;
a {
padding: 0 1em;
color: white;
display: block;
&:hover {
background-color: white;
color: black;
}
}
}
button {
width: 80pt;
}
}
#toc {
display: inline-block;
}
......
......@@ -71,4 +71,19 @@ $(function() {
$(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;
$("#pages").css("-webkit-transform", "scale(" + zoom + ")");
$("#pages").css("-webkit-transform-origin", "0 0");
});
});
......@@ -31,6 +31,21 @@
<button id="debug" class="button">Debug</button>
<button id="spread" class="button">Spread</button>
<button id="hi-res" class="button">Hi-res</button>
<div class="dropdown">
<button id="zoom" class="button">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 id="toc">
<button id="goto" class="button" href="#">Go to</button>
<ul id="toc-pages"></ul>
......
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