-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,631 additions
and
9 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
export default class Ukiyo { | ||
private elements; | ||
private options; | ||
private instances; | ||
private externalRAF; | ||
private requestId?; | ||
private timer?; | ||
private onResizeEvent; | ||
private isInit; | ||
private constructor(); | ||
/** | ||
* Initializes | ||
*/ | ||
private init; | ||
/** | ||
* Animation | ||
*/ | ||
animate(): void; | ||
/** | ||
* Cancel animation | ||
*/ | ||
private cancel; | ||
/** | ||
* Reset all instances | ||
*/ | ||
reset(): void; | ||
/** | ||
* Resize event | ||
*/ | ||
private resize; | ||
/** | ||
* Add event listeners | ||
*/ | ||
private addEventListeners; | ||
/** | ||
* Destroy all instances | ||
*/ | ||
destroy(): void; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export declare const defaults: { | ||
scale: number; | ||
speed: number; | ||
wrapperClass: null; | ||
willChange: boolean; | ||
externalRAF: boolean; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import type { UkiyoOptions } from '../types/index'; | ||
/** | ||
* Parallax class | ||
*/ | ||
export declare class Parallax { | ||
private options; | ||
private element; | ||
private wrapper; | ||
private overflow?; | ||
private vh; | ||
private observer?; | ||
private isVisible; | ||
private wrapperHeight?; | ||
private damp; | ||
private elementTagName; | ||
constructor(element: HTMLElement, options: Partial<UkiyoOptions>); | ||
/** | ||
* Create Parallax | ||
*/ | ||
private createParallax; | ||
/** | ||
* Update options | ||
*/ | ||
private updateOptions; | ||
/** | ||
* Sets the style of an element | ||
*/ | ||
private setStyle; | ||
/** | ||
* Wrap element | ||
*/ | ||
private wrapElement; | ||
/** | ||
* Check visible | ||
*/ | ||
private checkVisible; | ||
/** | ||
* Create Observer | ||
*/ | ||
private createObserver; | ||
/** | ||
* Observer callback | ||
*/ | ||
private handleIntersect; | ||
/** | ||
* OnEnter | ||
*/ | ||
private onEnter; | ||
/** | ||
* OnLeave | ||
*/ | ||
private onLeave; | ||
/** | ||
* Calculating the value of parallax | ||
*/ | ||
private calcTranslateValue; | ||
/** | ||
* Calculate parallax damp | ||
*/ | ||
private calcDamp; | ||
/** | ||
* Set the parallax value to element | ||
*/ | ||
private transformParallax; | ||
/** | ||
* Animate parallax | ||
*/ | ||
animate(): void; | ||
/** | ||
* Reset parallax | ||
*/ | ||
reset(): void; | ||
/** | ||
* Destroy instance | ||
*/ | ||
destroy(): void; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { TElement } from '../types/index'; | ||
/** | ||
* Check if the current browser supports the required features | ||
*/ | ||
export declare const isSupportedBrowser: () => boolean; | ||
/** | ||
* Determine if an image is loaded | ||
*/ | ||
export declare const isImageLoaded: (src: string) => Promise<HTMLImageElement>; | ||
/** | ||
* Get an array of elements | ||
*/ | ||
export declare const getElements: (elements: TElement) => HTMLElement[]; | ||
/** | ||
* Determine if the current browser is Safari on iOS | ||
*/ | ||
export declare const isSPSafari: () => boolean; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.