main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

105
node_modules/lenis/dist/lenis-react.d.ts generated vendored Normal file
View File

@@ -0,0 +1,105 @@
import * as Lenis from 'lenis';
import Lenis__default, { ScrollCallback, LenisOptions } from 'lenis';
import * as react from 'react';
import { ComponentPropsWithoutRef, ReactNode } from 'react';
type LenisContextValue = {
lenis: Lenis__default;
addCallback: (callback: ScrollCallback, priority: number) => void;
removeCallback: (callback: ScrollCallback) => void;
};
type LenisProps = ComponentPropsWithoutRef<'div'> & {
/**
* Setup a global instance of Lenis
* if `asChild`, the component will render wrapper and content divs
* @default false
*/
root?: boolean | 'asChild';
/**
* Lenis options
*/
options?: LenisOptions;
/**
* Auto-setup requestAnimationFrame
* @default true
* @deprecated use options.autoRaf instead
*/
autoRaf?: boolean;
/**
* Children
*/
children?: ReactNode;
};
type LenisRef = {
/**
* The wrapper div element
*
* Will only be defined if `root` is `false` or `root` is `asChild`
*/
wrapper: HTMLDivElement | null;
/**
* The content div element
*
* Will only be defined if `root` is `false` or `root` is `asChild`
*/
content: HTMLDivElement | null;
/**
* The lenis instance
*/
lenis?: Lenis__default;
};
declare const LenisContext: react.Context<LenisContextValue | null>;
/**
* React component to setup a Lenis instance
*/
declare const ReactLenis: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
root?: boolean | "asChild";
options?: Lenis.LenisOptions;
autoRaf?: boolean;
children?: react.ReactNode;
} & react.RefAttributes<LenisRef>>;
/**
* Hook to access the Lenis instance and its methods
*
* @example <caption>Scroll callback</caption>
* useLenis((lenis) => {
* if (lenis.isScrolling) {
* console.log('Scrolling...')
* }
*
* if (lenis.progress === 1) {
* console.log('At the end!')
* }
* })
*
* @example <caption>Scroll callback with dependencies</caption>
* useLenis((lenis) => {
* if (lenis.isScrolling) {
* console.log('Scrolling...', someDependency)
* }
* }, [someDependency])
* @example <caption>Scroll callback with priority</caption>
* useLenis((lenis) => {
* if (lenis.isScrolling) {
* console.log('Scrolling...')
* }
* }, [], 1)
* @example <caption>Instance access</caption>
* const lenis = useLenis()
*
* handleClick() {
* lenis.scrollTo(100, {
* lerp: 0.1,
* duration: 1,
* easing: (t) => t,
* onComplete: () => {
* console.log('Complete!')
* }
* })
* }
*/
declare function useLenis(callback?: ScrollCallback, deps?: any[], priority?: number): Lenis.default | undefined;
export { ReactLenis as Lenis, LenisContext, type LenisContextValue, type LenisProps, type LenisRef, ReactLenis, ReactLenis as default, useLenis };

156
node_modules/lenis/dist/lenis-react.mjs generated vendored Normal file
View File

@@ -0,0 +1,156 @@
"use client";
// packages/react/src/provider.tsx
import Lenis from "lenis";
import {
createContext,
forwardRef,
useCallback,
useEffect as useEffect2,
useImperativeHandle,
useRef,
useState as useState2
} from "react";
// packages/react/src/store.ts
import { useEffect, useState } from "react";
var Store = class {
constructor(state) {
this.state = state;
}
listeners = [];
set(state) {
this.state = state;
for (let listener of this.listeners) {
listener(this.state);
}
}
subscribe(listener) {
this.listeners = [...this.listeners, listener];
return () => {
this.listeners = this.listeners.filter((l) => l !== listener);
};
}
get() {
return this.state;
}
};
function useStore(store) {
const [state, setState] = useState(store.get());
useEffect(() => {
return store.subscribe((state2) => setState(state2));
}, [store]);
return state;
}
// packages/react/src/provider.tsx
import { jsx } from "react/jsx-runtime";
var LenisContext = createContext(null);
var rootLenisContextStore = new Store(null);
var ReactLenis = forwardRef(
({
children,
root = false,
options = {},
autoRaf = true,
...props
}, ref) => {
const wrapperRef = useRef(null);
const contentRef = useRef(null);
const [lenis, setLenis] = useState2(void 0);
useImperativeHandle(
ref,
() => ({
wrapper: wrapperRef.current,
content: contentRef.current,
lenis
}),
[lenis]
);
useEffect2(() => {
const lenis2 = new Lenis({
...options,
...wrapperRef.current && contentRef.current && {
wrapper: wrapperRef.current,
content: contentRef.current
},
autoRaf: options?.autoRaf ?? autoRaf
// this is to avoid breaking the autoRaf prop if it's still used (require breaking change)
});
setLenis(lenis2);
return () => {
lenis2.destroy();
setLenis(void 0);
};
}, [root, JSON.stringify({ ...options, wrapper: null, content: null })]);
const callbacksRefs = useRef([]);
const addCallback = useCallback(
(callback, priority) => {
callbacksRefs.current.push({ callback, priority });
callbacksRefs.current.sort((a, b) => a.priority - b.priority);
},
[]
);
const removeCallback = useCallback(
(callback) => {
callbacksRefs.current = callbacksRefs.current.filter(
(cb) => cb.callback !== callback
);
},
[]
);
useEffect2(() => {
if (root && lenis) {
rootLenisContextStore.set({ lenis, addCallback, removeCallback });
return () => rootLenisContextStore.set(null);
}
}, [root, lenis, addCallback, removeCallback]);
useEffect2(() => {
if (!lenis) return;
const onScroll = (data) => {
for (let i = 0; i < callbacksRefs.current.length; i++) {
callbacksRefs.current[i]?.callback(data);
}
};
lenis.on("scroll", onScroll);
return () => {
lenis.off("scroll", onScroll);
};
}, [lenis]);
if (!children) return null;
return /* @__PURE__ */ jsx(
LenisContext.Provider,
{
value: { lenis, addCallback, removeCallback },
children: root && root !== "asChild" ? children : /* @__PURE__ */ jsx("div", { ref: wrapperRef, ...props, children: /* @__PURE__ */ jsx("div", { ref: contentRef, children }) })
}
);
}
);
// packages/react/src/use-lenis.ts
import { useContext, useEffect as useEffect3 } from "react";
var fallbackContext = {};
function useLenis(callback, deps = [], priority = 0) {
const localContext = useContext(LenisContext);
const rootContext = useStore(rootLenisContextStore);
const currentContext = localContext ?? rootContext ?? fallbackContext;
const { lenis, addCallback, removeCallback } = currentContext;
useEffect3(() => {
if (!callback || !addCallback || !removeCallback || !lenis) return;
addCallback(callback, priority);
callback(lenis);
return () => {
removeCallback(callback);
};
}, [lenis, addCallback, removeCallback, priority, ...deps]);
return lenis;
}
export {
ReactLenis as Lenis,
LenisContext,
ReactLenis,
ReactLenis as default,
useLenis
};
//# sourceMappingURL=lenis-react.mjs.map

