import { Expr } from '../gpu/contract'; import { Scalar } from './values'; /** * How far through a repeating cycle the clock is, 0..1. * * `period` is the cycle length in seconds. The value ramps from 0 to 1 and snaps back. * * @example * ```ts * const sweep = motion.phase(animatedTime(params), params.uniforms.period) * ``` * @see cycle, oscillate */ export declare function phase(t: Expr, period: Expr | number): Expr; /** * A repeating cycle as two numbers: `progress` (0..1 through the current cycle) and * `index` (which cycle this is). * * `period` is the cycle length in seconds. The "every N seconds" word: fade something in * with `progress`, and feed `index` to `cycleSeed` when each pass should look different. * * @example * ```ts * const {progress, index} = motion.cycle(animatedTime(params), 2) // a new pass every 2 s * ``` * @see cycleSeed, phase, pulseTrain */ export declare function cycle(t: Expr, period: Expr | number): { progress: Expr; index: Expr; }; /** * A random but stable number, 0..1, for each cycle index. * * The same index always gives the same value, so a meteor keeps its angle for the whole * pass and picks a new one next time. Change `salt` for a second, independent draw. * * @example * ```ts * const hue = motion.cycleSeed(index) * const size = motion.cycleSeed(index, 1) * ``` * @see cycle */ export declare function cycleSeed(index: Expr, salt?: number): Expr; /** * An on/off rhythm: 1 for the first part of each cycle, 0 for the rest. * * `period` is seconds per cycle and `duty` is the on fraction, 0..1. `soften` eases both * edges over that fraction of the cycle. Leave it at 0 for a hard blink. * * @example * ```ts * const blink = motion.pulseTrain(animatedTime(params), {period: 1.5, duty: 0.3, soften: 0.05}) * ``` * @see pulsing, cycle, oscillate */ export declare function pulseTrain(t: Expr, opts: { period: Expr | number; duty: Expr | number; soften?: number; }): Expr; /** * A smooth back-and-forth between `min` and `max`. * * `rate` is cycles per second, default 1. `min` and `max` default to 0 and 1. `offset` * shifts the starting point, in radians, so two oscillations can run out of step. * * @example * ```ts * const breathe = motion.oscillate(animatedTime(params), {rate: 0.5, min: 0.6, max: 1}) * ``` * @see oscillating, pulseTrain, phase */ export declare function oscillate(t: Expr, opts: { rate?: number; min?: Expr | number; max?: Expr | number; offset?: number; }): Expr; /** * Short, bright flashes at a steady rate: dark most of the time, peaking briefly to 1. * * `rate` is how fast it runs (radians per second of the clock, so about 1 is one flash every * six seconds). `offset` shifts when the flashes land, in radians; give each element its own * (a hash times 2π) so they don't flash together. `sharpness` sets how brief each flash is: * 2, 4, 8 or 16, where larger is briefer. * * @example * ```ts * const blink = motion.flashes(animatedTime(params), {rate: 1.4, offset: mul(seed, 6.283), sharpness: 8}) * ``` * @see pulseTrain, oscillate */ export declare function flashes(t: Expr, opts: { rate: Expr | number; offset?: Expr | number; sharpness: 2 | 4 | 8 | 16; }): Expr; /** * A 0..1 value that starts slow and speeds up. * * @example * ```ts * const grow = motion.easeIn(progress) * ``` * @see easeOut, easeInOut */ export declare const easeIn: (x: Expr) => Expr; /** * A 0..1 value that starts fast and slows to a stop. * * @example * ```ts * const settle = motion.easeOut(progress) * ``` * @see easeIn, easeInOut */ export declare const easeOut: (x: Expr) => Expr; /** * A 0..1 value that starts slow, speeds up, and slows again at the end. * * @example * ```ts * const glide = motion.easeInOut(progress) * ``` * @see easeIn, easeOut */ export declare const easeInOut: (x: Expr) => Expr; type SignalClock = 'global' | 'node'; /** * A knob that sweeps between `min` and `max` on its own, for any slot that takes a prop. * * Same options as `oscillate`. By default it follows the page clock. Pass `clock: 'node'` * to follow the layer's own speed prop instead, after declaring `animatedTime` on the * definition. * * @example * ```ts * map: warps.twirl({center: p('center'), intensity: motion.oscillating({rate: 0.25, min: 0.4, max: 1.6, clock: 'node'})}) * ``` * @tip Inside `map:` it always follows the layer's clock, so declare `animatedTime: {speed: 'speed'}` there. * @see oscillate, pulsing */ export declare function oscillating(opts: { rate?: number; min?: Expr | number; max?: Expr | number; offset?: number; clock?: SignalClock; }): Scalar; /** * A knob that switches on and off in a rhythm, for any slot that takes a prop. * * `period` is seconds per cycle, `duty` the on fraction, `soften` the edge ease, as in * `pulseTrain`. Follows the page clock unless `clock: 'node'` is set. * * @example * ```ts * effect: effects.color.saturate(motion.pulsing({period: 2, duty: 0.5, soften: 0.1})) // color, then gray, then color * ``` * @tip Inside `map:` it always follows the layer's clock, so declare `animatedTime: {speed: 'speed'}` there. * @see pulseTrain, oscillating */ export declare function pulsing(opts: { period: number; duty: number; soften?: number; clock?: SignalClock; }): Scalar; export {}; //# sourceMappingURL=motion.d.ts.map