rytm-webflow 2.1.8 → 2.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rytm-webflow",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "description": "rytm webflow pack - ASwap, ShowUp",
5
5
  "main": "scripts/index.js",
6
6
  "scripts": {
@@ -217,16 +217,21 @@ class WebflowView extends View {
217
217
  });
218
218
  // on scene add event
219
219
  scene.on("add", (e) => {
220
- if (elementIsVisibleInViewport(el, true)) {
220
+ // wait 10ms before checking if element is in view
221
+ // due to asap scroll position reset
222
+ setTimeout(() => {
221
223
  // element is in view - animate IN
222
- gsap.to(el, {
223
- duration: propsShow.time,
224
- ...propsShow.tween,
225
- onComplete: () => {
226
- el.classList.add(CLASS_NAME_WEBSCROLL_FIRED);
227
- }
228
- });
229
- }
224
+ if (elementIsVisibleInViewport(el, true)) {
225
+ console.log("Timeout", el);
226
+ gsap.to(el, {
227
+ duration: propsShow.time,
228
+ ...propsShow.tween,
229
+ onComplete: () => {
230
+ el.classList.add(CLASS_NAME_WEBSCROLL_FIRED);
231
+ }
232
+ });
233
+ }
234
+ }, 10);
230
235
  });
231
236
  scene.addTo(scrollController.get());
232
237
  this.scenes.push(scene);