@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
|
-

|
|
3
3
|

|
|
4
4
|
[](#)
|
|
5
5
|
[](https://twitter.com/captain\_iris)
|
package/package.json
CHANGED
|
@@ -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.
|
|
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: '-
|
|
44
|
-
threshold: 0
|
|
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 !==
|
|
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:
|
|
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);
|