FluidbookMobileFirst.prototype = {
init: function () {
+ var $this = this;
$("html").addClass('mobilefirst');
$("#scroll").append($('#shadow'));
$("#shadow .side").remove();
+ $("#scroll").on('scroll', function () {
+ $this.checkScroll($(this).scrollTop());
+ });
this.fluidbook.datas.soundTheme = '';
},
+ checkScroll: function (top) {
+ if (!this.fluidbook.pagetransitions.canChangePage()) {
+ return;
+ }
+ var nav = $("#pages .mf-nav");
+ var reveal=$(nav).find('.reveal');
+ var navrect = nav.get(0).getBoundingClientRect();
+ if (navrect.top < this.fluidbook.resize.hh && reveal.hasClass('toreveal')) {
+ console.log('reveal');
+ reveal.removeClass('toreveal');
+ }
+ },
+
triggerTransition: function (page) {
this.fluidbook.pagetransitions.getTurningPages(page);
$("#pages").append(this.getFooterNavigation(page));
setTimeout(function () {
- $('#pages .mf-nav').css('opacity', 1);
+ $("#pages .mf-nav").css('opacity', 1);
+ $('#pages .mf-nav .reveal').addClass('toreveal');
}, 10);
this.fluidbook.resize.resize();
resize: function () {
var bh = $("#currentDoublePage").outerHeight();
$('#pages .mf-nav').css('top', bh);
- $("#links,#searchHighlights,#shadow").css({height: bh});
+ $("#links,#searchHighlights,#shadow").css({height: bh, maxHeight: bh});
var h = bh + $("#pages .mf-nav").outerHeight();
$("#pages,#fluidbook").css({height: h});
getFooterNavigation: function (page) {
var visibility = this.fluidbook.getButtonsVisibility(page);
- var footer = '<div class="mf-nav">';
+ var footer = '<div class="mf-nav"><div class="reveal">';
if (visibility.previous) {
footer += '<a class="previous" href="#/page/' + (page - 1) + '">' + getSpriteIcon('interface-previous-simple') + __('Previous') + '</a>';
}
if (visibility.next) {
footer += '<a class="next" href="#/page/' + (page + 1) + '">' + __('Next') + getSpriteIcon('interface-next-simple') + '</a>';
}
- footer += '</div>';
+ footer += '</div></div>';
return footer;
},
overflow: visible;
}
+ #links {
+ &.right {
+ left: 0;
+ }
+ }
+
.portrait {
.doublePage {
&._2d.axis_x {
.mf-nav {
+ @mfscale: 0.75;
+
position: absolute;
left: 0;
width: 100%;
- height: unit(110*@css-scale, px);
- padding: unit(30*@css-scale, px) 0;
+ height: unit(110*@css-scale*@mfscale, px);
+ overflow: hidden;
color: @page-number-color;
- font-size: unit(20*@css-scale, px);
+ font-size: unit(20*@css-scale*@mfscale, px);
font-weight: 600;
- transition: opacity 0.1s;
- opacity: 0;
+ transition: opacity .15s;
@media @small {
@s: 1.25;
- font-size: unit(20*@s*@css-scale, px);
- padding: unit(30*@s*@css-scale, px) 0;
- height: unit(110*@s*@css-scale, px);
+ font-size: unit(20*@s*@css-scale*@mfscale, px);
+ padding: unit(30*@s*@css-scale*@mfscale, px) 0;
+ height: unit(110*@s*@css-scale*@mfscale, px);
}
span {
position: absolute;
top: 1.5em;
height: 2.5em;
- width: 30%;
+ width: 25%;
text-align: center;
padding-top: 0.7em;
@media @small {
width: auto;
}
}
+
+ .reveal {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ transition: all .6s;
+ padding: unit(30*@css-scale*@mfscale, px) 0;
+
+ &.toreveal {
+ opacity: 0;
+ top: 30px;
+ }
+ }
}
\ No newline at end of file