@iris.interactive/handcook 5.0.9 → 5.0.10

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.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Welcome to HandCook 👨‍🍳
2
- ![Version](https://img.shields.io/badge/version-5.0.9-blue.svg?cacheSeconds=2592000)
2
+ ![Version](https://img.shields.io/badge/version-5.0.10-blue.svg?cacheSeconds=2592000)
3
3
  ![Prerequisite](https://img.shields.io/badge/node-%3E%3D%2012.14.0-blue.svg)
4
4
  [![License: UNLICENSED](https://img.shields.io/badge/License-UNLICENSED-yellow.svg)](#)
5
5
  [![Twitter: captain\_iris](https://img.shields.io/twitter/follow/captain\_iris.svg?style=social)](https://twitter.com/captain\_iris)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iris.interactive/handcook",
3
- "version": "5.0.9",
3
+ "version": "5.0.10",
4
4
  "description": "The web cooking by IRIS Interactive",
5
5
  "main": "./public/scripts/index.js",
6
6
  "scripts": {
@@ -29,7 +29,7 @@ export class HcScrollReveal {
29
29
  constructor() {
30
30
 
31
31
  //Get all scrollreveal elements
32
- const items = Array.prototype.slice.call(document.querySelectorAll(ElementEnum.scrollRevealParent)).concat(Array.prototype.slice.call(document.querySelectorAll(ElementEnum.scrollReveal))).concat(Array.prototype.slice.call(document.querySelectorAll(ElementEnum.scrollRevealChildren)));
32
+ const items = Array.prototype.slice.call(document.querySelectorAll(ElementEnum.scrollReveal)).concat(Array.prototype.slice.call(document.querySelectorAll(ElementEnum.scrollRevealChildren)));
33
33
 
34
34
  //Init scrollreveal
35
35
  HcScrollReveal.init(items);
@@ -40,8 +40,8 @@ export class HcScrollReveal {
40
40
  let childRowCount = 1;
41
41
  const observerOptions = {
42
42
  root: null,
43
- rootMargin: '-10px 0px -10px 0px',
44
- threshold: 0.1
43
+ rootMargin: '-20px 0px -20px 0px',
44
+ threshold: 0
45
45
  }
46
46
 
47
47
  const observer = new IntersectionObserver((entries) => {
@@ -61,18 +61,12 @@ export class HcScrollReveal {
61
61
  let isChild = false;
62
62
 
63
63
  //Get options
64
- if (item.hasAttribute('data-hc-scroll-reveal')) {
65
- options = HcScrollReveal.getOptions(item);
66
- } else {
64
+ if (!item.hasAttribute('data-hc-scroll-reveal-parent') && !item.hasAttribute('data-hc-scroll-reveal') && !item.hasAttribute('data-hc-noscroll-reveal')) {
67
65
  let parent = item.parentElement;
68
-
69
- if (item.hasAttribute('data-hc-scroll-reveal-parent') && parent.hasAttribute('data-hc-scroll-reveal-parent')) {
70
- isChild = true;
71
- } else if (!item.hasAttribute('data-hc-noscroll-reveal')) {
72
- isChild = true;
73
- }
74
-
66
+ isChild = true;
75
67
  options = HcScrollReveal.getOptions(parent);
68
+ } else {
69
+ options = HcScrollReveal.getOptions(item);
76
70
  }
77
71
 
78
72
  //Apply options if different than default
@@ -93,7 +87,7 @@ export class HcScrollReveal {
93
87
  }
94
88
 
95
89
  //Interval on items in same row
96
- if (options.interval !== HcScrollReveal.intervalDefault && options.interval !== null && options.delay !== null) {
90
+ if (options.interval !== null && options.delay !== null) {
97
91
  if (isChild) {
98
92
  if (childOffset == item.offsetTop) {
99
93
  let delayValue = parseInt(options.delay.replace('ms', ''));
@@ -4,7 +4,7 @@
4
4
  --hc-scroll-reveal-distance: 0px;
5
5
  --hc-scroll-reveal-delay: 200ms;
6
6
  --hc-scroll-reveal-duration: 800ms;
7
- --hc-scroll-reveal-interval: 0ms;
7
+ --hc-scroll-reveal-interval: 200ms;
8
8
  --hc-scroll-reveal-origin: bottom;
9
9
  --hc-scroll-reveal-timing-function: ease;
10
10
  --hc-scroll-reveal-translate: translateY(0);