1
node_modules/lenis/dist/lenis-react.mjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

160
node_modules/lenis/dist/lenis-snap.d.ts generated vendored Normal file
View File

@@ -0,0 +1,160 @@
import Lenis, { EasingFunction, VirtualScrollData } from 'lenis';
type SnapElementOptions = {
align?: string | string[];
ignoreSticky?: boolean;
ignoreTransform?: boolean;
};
type Rect = {
top: number;
left: number;
width: number;
height: number;
x: number;
y: number;
bottom: number;
right: number;
element: HTMLElement;
};
declare class SnapElement {
element: HTMLElement;
options: SnapElementOptions;
align: string[];
rect: Rect;
wrapperResizeObserver: ResizeObserver;
resizeObserver: ResizeObserver;
debouncedWrapperResize: () => void;
constructor(element: HTMLElement, { align, ignoreSticky, ignoreTransform, }?: SnapElementOptions);
destroy(): void;
setRect({ top, left, width, height, element, }?: {
top?: number;
left?: number;
width?: number;
height?: number;
element?: HTMLElement;
}): void;
onWrapperResize: () => void;
onResize: ([entry]: ResizeObserverEntry[]) => void;
}
type SnapItem = {
value: number;
};
type OnSnapCallback = (item: SnapItem & {
index?: number;
}) => void;
type SnapOptions = {
/**
* Snap type
* @default 'proximity'
*/
type?: 'mandatory' | 'proximity' | 'lock';
/**
* @description Linear interpolation (lerp) intensity (between 0 and 1)
*/
lerp?: number;
/**
* @description The easing function to use for the snap animation
*/
easing?: EasingFunction;
/**
* @description The duration of the snap animation (in s)
*/
duration?: number;
/**
* @default '50%'
* @description The distance threshold from the snap point to the scroll position. Ignored when `type` is `mandatory`. If a percentage, it is relative to the viewport size. If a number, it is absolute.
*/
distanceThreshold?: number | `${number}%`;
/**
* @default 500
* @description The debounce delay (in ms) to prevent snapping too often.
*/
debounce?: number;
/**
* @description Called when the snap starts
*/
onSnapStart?: OnSnapCallback;
/**
* @description Called when the snap completes
*/
onSnapComplete?: OnSnapCallback;
};
type RequiredPick<T, F extends keyof T> = Omit<T, F> & Required<Pick<T, F>>;
/**
* Snap class to handle the snap functionality
*
* @example
* const snap = new Snap(lenis, {
* type: 'mandatory', // 'mandatory', 'proximity' or 'lock'
* onSnapStart: (snap) => {
* console.log('onSnapStart', snap)
* },
* onSnapComplete: (snap) => {
* console.log('onSnapComplete', snap)
* },
* })
*
* snap.add(500) // snap at 500px
*
* const removeSnap = snap.add(500)
*
* if (someCondition) {
* removeSnap()
* }
*/
declare class Snap {
private lenis;
options: RequiredPick<SnapOptions, 'type' | 'debounce'>;
elements: Map<number, SnapElement>;
snaps: Map<number, SnapItem>;
viewport: {
width: number;
height: number;
};
isStopped: boolean;
onSnapDebounced: (e: VirtualScrollData) => void;
currentSnapIndex?: number;
constructor(lenis: Lenis, { type, lerp, easing, duration, distanceThreshold, // useless when type is "mandatory"
debounce: debounceDelay, onSnapStart, onSnapComplete, }?: SnapOptions);
/**
* Destroy the snap instance
*/
destroy(): void;
/**
* Start the snap after it has been stopped
*/
start(): void;
/**
* Stop the snap
*/
stop(): void;
/**
* Add a snap to the snap instance
*
* @param value The value to snap to
* @param userData User data that will be forwarded through the snap event
* @returns Unsubscribe function
*/
add(value: number): () => void;
/**
* Add an element to the snap instance
*
* @param element The element to add
* @param options The options for the element
* @returns Unsubscribe function
*/
addElement(element: HTMLElement, options?: SnapElementOptions): () => void;
addElements(elements: HTMLElement[], options?: SnapElementOptions): () => void;
private onWindowResize;
private computeSnaps;
previous(): void;
next(): void;
goTo(index: number): void;
get distanceThreshold(): number;
private onSnap;
resize(): void;
}
export { type OnSnapCallback, type SnapItem, type SnapOptions, Snap as default };

350
node_modules/lenis/dist/lenis-snap.js generated vendored Normal file
View File

@@ -0,0 +1,350 @@
// packages/snap/src/debounce.ts
function debounce(callback, delay) {
let timer;
return function(...args) {
let context = this;
clearTimeout(timer);
timer = setTimeout(() => {
timer = void 0;
callback.apply(context, args);
}, delay);
};
}
// packages/snap/src/element.ts
function removeParentSticky(element) {
const position = getComputedStyle(element).position;
const isSticky = position === "sticky";
if (isSticky) {
element.style.setProperty("position", "static");
element.dataset.sticky = "true";
}
if (element.offsetParent) {
removeParentSticky(element.offsetParent);
}
}
function addParentSticky(element) {
if (element?.dataset?.sticky === "true") {
element.style.removeProperty("position");
delete element.dataset.sticky;
}
if (element.offsetParent) {
addParentSticky(element.offsetParent);
}
}
function offsetTop(element, accumulator = 0) {
const top = accumulator + element.offsetTop;
if (element.offsetParent) {
return offsetTop(element.offsetParent, top);
}
return top;
}
function offsetLeft(element, accumulator = 0) {
const left = accumulator + element.offsetLeft;
if (element.offsetParent) {
return offsetLeft(element.offsetParent, left);
}
return left;
}
function scrollTop(element, accumulator = 0) {
const top = accumulator + element.scrollTop;
if (element.offsetParent) {
return scrollTop(element.offsetParent, top);
}
return top + window.scrollY;
}
function scrollLeft(element, accumulator = 0) {
const left = accumulator + element.scrollLeft;
if (element.offsetParent) {
return scrollLeft(element.offsetParent, left);
}
return left + window.scrollX;
}
var SnapElement = class {
element;
options;
align;
// @ts-ignore
rect = {};
wrapperResizeObserver;
resizeObserver;
debouncedWrapperResize;
constructor(element, {
align = ["start"],
ignoreSticky = true,
ignoreTransform = false
} = {}) {
this.element = element;
this.options = { align, ignoreSticky, ignoreTransform };
this.align = [align].flat();
this.debouncedWrapperResize = debounce(this.onWrapperResize, 500);
this.wrapperResizeObserver = new ResizeObserver(this.debouncedWrapperResize);
this.wrapperResizeObserver.observe(document.body);
this.onWrapperResize();
this.resizeObserver = new ResizeObserver(this.onResize);
this.resizeObserver.observe(this.element);
this.setRect({
width: this.element.offsetWidth,
height: this.element.offsetHeight
});
}
destroy() {
this.wrapperResizeObserver.disconnect();
this.resizeObserver.disconnect();
}
setRect({
top,
left,
width,
height,
element
} = {}) {
top = top ?? this.rect.top;
left = left ?? this.rect.left;
width = width ?? this.rect.width;
height = height ?? this.rect.height;
element = element ?? this.rect.element;
if (top === this.rect.top && left === this.rect.left && width === this.rect.width && height === this.rect.height && element === this.rect.element)
return;
this.rect.top = top;
this.rect.y = top;
this.rect.width = width;
this.rect.height = height;
this.rect.left = left;
this.rect.x = left;
this.rect.bottom = top + height;
this.rect.right = left + width;
}
onWrapperResize = () => {
let top, left;
if (this.options.ignoreSticky) removeParentSticky(this.element);
if (this.options.ignoreTransform) {
top = offsetTop(this.element);
left = offsetLeft(this.element);
} else {
const rect = this.element.getBoundingClientRect();
top = rect.top + scrollTop(this.element);
left = rect.left + scrollLeft(this.element);
}
if (this.options.ignoreSticky) addParentSticky(this.element);
this.setRect({ top, left });
};
onResize = ([entry]) => {
if (!entry?.borderBoxSize[0]) return;
const width = entry.borderBoxSize[0].inlineSize;
const height = entry.borderBoxSize[0].blockSize;
this.setRect({ width, height });
};
};
// packages/snap/src/uid.ts
var index = 0;
function uid() {
return index++;
}
// packages/snap/src/snap.ts
var Snap = class {
constructor(lenis, {
type = "proximity",
lerp,
easing,
duration,
distanceThreshold = "50%",
// useless when type is "mandatory"
debounce: debounceDelay = 500,
onSnapStart,
onSnapComplete
} = {}) {
this.lenis = lenis;
this.options = {
type,
lerp,
easing,
duration,
distanceThreshold,
debounce: debounceDelay,
onSnapStart,
onSnapComplete
};
this.onWindowResize();
window.addEventListener("resize", this.onWindowResize, false);
this.onSnapDebounced = debounce(this.onSnap, this.options.debounce);
this.lenis.on("virtual-scroll", this.onSnapDebounced);
}
options;
elements = /* @__PURE__ */ new Map();
snaps = /* @__PURE__ */ new Map();
viewport = {
width: window.innerWidth,
height: window.innerHeight
};
isStopped = false;
onSnapDebounced;
currentSnapIndex;
/**
* Destroy the snap instance
*/
destroy() {
this.lenis.off("virtual-scroll", this.onSnapDebounced);
window.removeEventListener("resize", this.onWindowResize, false);
this.elements.forEach((element) => element.destroy());
}
/**
* Start the snap after it has been stopped
*/
start() {
this.isStopped = false;
}
/**
* Stop the snap
*/
stop() {
this.isStopped = true;
}
/**
* Add a snap to the snap instance
*
* @param value The value to snap to
* @param userData User data that will be forwarded through the snap event
* @returns Unsubscribe function
*/
add(value) {
const id = uid();
this.snaps.set(id, { value });
return () => this.snaps.delete(id);
}
/**
* Add an element to the snap instance
*
* @param element The element to add
* @param options The options for the element
* @returns Unsubscribe function
*/
addElement(element, options = {}) {
const id = uid();
this.elements.set(id, new SnapElement(element, options));
return () => this.elements.delete(id);
}
addElements(elements, options = {}) {
const map = elements.map((element) => this.addElement(element, options));
return () => {
map.forEach((remove) => {
remove();
});
};
}
onWindowResize = () => {
this.viewport.width = window.innerWidth;
this.viewport.height = window.innerHeight;
};
computeSnaps = () => {
const { isHorizontal } = this.lenis;
let snaps = [...this.snaps.values()];
this.elements.forEach(({ rect, align }) => {
let value;
align.forEach((align2) => {
if (align2 === "start") {
value = rect.top;
} else if (align2 === "center") {
value = isHorizontal ? rect.left + rect.width / 2 - this.viewport.width / 2 : rect.top + rect.height / 2 - this.viewport.height / 2;
} else if (align2 === "end") {
value = isHorizontal ? rect.left + rect.width - this.viewport.width : rect.top + rect.height - this.viewport.height;
}
if (typeof value === "number") {
snaps.push({ value: Math.ceil(value) });
}
});
});
snaps = snaps.sort((a, b) => Math.abs(a.value) - Math.abs(b.value));
return snaps;
};
previous() {
this.goTo((this.currentSnapIndex ?? 0) - 1);
}
next() {
this.goTo((this.currentSnapIndex ?? 0) + 1);
}
goTo(index2) {
const snaps = this.computeSnaps();
if (snaps.length === 0) return;
this.currentSnapIndex = Math.max(0, Math.min(index2, snaps.length - 1));
const currentSnap = snaps[this.currentSnapIndex];
if (currentSnap === void 0) return;
this.lenis.scrollTo(currentSnap.value, {
duration: this.options.duration,
easing: this.options.easing,
lerp: this.options.lerp,
lock: this.options.type === "lock",
userData: { initiator: "snap" },
onStart: () => {
this.options.onSnapStart?.({
index: this.currentSnapIndex,
...currentSnap
});
},
onComplete: () => {
this.options.onSnapComplete?.({
index: this.currentSnapIndex,
...currentSnap
});
}
});
}
get distanceThreshold() {
let distanceThreshold = Infinity;
if (this.options.type === "mandatory") return Infinity;
const { isHorizontal } = this.lenis;
const axis = isHorizontal ? "width" : "height";
if (typeof this.options.distanceThreshold === "string" && this.options.distanceThreshold.endsWith("%")) {
distanceThreshold = Number(this.options.distanceThreshold.replace("%", "")) / 100 * this.viewport[axis];
} else if (typeof this.options.distanceThreshold === "number") {
distanceThreshold = this.options.distanceThreshold;
} else {
distanceThreshold = this.viewport[axis];
}
return distanceThreshold;
}
onSnap = (e) => {
if (this.isStopped) return;
if (e.event.type === "touchmove") return;
if (this.options.type === "lock" && this.lenis.userData?.initiator === "snap")
return;
let { scroll, isHorizontal } = this.lenis;
const delta = isHorizontal ? e.deltaX : e.deltaY;
scroll = Math.ceil(this.lenis.scroll + delta);
const snaps = this.computeSnaps();
if (snaps.length === 0) return;
let snapIndex;
const prevSnapIndex = snaps.findLastIndex(({ value }) => value < scroll);
const nextSnapIndex = snaps.findIndex(({ value }) => value > scroll);
if (this.options.type === "lock") {
if (delta > 0) {
snapIndex = nextSnapIndex;
} else if (delta < 0) {
snapIndex = prevSnapIndex;
}
} else {
const prevSnap = snaps[prevSnapIndex];
const distanceToPrevSnap = prevSnap ? Math.abs(scroll - prevSnap.value) : Infinity;
const nextSnap = snaps[nextSnapIndex];
const distanceToNextSnap = nextSnap ? Math.abs(scroll - nextSnap.value) : Infinity;
snapIndex = distanceToPrevSnap < distanceToNextSnap ? prevSnapIndex : nextSnapIndex;
}
if (snapIndex === void 0) return;
if (snapIndex === -1) return;
snapIndex = Math.max(0, Math.min(snapIndex, snaps.length - 1));
const snap = snaps[snapIndex];
const distance = Math.abs(scroll - snap.value);
if (distance <= this.distanceThreshold) {
this.goTo(snapIndex);
}
};
resize() {
this.elements.forEach((element) => element.onWrapperResize());
}
};
// packages/snap/browser.ts
globalThis.Snap = Snap;
//# sourceMappingURL=lenis-snap.js.map

