-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
arzafran
committed
Nov 7, 2022
1 parent
fe2f54e
commit b2d1829
Showing
11 changed files
with
105 additions
and
125 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,115 +1,95 @@ | ||
export default class Lenis { | ||
/** | ||
* @typedef {(t: number) => number} EasingFunction | ||
* @typedef {'vertical' | 'horizontal'} Direction | ||
* @typedef {'vertical' | 'horizontal' | 'both'} GestureDirection | ||
* | ||
* @typedef LenisOptions | ||
* @property {number} [duration] | ||
* @property {EasingFunction} [easing] | ||
* @property {boolean} [smooth] | ||
* @property {number} [mouseMultiplier] | ||
* @property {boolean} [smoothTouch] | ||
* @property {number} [touchMultiplier] | ||
* @property {Direction} [direction] | ||
* @property {GestureDirection} [gestureDirection] | ||
* @property {boolean} [infinite] | ||
* @property {Window | HTMLElement} [wrapper] | ||
* @property {HTMLElement} [content] | ||
* | ||
* @param {LenisOptions} | ||
*/ | ||
constructor({ duration, easing, smooth, mouseMultiplier, smoothTouch, touchMultiplier, direction, gestureDirection, infinite, wrapper, content, }?: { | ||
duration?: number; | ||
easing?: (t: number) => number; | ||
smooth?: boolean; | ||
mouseMultiplier?: number; | ||
smoothTouch?: boolean; | ||
touchMultiplier?: number; | ||
direction?: "vertical" | "horizontal"; | ||
gestureDirection?: "vertical" | "horizontal" | "both"; | ||
infinite?: boolean; | ||
wrapper?: Window | HTMLElement; | ||
content?: HTMLElement; | ||
}); | ||
options: { | ||
duration: number; | ||
easing: (t: number) => number; | ||
smooth: boolean; | ||
mouseMultiplier: number; | ||
smoothTouch: boolean; | ||
touchMultiplier: number; | ||
direction: "vertical" | "horizontal"; | ||
gestureDirection: "vertical" | "horizontal" | "both"; | ||
infinite: boolean; | ||
wrapper: Window | HTMLElement; | ||
content: HTMLElement; | ||
}; | ||
duration: number; | ||
easing: (t: number) => number; | ||
smooth: boolean; | ||
mouseMultiplier: number; | ||
smoothTouch: boolean; | ||
touchMultiplier: number; | ||
direction: "vertical" | "horizontal"; | ||
gestureDirection: "vertical" | "horizontal" | "both"; | ||
infinite: boolean; | ||
wrapperNode: Window | HTMLElement; | ||
contentNode: HTMLElement; | ||
wrapperHeight: any; | ||
wrapperWidth: any; | ||
wrapperObserver: ResizeObserver; | ||
contentHeight: number; | ||
contentWidth: number; | ||
contentObserver: ResizeObserver; | ||
targetScroll: any; | ||
scroll: any; | ||
lastScroll: any; | ||
animate: Animate; | ||
virtualScroll: any; | ||
get scrollProperty(): string; | ||
start(): void; | ||
stopped: boolean; | ||
stop(): void; | ||
destroy(): void; | ||
onWindowResize: () => void; | ||
onWrapperResize: ([entry]: [any]) => void; | ||
onContentResize: ([entry]: [any]) => void; | ||
get limit(): number; | ||
onVirtualScroll: ({ deltaY, deltaX, originalEvent: e }: { | ||
deltaY: any; | ||
deltaX: any; | ||
originalEvent: any; | ||
}) => void; | ||
raf(now: any): void; | ||
now: any; | ||
isScrolling: boolean; | ||
get velocity(): number; | ||
setScroll(value: any): void; | ||
onScroll: (e: any) => void; | ||
notify(): void; | ||
scrollTo(target: any, { offset, immediate, duration, easing, }?: { | ||
offset?: number; | ||
immediate?: boolean; | ||
duration?: number; | ||
easing?: (t: number) => number; | ||
}): void; | ||
} | ||
declare class Animate { | ||
to(target: any, { duration, easing, ...keys }?: { | ||
duration?: number; | ||
easing?: (t: any) => any; | ||
}): void; | ||
target: any; | ||
fromKeys: {}; | ||
toKeys: {}; | ||
keys: string[]; | ||
duration: number; | ||
easing: (t: any) => any; | ||
currentTime: any; | ||
isRunning: boolean; | ||
stop(): void; | ||
raf(deltaTime: any): void; | ||
get progress(): number; | ||
} | ||
export {}; | ||
export default class Lenis { | ||
constructor({ duration, easing, smooth, mouseMultiplier, smoothTouch, touchMultiplier, direction, gestureDirection, infinite, wrapper, content, }?: { | ||
duration?: number; | ||
easing?: (t: number) => number; | ||
smooth?: boolean; | ||
mouseMultiplier?: number; | ||
smoothTouch?: boolean; | ||
touchMultiplier?: number; | ||
direction?: "vertical" | "horizontal"; | ||
gestureDirection?: "both" | "vertical" | "horizontal"; | ||
infinite?: boolean; | ||
wrapper?: Window | HTMLElement; | ||
content?: HTMLElement; | ||
}); | ||
options: { | ||
duration: number; | ||
easing: (t: number) => number; | ||
smooth: boolean; | ||
mouseMultiplier: number; | ||
smoothTouch: boolean; | ||
touchMultiplier: number; | ||
direction: "vertical" | "horizontal"; | ||
gestureDirection: "both" | "vertical" | "horizontal"; | ||
infinite: boolean; | ||
wrapper: HTMLElement | Window; | ||
content: HTMLElement; | ||
}; | ||
duration: number; | ||
easing: (t: number) => number; | ||
smooth: boolean; | ||
mouseMultiplier: number; | ||
smoothTouch: boolean; | ||
touchMultiplier: number; | ||
direction: "vertical" | "horizontal"; | ||
gestureDirection: "both" | "vertical" | "horizontal"; | ||
infinite: boolean; | ||
wrapperNode: HTMLElement | Window; | ||
contentNode: HTMLElement; | ||
wrapperHeight: any; | ||
wrapperWidth: any; | ||
wrapperObserver: ResizeObserver; | ||
contentHeight: number; | ||
contentWidth: number; | ||
contentObserver: ResizeObserver; | ||
targetScroll: any; | ||
scroll: any; | ||
lastScroll: any; | ||
animate: Animate; | ||
virtualScroll: any; | ||
get scrollProperty(): string; | ||
start(): void; | ||
stopped: boolean; | ||
stop(): void; | ||
destroy(): void; | ||
onWindowResize: () => void; | ||
onWrapperResize: ([entry]: [any]) => void; | ||
onContentResize: ([entry]: [any]) => void; | ||
get limit(): number; | ||
onVirtualScroll: ({ deltaY, deltaX, originalEvent: e }: { | ||
deltaY: any; | ||
deltaX: any; | ||
originalEvent: any; | ||
}) => void; | ||
raf(now: any): void; | ||
now: any; | ||
isScrolling: boolean; | ||
get velocity(): number; | ||
setScroll(value: any): void; | ||
onScroll: (e: any) => void; | ||
notify(): void; | ||
scrollTo(target: any, { offset, immediate, duration, easing, }?: { | ||
offset?: number; | ||
immediate?: boolean; | ||
duration?: number; | ||
easing?: (t: number) => number; | ||
}): void; | ||
} | ||
declare class Animate { | ||
to(target: any, { duration, easing, ...keys }?: { | ||
duration?: number; | ||
easing?: (t: any) => any; | ||
}): void; | ||
target: any; | ||
fromKeys: {}; | ||
toKeys: {}; | ||
keys: string[]; | ||
duration: number; | ||
easing: (t: any) => any; | ||
currentTime: any; | ||
isRunning: boolean; | ||
stop(): void; | ||
raf(deltaTime: any): void; | ||
get progress(): number; | ||
} | ||
export {}; |
Oops, something went wrong.
b2d1829
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
lenis – ./
lenis-studio-freight.vercel.app
lenis.vercel.app
lenis.studiofreight.com
lenis-git-main-studio-freight.vercel.app
b2d1829
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"⚡️ Lighthouse report for the changes in this commit:
🔴 Performance: 47
🟢 Accessibility: 100
🟢 Best practices: 92
🟢 SEO: 92
🟢 PWA: 100
Lighthouse ran on https://lenis-goaf3tsso-studio-freight.vercel.app/"