]> git.ipfire.org Git - thirdparty/bulma.git/commitdiff
Fix scroll factor
authorJeremy Thomas <bbxdesign@gmail.com>
Thu, 26 Oct 2017 19:00:25 +0000 (20:00 +0100)
committerJeremy Thomas <bbxdesign@gmail.com>
Mon, 6 Nov 2017 12:51:20 +0000 (12:51 +0000)
docs/_javascript/main.js
docs/_sass/specific.sass
docs/css/bulma-docs.css
docs/lib/main.js

index 4130d3eb3c31f5fee7da20c1ad6ee18899ac34f5..4c6bfc184fe7fe47a44262c212602e8c89bf0b80 100644 (file)
@@ -174,7 +174,7 @@ document.addEventListener('DOMContentLoaded', () => {
   let pinned = false;
   let horizon = navbarHeight;
   let whereYouStoppedScrolling = 0;
-  let threshold = 200;
+  let threshold = 160;
   let scrollFactor = 0;
 
   navbarBurger.addEventListener('click', el => {
@@ -227,10 +227,12 @@ document.addEventListener('DOMContentLoaded', () => {
       transform: translateY(${translateValue}px);
     `;
 
-    if (currentY > threshold) {
+    if (currentY > threshold * 2) {
       scrollFactor = 1;
+    } else if (currentY > threshold) {
+      scrollFactor = (currentY - threshold) / threshold;
     } else {
-      scrollFactor = currentY / threshold;
+      scrollFactor = 0;
     }
     specialShadow.style.opacity = scrollFactor;
     specialShadow.style.transform = 'scaleY(' + translateFactor + ')';
index 858d9951726e966f5baf73cacf7eaf9b9be09e65..7d8f0296194c3f7599441df2b3f6c3d4d2412abb 100644 (file)
@@ -1,6 +1,6 @@
 .bd-special-shadow
   background-image: linear-gradient(rgba(#000, 0.1), rgba(#000, 0))
-  height: 10px
+  height: 8px
   left: 0
   opacity: 0
   position: absolute
index c07e8186e8996667137189f613c902ac86e48cce..9af8897a959dc1e68dbf484861d597984779e9e1 100644 (file)
@@ -10356,7 +10356,7 @@ svg {
 
 .bd-special-shadow {
   background-image: linear-gradient(rgba(0, 0, 0, 0.1), transparent);
-  height: 10px;
+  height: 8px;
   left: 0;
   opacity: 0;
   position: absolute;
index 5a433b71d75995c86cb921cbf8b9df283ae34a64..41749518d8da1bed40bbcebdb77e39f8f6d1dc2f 100644 (file)
@@ -176,7 +176,7 @@ document.addEventListener('DOMContentLoaded', function () {
   var pinned = false;
   var horizon = navbarHeight;
   var whereYouStoppedScrolling = 0;
-  var threshold = 200;
+  var threshold = 160;
   var scrollFactor = 0;
 
   navbarBurger.addEventListener('click', function (el) {
@@ -227,10 +227,12 @@ document.addEventListener('DOMContentLoaded', function () {
     var translateFactor = 1 + translateValue / navbarHeight;
     var navbarStyle = '\n      transform: translateY(' + translateValue + 'px);\n    ';
 
-    if (currentY > threshold) {
+    if (currentY > threshold * 2) {
       scrollFactor = 1;
+    } else if (currentY > threshold) {
+      scrollFactor = (currentY - threshold) / threshold;
     } else {
-      scrollFactor = currentY / threshold;
+      scrollFactor = 0;
     }
     specialShadow.style.opacity = scrollFactor;
     specialShadow.style.transform = 'scaleY(' + translateFactor + ')';