]> _ Git - fluidbook-html5.git/commitdiff
wip #2657 @6
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 6 May 2019 08:58:40 +0000 (10:58 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 6 May 2019 08:58:40 +0000 (10:58 +0200)
js/libs/fluidbook/fluidbook.mobilefirst.js
style/mobilefirst.less

index 1d035550a04b50896d64eb673734d17dc08bf50b..e7be4238c45a97184418ab36d32e25847bbfdfc0 100644 (file)
@@ -10,12 +10,29 @@ function FluidbookMobileFirst(fluidbook) {
 
 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);
 
@@ -47,7 +64,8 @@ FluidbookMobileFirst.prototype = {
         $("#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();
@@ -60,7 +78,7 @@ FluidbookMobileFirst.prototype = {
     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});
@@ -69,7 +87,7 @@ FluidbookMobileFirst.prototype = {
 
     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>';
         }
@@ -77,7 +95,7 @@ FluidbookMobileFirst.prototype = {
         if (visibility.next) {
             footer += '<a class="next" href="#/page/' + (page + 1) + '">' + __('Next') + getSpriteIcon('interface-next-simple') + '</a>';
         }
-        footer += '</div>';
+        footer += '</div></div>';
 
         return footer;
     },
index bf159e3f2971b9c1df510fa2bc092f05e089adc3..da5c12f4dcd180d7c8fcc699b7d2f7bcb6f30694 100644 (file)
     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 {
@@ -92,7 +99,7 @@
     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