PageSourceSearch

https://cairnjs.vercel.app/src/adapters/motion.js

js cairnjs.vercel.app collected 2026-10-03 06:21:52 UTC 925 bytes, 27 lines download raw bytes

1/**
2 * @cairn-js/core/adapters - Framer / Motion Adapter
3 * Maps `motion: { animate, duration, delay, easing }` into Cairn animation properties.
4 */
5
6export const motion = {
7    name: 'motion',
8    transform(props = {}) {
9        const resolved = { ...props };
10        const motionConfig = resolved.motion || resolved.framer;
11
12        if (motionConfig && typeof motionConfig === 'object') {
13            if (motionConfig.animate) resolved.animate = motionConfig.animate;
14            if (motionConfig.duration) resolved.duration = motionConfig.duration;
15            if (motionConfig.delay) resolved.delay = motionConfig.delay;
16            if (motionConfig.easing) resolved.easing = motionConfig.easing;
17            if (motionConfig.gestures) resolved.gestures = motionConfig.gestures;
18
19            delete resolved.motion;
20            delete resolved.framer;
21        }
22
23        return resolved;
24    }
25};
26
27export default motion;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.