rytm-webflow 2.1.5 → 2.1.6

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
@@ -297,11 +297,15 @@ RytmWebflow.aswap.init({
297
297
  }
298
298
  })
299
299
  ```
300
- Add data attributes to the cointainer element. Inside the container place elements that include the `webscroll` data attributes (initial, show, hide):
300
+ Add data attributes to the cointainer element. Inside the element grabbed by the selector place elements that include the `webscroll` data attributes (initial, show, hide):
301
301
  ```html
302
302
  <div id="stage">
303
303
  <ul data-as-view="list" data-as-id="uid" data-webset="selector:li,stagger:.1">
304
- <li data-webscroll-initial="o:0" data-webscroll-show="o:1,t:.5" data-webscroll-hide="o:0,t.4">...</li>
304
+ <li>
305
+ <div data-webscroll-initial="o:0" data-webscroll-show="o:1,t:.5" data-webscroll-hide="o:0,t.4">
306
+ ...
307
+ </div>
308
+ </li>
305
309
  </ul>
306
310
  </div>
307
311
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rytm-webflow",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "rytm webflow pack - ASwap, ShowUp",
5
5
  "main": "scripts/index.js",
6
6
  "scripts": {
@@ -58,8 +58,14 @@ class WebflowListView extends View {
58
58
  delay = delay + (propsShow.tween.delay || 0);
59
59
  gsap.killTweensOf(el);
60
60
  gsap.set(el, {...propsInitial.tween});
61
- gsap.to(el, {duration: propsShow.time, ...propsShow.tween, delay});
62
- el.classList.add(CLASS_NAME_WEBSCROLL_FIRED);
61
+ gsap.to(el, {
62
+ duration: propsShow.time,
63
+ ...propsShow.tween,
64
+ delay,
65
+ onComplete: () => {
66
+ el.classList.add(CLASS_NAME_WEBSCROLL_FIRED);
67
+ }
68
+ });
63
69
  }
64
70
  }
65
71
  /**
@@ -205,8 +205,13 @@ class WebflowView extends View {
205
205
  if (e.scrollDirection === "FORWARD") {
206
206
  gsap.killTweensOf(el);
207
207
  gsap.set(el, {...propsInitial.tween});
208
- gsap.to(el, {duration: propsShow.time, ...propsShow.tween});
209
- el.classList.add(CLASS_NAME_WEBSCROLL_FIRED);
208
+ gsap.to(el, {
209
+ duration: propsShow.time,
210
+ ...propsShow.tween,
211
+ onComplete: () => {
212
+ el.classList.add(CLASS_NAME_WEBSCROLL_FIRED);
213
+ }
214
+ });
210
215
  }
211
216
  });
212
217
  scene.addTo(scrollController.get());