How to use the animejs.default function in animejs

To help you get started, we’ve selected a few animejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github steveruizok / framer-controller / dist / ScrollControllerBeta.js View on Github external
this.scrollToPoint = (point, options = {}) => {
			const { x, y } = this._scrollPoint
			if (this.animation) {
				this.animation.pause()
			}
			// Create the targets to animate
			const targets = {
				x: x.get(),
				y: y.get(),
			}
			// Use animejs to animate target to new values,
			// and update the motionValues when these change
			this._animation = animejs_1.default(
				Object.assign(
					{
						targets,
						x: -point.x,
						y: -point.y,
						change: () => {
							x.set(targets.x)
							y.set(targets.y)
						},
						begin: () => (this._isAnimating = true),
						complete: () => (this._isAnimating = false),
					},
					options
				)
			)
			return this._animation
github steveruizok / framer-controller / dist / RelativeController.js View on Github external
this.animate = (options) => {
            const targets = Object.assign({}, this.state.input);
            this._animation = animejs_1.default(Object.assign({ targets }, options, { update: () => {
                    this.setInput(targets);
                } }));
            return this._animation;
        };
        this.setInput = (props, initial = false) => {
github steveruizok / framer-controller / dist / Controller.js View on Github external
this.animate = (options, target) => {
            const targets = target ? Object.assign({}, this.state[target]) : Object.assign({}, this.state);
            this._animation = animejs_1.default(Object.assign({ targets }, options, { change: () => {
                    if (target) {
                        this.setState({
                            [target]: targets,
                        });
                    }
                    else {
                        this.setState(targets);
                    }
                }, begin: () => (this._isAnimating = true), complete: () => (this._isAnimating = false) }));
            return this._animation;
        };
        /**