-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ handle tweens update + 🚨 alerting on bad triggerOffset
- Loading branch information
Showing
4 changed files
with
74 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,20 +167,31 @@ export class Detect extends Tween { | |
return; | ||
} | ||
|
||
// Handling all tweens global reset during resize (debounced by using static method). | ||
Tween._handleResize(); | ||
// Update tweens positions and specific features. | ||
this.update(); | ||
}, | ||
outerHeight: (val: number) => { | ||
if (!val) { | ||
return; | ||
} | ||
|
||
// Handling all tweens global reset during resize (debounced by using static method). | ||
Tween._handleResize(); | ||
// Update tweens positions and specific features. | ||
this.update(); | ||
}, | ||
}); | ||
} | ||
|
||
/** | ||
* @description Update tweens positions and specific features. | ||
* @author Alphability <[email protected]> | ||
* @memberof Detect | ||
*/ | ||
|
||
public update(): void { | ||
// Handling all tweens global reset during resize (debounced by using static method). | ||
Tween._handleResize(); | ||
} | ||
|
||
/** | ||
* @description Destroying the tweens. | ||
* @author Alphability <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,6 +251,23 @@ export class Alice { | |
this._scrollEventHandler(); | ||
} | ||
|
||
/** | ||
* @description Update tweens positions and specific features. | ||
* @author Alphability <[email protected]> | ||
* @returns {void} | ||
* @memberof Alice | ||
*/ | ||
|
||
public update(): void { | ||
// We can't boot scroll values if Alice has not been initialized. | ||
if (!this._isInitialized) { | ||
return; | ||
} | ||
|
||
Alice._detect.update(); | ||
Alice._speed.update(); | ||
} | ||
|
||
/** | ||
* @description Reactive scroll properties object's getter. | ||
* @readonly | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -285,26 +285,34 @@ export class Speed extends Tween { | |
return; | ||
} | ||
|
||
// Clear transforms before cleaning tweens | ||
this._handleSpeedResize(); | ||
|
||
// Handling all tweens global reset during resize (debounced by using static method). | ||
Tween._handleResize(); | ||
// Update tweens positions and specific features. | ||
this.update(); | ||
}, | ||
outerHeight: (val) => { | ||
if (!val) { | ||
return; | ||
} | ||
|
||
// Clear transforms before cleaning tweens | ||
this._handleSpeedResize(); | ||
|
||
// Handling all tweens global reset during resize (debounced by using static method). | ||
Tween._handleResize(); | ||
// Update tweens positions and specific features. | ||
this.update(); | ||
}, | ||
}); | ||
} | ||
|
||
/** | ||
* @description Update tweens positions and specific features. | ||
* @author Alphability <[email protected]> | ||
* @memberof Speed | ||
*/ | ||
|
||
public update(): void { | ||
// Clear transforms before cleaning tweens | ||
this._handleSpeedResize(); | ||
|
||
// Handling all tweens global reset during resize (debounced by using static method). | ||
Tween._handleResize(); | ||
} | ||
|
||
/** | ||
* @description Destroying the tweens. | ||
* @author Alphability <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters