lisn.js
Version:
Simply handle user gestures and actions. Includes widgets.
1 lines • 1.4 kB
Source Map (JSON)
{"version":3,"file":"effect.cjs","names":[],"sources":["../../../src/ts/effects/effect.ts"],"sourcesContent":["/**\n * @module Effects/Effect\n *\n * @since v1.3.0\n */\n\n/**\n * @interface\n */\nexport type Effect = {\n apply: (element: Element, offsets: ScrollOffsets) => Effect;\n};\n\nexport type EffectCallback<R> = (offsets: ScrollOffsets) => R;\n\n/**\n * The scroll offsets for the current animation frame, being smoothly\n * interpolated towards the target ones.\n *\n * @category Effects\n */\nexport type ScrollOffsets = {\n /**\n * The current interpolated value for the scroll left offset.\n */\n x: number;\n\n /**\n * The change in {@link x} since the last animation frame.\n */\n dx: number;\n\n /**\n * Normalized {@link x}: {@link x} as a fraction from 0 to 1 (maximum scroll\n * left offset).\n */\n nx: number;\n\n /**\n * The change in {@link nx} since the last animation frame.\n */\n dnx: number;\n\n /**\n * The current interpolated value for the scroll top offset.\n */\n y: number;\n\n /**\n * The change in {@link y} since the last animation frame.\n */\n dy: number;\n\n /**\n * Normalized {@link y}: {@link y} as a fraction from 0 to 1 (maximum scroll\n * top offset).\n */\n ny: number;\n\n /**\n * The change in {@link ny} since the last animation frame.\n */\n dny: number;\n};\n"],"mappings":"","ignoreList":[]}