1
node_modules/lenis/dist/lenis-snap.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/lenis/dist/lenis-snap.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/lenis/dist/lenis-snap.min.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

350
node_modules/lenis/dist/lenis-snap.mjs generated vendored Normal file
View File

@@ -0,0 +1,350 @@
// packages/snap/src/debounce.ts
function debounce(callback, delay) {
let timer;
return function(...args) {
let context = this;
clearTimeout(timer);
timer = setTimeout(() => {
timer = void 0;
callback.apply(context, args);
}, delay);
};
}
// packages/snap/src/element.ts
function removeParentSticky(element) {
const position = getComputedStyle(element).position;
const isSticky = position === "sticky";
if (isSticky) {
element.style.setProperty("position", "static");
element.dataset.sticky = "true";
}
if (element.offsetParent) {
removeParentSticky(element.offsetParent);
}
}
function addParentSticky(element) {
if (element?.dataset?.sticky === "true") {
element.style.removeProperty("position");
delete element.dataset.sticky;
}
if (element.offsetParent) {
addParentSticky(element.offsetParent);
}
}
function offsetTop(element, accumulator = 0) {
const top = accumulator + element.offsetTop;
if (element.offsetParent) {
return offsetTop(element.offsetParent, top);
}
return top;
}
function offsetLeft(element, accumulator = 0) {
const left = accumulator + element.offsetLeft;
if (element.offsetParent) {
return offsetLeft(element.offsetParent, left);
}
return left;
}
function scrollTop(element, accumulator = 0) {
const top = accumulator + element.scrollTop;
if (element.offsetParent) {
return scrollTop(element.offsetParent, top);
}
return top + window.scrollY;
}
function scrollLeft(element, accumulator = 0) {
const left = accumulator + element.scrollLeft;
if (element.offsetParent) {
return scrollLeft(element.offsetParent, left);
}
return left + window.scrollX;
}
var SnapElement = class {
element;
options;
align;
// @ts-ignore
rect = {};
wrapperResizeObserver;
resizeObserver;
debouncedWrapperResize;
constructor(element, {
align = ["start"],
ignoreSticky = true,
ignoreTransform = false
} = {}) {
this.element = element;
this.options = { align, ignoreSticky, ignoreTransform };
this.align = [align].flat();
this.debouncedWrapperResize = debounce(this.onWrapperResize, 500);
this.wrapperResizeObserver = new ResizeObserver(this.debouncedWrapperResize);
this.wrapperResizeObserver.observe(document.body);
this.onWrapperResize();
this.resizeObserver = new ResizeObserver(this.onResize);
this.resizeObserver.observe(this.element);
this.setRect({
width: this.element.offsetWidth,
height: this.element.offsetHeight
});
}
destroy() {
this.wrapperResizeObserver.disconnect();
this.resizeObserver.disconnect();
}
setRect({
top,
left,
width,
height,
element
} = {}) {
top = top ?? this.rect.top;
left = left ?? this.rect.left;
width = width ?? this.rect.width;
height = height ?? this.rect.height;
element = element ?? this.rect.element;
if (top === this.rect.top && left === this.rect.left && width === this.rect.width && height === this.rect.height && element === this.rect.element)
return;
this.rect.top = top;
this.rect.y = top;
this.rect.width = width;
this.rect.height = height;
this.rect.left = left;
this.rect.x = left;
this.rect.bottom = top + height;
this.rect.right = left + width;
}
onWrapperResize = () => {
let top, left;
if (this.options.ignoreSticky) removeParentSticky(this.element);
if (this.options.ignoreTransform) {
top = offsetTop(this.element);
left = offsetLeft(this.element);
} else {
const rect = this.element.getBoundingClientRect();
top = rect.top + scrollTop(this.element);
left = rect.left + scrollLeft(this.element);
}
if (this.options.ignoreSticky) addParentSticky(this.element);
this.setRect({ top, left });
};
onResize = ([entry]) => {
if (!entry?.borderBoxSize[0]) return;
const width = entry.borderBoxSize[0].inlineSize;
const height = entry.borderBoxSize[0].blockSize;
this.setRect({ width, height });
};
};
// packages/snap/src/uid.ts
var index = 0;
function uid() {
return index++;
}
// packages/snap/src/snap.ts
var Snap = class {
constructor(lenis, {
type = "proximity",
lerp,
easing,
duration,
distanceThreshold = "50%",
// useless when type is "mandatory"
debounce: debounceDelay = 500,
onSnapStart,
onSnapComplete
} = {}) {
this.lenis = lenis;
this.options = {
type,
lerp,
easing,
duration,
distanceThreshold,
debounce: debounceDelay,
onSnapStart,
onSnapComplete
};
this.onWindowResize();
window.addEventListener("resize", this.onWindowResize, false);
this.onSnapDebounced = debounce(this.onSnap, this.options.debounce);
this.lenis.on("virtual-scroll", this.onSnapDebounced);
}
options;
elements = /* @__PURE__ */ new Map();
snaps = /* @__PURE__ */ new Map();
viewport = {
width: window.innerWidth,
height: window.innerHeight
};
isStopped = false;
onSnapDebounced;
currentSnapIndex;
/**
* Destroy the snap instance
*/
destroy() {
this.lenis.off("virtual-scroll", this.onSnapDebounced);
window.removeEventListener("resize", this.onWindowResize, false);
this.elements.forEach((element) => element.destroy());
}
/**
* Start the snap after it has been stopped
*/
start() {
this.isStopped = false;
}
/**
* Stop the snap
*/
stop() {
this.isStopped = true;
}
/**
* Add a snap to the snap instance
*
* @param value The value to snap to
* @param userData User data that will be forwarded through the snap event
* @returns Unsubscribe function
*/
add(value) {
const id = uid();
this.snaps.set(id, { value });
return () => this.snaps.delete(id);
}
/**
* Add an element to the snap instance
*
* @param element The element to add
* @param options The options for the element
* @returns Unsubscribe function
*/
addElement(element, options = {}) {
const id = uid();
this.elements.set(id, new SnapElement(element, options));
return () => this.elements.delete(id);
}
addElements(elements, options = {}) {
const map = elements.map((element) => this.addElement(element, options));
return () => {
map.forEach((remove) => {
remove();
});
};
}
onWindowResize = () => {
this.viewport.width = window.innerWidth;
this.viewport.height = window.innerHeight;
};
computeSnaps = () => {
const { isHorizontal } = this.lenis;
let snaps = [...this.snaps.values()];
this.elements.forEach(({ rect, align }) => {
let value;
align.forEach((align2) => {
if (align2 === "start") {
value = rect.top;
} else if (align2 === "center") {
value = isHorizontal ? rect.left + rect.width / 2 - this.viewport.width / 2 : rect.top + rect.height / 2 - this.viewport.height / 2;
} else if (align2 === "end") {
value = isHorizontal ? rect.left + rect.width - this.viewport.width : rect.top + rect.height - this.viewport.height;
}
if (typeof value === "number") {
snaps.push({ value: Math.ceil(value) });
}
});
});
snaps = snaps.sort((a, b) => Math.abs(a.value) - Math.abs(b.value));
return snaps;
};
previous() {
this.goTo((this.currentSnapIndex ?? 0) - 1);
}
next() {
this.goTo((this.currentSnapIndex ?? 0) + 1);
}
goTo(index2) {
const snaps = this.computeSnaps();
if (snaps.length === 0) return;
this.currentSnapIndex = Math.max(0, Math.min(index2, snaps.length - 1));
const currentSnap = snaps[this.currentSnapIndex];
if (currentSnap === void 0) return;
this.lenis.scrollTo(currentSnap.value, {
duration: this.options.duration,
easing: this.options.easing,
lerp: this.options.lerp,
lock: this.options.type === "lock",
userData: { initiator: "snap" },
onStart: () => {
this.options.onSnapStart?.({
index: this.currentSnapIndex,
...currentSnap
});
},
onComplete: () => {
this.options.onSnapComplete?.({
index: this.currentSnapIndex,
...currentSnap
});
}
});
}
get distanceThreshold() {
let distanceThreshold = Infinity;
if (this.options.type === "mandatory") return Infinity;
const { isHorizontal } = this.lenis;
const axis = isHorizontal ? "width" : "height";
if (typeof this.options.distanceThreshold === "string" && this.options.distanceThreshold.endsWith("%")) {
distanceThreshold = Number(this.options.distanceThreshold.replace("%", "")) / 100 * this.viewport[axis];
} else if (typeof this.options.distanceThreshold === "number") {
distanceThreshold = this.options.distanceThreshold;
} else {
distanceThreshold = this.viewport[axis];
}
return distanceThreshold;
}
onSnap = (e) => {
if (this.isStopped) return;
if (e.event.type === "touchmove") return;
if (this.options.type === "lock" && this.lenis.userData?.initiator === "snap")
return;
let { scroll, isHorizontal } = this.lenis;
const delta = isHorizontal ? e.deltaX : e.deltaY;
scroll = Math.ceil(this.lenis.scroll + delta);
const snaps = this.computeSnaps();
if (snaps.length === 0) return;
let snapIndex;
const prevSnapIndex = snaps.findLastIndex(({ value }) => value < scroll);
const nextSnapIndex = snaps.findIndex(({ value }) => value > scroll);
if (this.options.type === "lock") {
if (delta > 0) {
snapIndex = nextSnapIndex;
} else if (delta < 0) {
snapIndex = prevSnapIndex;
}
} else {
const prevSnap = snaps[prevSnapIndex];
const distanceToPrevSnap = prevSnap ? Math.abs(scroll - prevSnap.value) : Infinity;
const nextSnap = snaps[nextSnapIndex];
const distanceToNextSnap = nextSnap ? Math.abs(scroll - nextSnap.value) : Infinity;
snapIndex = distanceToPrevSnap < distanceToNextSnap ? prevSnapIndex : nextSnapIndex;
}
if (snapIndex === void 0) return;
if (snapIndex === -1) return;
snapIndex = Math.max(0, Math.min(snapIndex, snaps.length - 1));
const snap = snaps[snapIndex];
const distance = Math.abs(scroll - snap.value);
if (distance <= this.distanceThreshold) {
this.goTo(snapIndex);
}
};
resize() {
this.elements.forEach((element) => element.onWrapperResize());
}
};
export {
Snap as default
};
//# sourceMappingURL=lenis-snap.mjs.map

