@internetstiftelsen/styleguide 2.24.36 → 2.24.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,14 +87,14 @@ function animateProgressBar() {
87
87
 
88
88
  function isInViewport(element) {
89
89
  var top = element.offsetTop;
90
- // const height = element.offsetHeight;
90
+ var height = element.offsetHeight;
91
91
 
92
92
  while (element.offsetParent) {
93
93
  element = element.offsetParent; // eslint-disable-line
94
94
  top += element.offsetTop;
95
95
  }
96
96
 
97
- return top < window.scrollY + window.innerHeight && top > window.scrollY;
97
+ return top < window.scrollY + window.innerHeight && top + height / 4 > window.scrollY;
98
98
  }
99
99
 
100
100
  function decadeIsVisible() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "2.24.36",
3
+ "version": "2.24.38",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
@@ -81,7 +81,7 @@ function animateProgressBar() {
81
81
 
82
82
  function isInViewport(element) {
83
83
  let top = element.offsetTop;
84
- // const height = element.offsetHeight;
84
+ const height = element.offsetHeight;
85
85
 
86
86
  while (element.offsetParent) {
87
87
  element = element.offsetParent; // eslint-disable-line
@@ -90,7 +90,7 @@ function isInViewport(element) {
90
90
 
91
91
  return (
92
92
  top < (window.scrollY + window.innerHeight)
93
- && top > window.scrollY
93
+ && (top + height / 4) > window.scrollY
94
94
  );
95
95
  }
96
96