]> _ Git - fluidbook-html5.git/commitdiff
wip #2657 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 4 Apr 2019 12:30:14 +0000 (14:30 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 4 Apr 2019 12:30:14 +0000 (14:30 +0200)
js/libs/fluidbook/fluidbook.mobilefirst.js
js/libs/fluidbook/fluidbook.touch.js
style/mobilefirst.less

index 041f2efc0b717cca5ef388e2dab24080d2891551..d00d094144562a9c304138143127504139ebfe1c 100644 (file)
@@ -11,35 +11,46 @@ function FluidbookMobileFirst(fluidbook) {
 FluidbookMobileFirst.prototype = {
     init: function () {
         $("html").addClass('mobilefirst');
+        $("#scroll").append($('#shadow'));
+        $("#shadow .side").remove();
         this.fluidbook.datas.soundTheme = '';
     },
 
     beforeTransition: function (page) {
         var dimensions = this.fluidbook.loader.getPageDimensions(page);
+        $('#pages .mf-nav').css('opacity', 0);
+        var max = Math.max(dimensions.height, $("#currentDoublePage").outerHeight());
         $("#nextDoublePage .page, #nextDoublePage").css({
             height: dimensions.height,
             maxHeight: dimensions.height
         });
 
+        $("#pages,#fluidbook").css({height: max, maxHeight: max});
+
         TweenLite.to("#scroll", this.fluidbook.pagetransitions.getTransitionDuration(page), {scrollTo: 0});
     },
 
     afterTransition: function (page) {
         $('#pages .mf-nav').remove();
         $("#pages").append(this.getFooterNavigation(page));
+
+        setTimeout(function () {
+            $('#pages .mf-nav').css('opacity', 1);
+        }, 10);
+
         this.fluidbook.resize.resize();
-        var $this=this;
-        setTimeout(function(){
+        var $this = this;
+        setTimeout(function () {
             this.fluidbook.resize.resize();
-        },1000);
+        }, 1000);
     },
 
     resize: function () {
         var bh = $("#currentDoublePage").outerHeight();
         $('#pages .mf-nav').css('top', bh);
-        var h = bh+$("#pages .mf-nav").outerHeight();
+        $("#links,#searchHighlights,#shadow").css({height: bh});
 
-        $("#links,#searchHighlights").css({height:bh});
+        var h = bh + $("#pages .mf-nav").outerHeight();
         $("#pages,#fluidbook").css({height: h});
         $("#pages").css('maxHeight', h);
     },
index cc867e5f35e9d82336281aee655fc82f535adda3..9dce2ddff94fca2d64cc456032a501c5ee37905e 100644 (file)
@@ -88,15 +88,18 @@ FluidbookTouch.prototype = {
         hmf.add(new Hammer.Pan({threshold: 0}));
         hmf.on('panmove', function (event) {
             console.log('panmove');
-            $this.drag(event);
-            event.preventDefault();
+            if ($this.drag(event)) {
+                event.preventDefault();
+            }
         });
         hmf.on('panend', function (event) {
             console.log('panend');
-            $this.drag(event, true);
+            var prevent = $this.drag(event, true);
             $this.startX = $this.startY = -1;
             $this.panX = $this.panY = 0;
-            event.preventDefault();
+            if (prevent) {
+                event.preventDefault();
+            }
         });
     },
 
index 8aac51fc93db30691751b73c8e565e9ef2f9aba7..acb337ec813075e3095a4fecaa712b12c5f2baf0 100644 (file)
@@ -1,6 +1,15 @@
-#shadow {
-  .mobilefirst & {
-    display: none;
+.mobilefirst {
+  #shadow {
+    box-shadow: rgba(0, 0, 0, @shadow-opacity) 0 0 10px;
+
+    .shadow.bottom {
+      height: 80px;
+      bottom: -80px;
+      background-size: unit(@book-page-width - 10, px) 80px;
+      background-position: 50% 100%;
+      background-repeat: no-repeat;
+      opacity: @shadow-opacity*0.25;
+    }
   }
 }
 
@@ -13,6 +22,9 @@
   color: @page-number-color;
   font-size: unit(20*@css-scale, px);
   font-weight: 600;
+  transition: opacity 0.25s;
+  opacity: 0;
+
   @media @small {
     @s: 1.25;
     font-size: unit(20*@s*@css-scale, px);