1
node_modules/lenis/dist/lenis-snap.mjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

35
node_modules/lenis/dist/lenis-vue-nuxt.mjs generated vendored Normal file
View File

@@ -0,0 +1,35 @@
// packages/vue/nuxt/module.ts
import {
addComponent,
addImports,
addPlugin,
createResolver,
defineNuxtModule
} from "@nuxt/kit";
export * from "lenis/vue";
var nuxtModule = defineNuxtModule({
meta: {
name: "lenis/nuxt",
configKey: "lenis"
},
// Default configuration options of the Nuxt module
defaults: {},
setup(_options, _nuxt) {
const { resolve } = createResolver(import.meta.url);
addPlugin({
src: resolve("./nuxt/runtime/lenis.mjs"),
name: "lenis"
});
addImports({ name: "useLenis", from: "lenis/vue" });
addComponent({
name: "VueLenis",
filePath: "lenis/vue",
global: true,
export: "VueLenis"
});
}
});
var module_default = nuxtModule;
export {
module_default as default
};

67
node_modules/lenis/dist/lenis-vue.d.ts generated vendored Normal file
View File

@@ -0,0 +1,67 @@
import * as Lenis from 'lenis';
import Lenis__default, { ScrollCallback } from 'lenis';
import * as vue from 'vue';
import { PropType, HTMLAttributes, Plugin } from 'vue';
type LenisExposed = {
wrapper?: HTMLDivElement;
content?: HTMLDivElement;
lenis?: Lenis__default;
};
declare const VueLenisImpl: vue.DefineComponent<vue.ExtractPropTypes<{
root: {
type: PropType<boolean>;
default: boolean;
};
autoRaf: {
type: PropType<boolean>;
default: boolean;
};
options: {
type: PropType<ConstructorParameters<typeof Lenis__default>[0]>;
default: () => {};
};
props: {
type: PropType<HTMLAttributes>;
default: () => {};
};
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
[key: string]: any;
}>[] | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
root: {
type: PropType<boolean>;
default: boolean;
};
autoRaf: {
type: PropType<boolean>;
default: boolean;
};
options: {
type: PropType<ConstructorParameters<typeof Lenis__default>[0]>;
default: () => {};
};
props: {
type: PropType<HTMLAttributes>;
default: () => {};
};
}>> & Readonly<{}>, {
props: HTMLAttributes;
root: boolean;
autoRaf: boolean;
options: Lenis.LenisOptions | undefined;
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
declare const VueLenis: typeof VueLenisImpl & {
new (): LenisExposed;
};
declare const vueLenisPlugin: Plugin;
declare module '@vue/runtime-core' {
interface GlobalComponents {
'vue-lenis': typeof VueLenis;
}
}
declare function useLenis(callback?: ScrollCallback, priority?: number): vue.ComputedRef<Lenis.default | undefined>;
export { VueLenis as Lenis, VueLenis, vueLenisPlugin as default, useLenis };

179
node_modules/lenis/dist/lenis-vue.mjs generated vendored Normal file
View File

@@ -0,0 +1,179 @@
// packages/vue/src/provider.ts
import Lenis from "lenis";
import {
defineComponent,
h,
onWatcherCleanup,
provide,
reactive,
ref,
shallowRef as shallowRef2,
watch
} from "vue";
// packages/vue/src/store.ts
import { shallowRef } from "vue";
var globalLenis = shallowRef();
var globalAddCallback = shallowRef();
var globalRemoveCallback = shallowRef();
// packages/vue/src/provider.ts
var LenisSymbol = Symbol("LenisContext");
var AddCallbackSymbol = Symbol("AddCallback");
var RemoveCallbackSymbol = Symbol("RemoveCallback");
var VueLenisImpl = defineComponent({
name: "VueLenis",
props: {
root: {
type: Boolean,
default: false
},
autoRaf: {
type: Boolean,
default: true
},
options: {
type: Object,
default: () => ({})
},
props: {
type: Object,
default: () => ({})
}
},
setup(props, { slots, expose }) {
const lenisRef = shallowRef2();
const wrapper = ref();
const content = ref();
expose({
lenis: lenisRef,
wrapper,
content
});
watch(
[() => props.options, wrapper, content],
() => {
const isClient = typeof window !== "undefined";
if (!isClient) return;
if (!props.root && (!wrapper.value || !content.value)) return;
lenisRef.value = new Lenis({
...props.options,
...!props.root ? {
wrapper: wrapper.value,
content: content.value
} : {},
autoRaf: props.options?.autoRaf ?? props.autoRaf
});
onWatcherCleanup(() => {
lenisRef.value?.destroy();
lenisRef.value = void 0;
});
},
{ deep: true, immediate: true }
);
const callbacks = reactive([]);
function addCallback(callback, priority) {
callbacks.push({ callback, priority });
callbacks.sort((a, b) => a.priority - b.priority);
}
function removeCallback(callback) {
callbacks.splice(
callbacks.findIndex((cb) => cb.callback === callback),
1
);
}
const onScroll = (data) => {
for (let i = 0; i < callbacks.length; i++) {
callbacks[i]?.callback(data);
}
};
watch(
[lenisRef, () => props.root],
([lenis, root]) => {
lenis?.on("scroll", onScroll);
if (root) {
globalLenis.value = lenis;
globalAddCallback.value = addCallback;
globalRemoveCallback.value = removeCallback;
onWatcherCleanup(() => {
globalLenis.value = void 0;
globalAddCallback.value = void 0;
globalRemoveCallback.value = void 0;
});
}
},
{ immediate: true }
);
if (!props.root) {
provide(LenisSymbol, lenisRef);
provide(AddCallbackSymbol, addCallback);
provide(RemoveCallbackSymbol, removeCallback);
}
return () => {
if (props.root) {
return slots.default?.();
} else {
return h("div", { ref: wrapper, ...props?.props }, [
h("div", { ref: content }, slots.default?.())
]);
}
};
}
});
var VueLenis = VueLenisImpl;
var vueLenisPlugin = (app) => {
app.component("vue-lenis", VueLenis);
app.provide(LenisSymbol, shallowRef2(void 0));
app.provide(AddCallbackSymbol, void 0);
app.provide(RemoveCallbackSymbol, void 0);
};
// packages/vue/src/use-lenis.ts
import { computed, inject, nextTick, onWatcherCleanup as onWatcherCleanup2, watch as watch2 } from "vue";
function useLenis(callback, priority = 0) {
const lenisInjection = inject(LenisSymbol);
const addCallbackInjection = inject(AddCallbackSymbol);
const removeCallbackInjection = inject(RemoveCallbackSymbol);
const addCallback = computed(
() => addCallbackInjection ? addCallbackInjection : globalAddCallback.value
);
const removeCallback = computed(
() => removeCallbackInjection ? removeCallbackInjection : globalRemoveCallback.value
);
const lenis = computed(
() => lenisInjection?.value ? lenisInjection.value : globalLenis.value
);
if (typeof window !== "undefined") {
nextTick(() => {
nextTick(() => {
if (!lenis.value && import.meta.env.DEV) {
console.warn(
"No lenis instance found, either mount a root lenis instance or wrap your component in a lenis provider"
);
}
});
});
}
watch2(
[lenis, addCallback, removeCallback],
([lenis2, addCallback2, removeCallback2]) => {
if (!lenis2 || !addCallback2 || !removeCallback2 || !callback) return;
addCallback2?.(callback, priority);
callback?.(lenis2);
onWatcherCleanup2(() => {
removeCallback2?.(callback);
});
},
{
immediate: true
}
);
return lenis;
}
export {
VueLenis as Lenis,
VueLenis,
vueLenisPlugin as default,
useLenis
};
//# sourceMappingURL=lenis-vue.mjs.map

1
node_modules/lenis/dist/lenis-vue.mjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/lenis/dist/lenis.css generated vendored Normal file
View File

@@ -0,0 +1 @@
html.lenis,html.lenis body{height:auto}.lenis:not(.lenis-autoToggle).lenis-stopped{overflow:clip}.lenis [data-lenis-prevent],.lenis [data-lenis-prevent-wheel],.lenis [data-lenis-prevent-touch]{overscroll-behavior:contain}.lenis.lenis-smooth iframe{pointer-events:none}.lenis.lenis-autoToggle{transition-property:overflow;transition-duration:1ms;transition-behavior:allow-discrete}

439
node_modules/lenis/dist/lenis.d.ts generated vendored Normal file
View File

@@ -0,0 +1,439 @@
/**
* Dimensions class to handle the size of the content and wrapper
*
* @example
* const dimensions = new Dimensions(wrapper, content)
* dimensions.on('resize', (e) => {
* console.log(e.width, e.height)
* })
*/
declare class Dimensions {
private wrapper;
private content;
width: number;
height: number;
scrollHeight: number;
scrollWidth: number;
private debouncedResize?;
private wrapperResizeObserver?;
private contentResizeObserver?;
constructor(wrapper: HTMLElement | Window | Element, content: HTMLElement | Element, { autoResize, debounce: debounceValue }?: {
autoResize?: boolean | undefined;
debounce?: number | undefined;
});
destroy(): void;
resize: () => void;
onWrapperResize: () => void;
onContentResize: () => void;
get limit(): {
x: number;
y: number;
};
}
type OnUpdateCallback = (value: number, completed: boolean) => void;
type OnStartCallback = () => void;
type FromToOptions = {
/**
* Linear interpolation (lerp) intensity (between 0 and 1)
* @default 0.1
*/
lerp?: number;
/**
* The duration of the scroll animation (in s)
* @default 1
*/
duration?: number;
/**
* The easing function to use for the scroll animation
* @default (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t))
*/
easing?: EasingFunction;
/**
* Called when the scroll starts
*/
onStart?: OnStartCallback;
/**
* Called when the scroll progress changes
*/
onUpdate?: OnUpdateCallback;
};
type UserData = Record<string, any>;
type Scrolling = boolean | 'native' | 'smooth';
type LenisEvent = 'scroll' | 'virtual-scroll';
type ScrollCallback = (lenis: Lenis) => void;
type VirtualScrollCallback = (data: VirtualScrollData) => void;
type VirtualScrollData = {
deltaX: number;
deltaY: number;
event: WheelEvent | TouchEvent;
};
type Orientation = 'vertical' | 'horizontal';
type GestureOrientation = 'vertical' | 'horizontal' | 'both';
type EasingFunction = (time: number) => number;
type ScrollToOptions = {
/**
* The offset to apply to the target value
* @default 0
*/
offset?: number;
/**
* Skip the animation and jump to the target value immediately
* @default false
*/
immediate?: boolean;
/**
* Lock the scroll to the target value
* @default false
*/
lock?: boolean;
/**
* The duration of the scroll animation (in s)
*/
duration?: number;
/**
* The easing function to use for the scroll animation
* @default (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t))
*/
easing?: EasingFunction;
/**
* Linear interpolation (lerp) intensity (between 0 and 1)
* @default 0.1
*/
lerp?: number;
/**
* Called when the scroll starts
*/
onStart?: (lenis: Lenis) => void;
/**
* Called when the scroll completes
*/
onComplete?: (lenis: Lenis) => void;
/**
* Scroll even if stopped
* @default false
*/
force?: boolean;
/**
* Scroll initiated from outside of the lenis instance
* @default false
*/
programmatic?: boolean;
/**
* User data that will be forwarded through the scroll event
*/
userData?: UserData;
};
type LenisOptions = {
/**
* The element that will be used as the scroll container
* @default window
*/
wrapper?: Window | HTMLElement | Element;
/**
* The element that contains the content that will be scrolled, usually `wrapper`'s direct child
* @default document.documentElement
*/
content?: HTMLElement | Element;
/**
* The element that will listen to `wheel` and `touch` events
* @default window
*/
eventsTarget?: Window | HTMLElement | Element;
/**
* Smooth the scroll initiated by `wheel` events
* @default true
*/
smoothWheel?: boolean;
/**
* Mimic touch device scroll while allowing scroll sync
* @default false
*/
syncTouch?: boolean;
/**
* Linear interpolation (lerp) intensity (between 0 and 1)
* @default 0.075
*/
syncTouchLerp?: number;
/**
* Manage the the strength of `syncTouch` inertia
* @default 35
*/
touchInertiaExponent?: number;
/**
* Scroll duration in seconds
*/
duration?: number;
/**
* Scroll easing function
* @default (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t))
*/
easing?: EasingFunction;
/**
* Linear interpolation (lerp) intensity (between 0 and 1)
* @default 0.1
*/
lerp?: number;
/**
* Enable infinite scrolling
* @default false
*/
infinite?: boolean;
/**
* The orientation of the scrolling. Can be `vertical` or `horizontal`
* @default vertical
*/
orientation?: Orientation;
/**
* The orientation of the gestures. Can be `vertical`, `horizontal` or `both`
* @default vertical
*/
gestureOrientation?: GestureOrientation;
/**
* The multiplier to use for touch events
* @default 1
*/
touchMultiplier?: number;
/**
* The multiplier to use for mouse wheel events
* @default 1
*/
wheelMultiplier?: number;
/**
* Resize instance automatically
* @default true
*/
autoResize?: boolean;
/**
* Manually prevent scroll to be smoothed based on elements traversed by events
*/
prevent?: (node: HTMLElement) => boolean;
/**
* Manually modify the events before they get consumed
*/
virtualScroll?: (data: VirtualScrollData) => boolean;
/**
* Wether or not to enable overscroll on a nested Lenis instance, similar to CSS overscroll-behavior (https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior)
* @default true
*/
overscroll?: boolean;
/**
* If `true`, Lenis will not try to detect the size of the content and wrapper
* @default false
*/
autoRaf?: boolean;
/**
* If `true`, Lenis will automatically run `requestAnimationFrame` loop
* @default false
*/
anchors?: boolean | ScrollToOptions;
/**
* If `true`, Lenis will automatically start/stop based on wrapper's overflow property
* @default false
*/
autoToggle?: boolean;
/**
* If `true`, Lenis will allow nested scroll
* @default false
*/
allowNestedScroll?: boolean;
/**
* If `true`, Lenis will use naive dimensions calculation
* @default false
*/
__experimental__naiveDimensions?: boolean;
};
declare global {
interface Window {
lenisVersion: string;
}
}
type OptionalPick<T, F extends keyof T> = Omit<T, F> & Partial<Pick<T, F>>;
declare class Lenis {
private _isScrolling;
private _isStopped;
private _isLocked;
private _preventNextNativeScrollEvent;
private _resetVelocityTimeout;
private __rafID;
/**
* Whether or not the user is touching the screen
*/
isTouching?: boolean;
/**
* The time in ms since the lenis instance was created
*/
time: number;
/**
* User data that will be forwarded through the scroll event
*
* @example
* lenis.scrollTo(100, {
* userData: {
* foo: 'bar'
* }
* })
*/
userData: UserData;
/**
* The last velocity of the scroll
*/
lastVelocity: number;
/**
* The current velocity of the scroll
*/
velocity: number;
/**
* The direction of the scroll
*/
direction: 1 | -1 | 0;
/**
* The options passed to the lenis instance
*/
options: OptionalPick<Required<LenisOptions>, 'duration' | 'easing' | 'prevent' | 'virtualScroll'>;
/**
* The target scroll value
*/
targetScroll: number;
/**
* The animated scroll value
*/
animatedScroll: number;
private readonly animate;
private readonly emitter;
readonly dimensions: Dimensions;
private readonly virtualScroll;
constructor({ wrapper, content, eventsTarget, smoothWheel, syncTouch, syncTouchLerp, touchInertiaExponent, duration, // in seconds
easing, lerp, infinite, orientation, // vertical, horizontal
gestureOrientation, // vertical, horizontal, both
touchMultiplier, wheelMultiplier, autoResize, prevent, virtualScroll, overscroll, autoRaf, anchors, autoToggle, // https://caniuse.com/?search=transition-behavior
allowNestedScroll, __experimental__naiveDimensions, }?: LenisOptions);
/**
* Destroy the lenis instance, remove all event listeners and clean up the class name
*/
destroy(): void;
/**
* Add an event listener for the given event and callback
*
* @param event Event name
* @param callback Callback function
* @returns Unsubscribe function
*/
on(event: 'scroll', callback: ScrollCallback): () => void;
on(event: 'virtual-scroll', callback: VirtualScrollCallback): () => void;
/**
* Remove an event listener for the given event and callback
*
* @param event Event name
* @param callback Callback function
*/
off(event: 'scroll', callback: ScrollCallback): void;
off(event: 'virtual-scroll', callback: VirtualScrollCallback): void;
private onScrollEnd;
private dispatchScrollendEvent;
private onTransitionEnd;
private setScroll;
private onClick;
private onPointerDown;
private onVirtualScroll;
/**
* Force lenis to recalculate the dimensions
*/
resize(): void;
private emit;
private onNativeScroll;
private reset;
/**
* Start lenis scroll after it has been stopped
*/
start(): void;
private internalStart;
/**
* Stop lenis scroll
*/
stop(): void;
private internalStop;
/**
* RequestAnimationFrame for lenis
*
* @param time The time in ms from an external clock like `requestAnimationFrame` or Tempus
*/
raf: (time: number) => void;
/**
* Scroll to a target value
*
* @param target The target value to scroll to
* @param options The options for the scroll
*
* @example
* lenis.scrollTo(100, {
* offset: 100,
* duration: 1,
* easing: (t) => 1 - Math.cos((t * Math.PI) / 2),
* lerp: 0.1,
* onStart: () => {
* console.log('onStart')
* },
* onComplete: () => {
* console.log('onComplete')
* },
* })
*/
scrollTo(target: number | string | HTMLElement, { offset, immediate, lock, duration, easing, lerp, onStart, onComplete, force, // scroll even if stopped
programmatic, // called from outside of the class
userData, }?: ScrollToOptions): void;
private preventNextNativeScrollEvent;
private checkNestedScroll;
/**
* The root element on which lenis is instanced
*/
get rootElement(): HTMLElement;
/**
* The limit which is the maximum scroll value
*/
get limit(): number;
/**
* Whether or not the scroll is horizontal
*/
get isHorizontal(): boolean;
/**
* The actual scroll value
*/
get actualScroll(): number;
/**
* The current scroll value
*/
get scroll(): number;
/**
* The progress of the scroll relative to the limit
*/
get progress(): number;
/**
* Current scroll state
*/
get isScrolling(): Scrolling;
private set isScrolling(value);
/**
* Check if lenis is stopped
*/
get isStopped(): boolean;
private set isStopped(value);
/**
* Check if lenis is locked
*/
get isLocked(): boolean;
private set isLocked(value);
/**
* Check if lenis is smooth scrolling
*/
get isSmooth(): boolean;
/**
* The class name applied to the wrapper element
*/
get className(): string;
private updateClassName;
private cleanUpClassName;
}
export { type EasingFunction, type FromToOptions, type GestureOrientation, type LenisEvent, type LenisOptions, type OnStartCallback, type OnUpdateCallback, type Orientation, type ScrollCallback, type ScrollToOptions, type Scrolling, type UserData, type VirtualScrollCallback, type VirtualScrollData, Lenis as default };

1086
node_modules/lenis/dist/lenis.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/lenis/dist/lenis.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/lenis/dist/lenis.min.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/lenis/dist/lenis.min.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

1085
node_modules/lenis/dist/lenis.mjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/lenis/dist/lenis.mjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

5
node_modules/lenis/dist/nuxt/runtime/lenis.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import { Plugin } from '#app';
declare const plugin: Plugin;
export { plugin as default };

13
node_modules/lenis/dist/nuxt/runtime/lenis.mjs generated vendored Normal file
View File

@@ -0,0 +1,13 @@
// packages/vue/nuxt/runtime/lenis.ts
import { defineNuxtPlugin } from "#imports";
import vuePlugin from "lenis/vue";
var plugin = defineNuxtPlugin({
name: "lenis",
setup(nuxtApp) {
nuxtApp.vueApp.use(vuePlugin);
}
});
var lenis_default = plugin;
export {
lenis_default as default
};