Socket
Socket
Sign inDemoInstall

motion

Package Overview
Dependencies
Maintainers
1
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

motion - npm Package Compare versions

Comparing version 6.0.1-alpha.4 to 6.0.1-alpha.5

dist/es/dom/react/index.js

35

dist/es/dom/animate.js

@@ -1,2 +0,1 @@

import { __assign } from 'tslib';
import { convertToBezierString } from '../utils/bezier-string.js';

@@ -6,16 +5,26 @@ import { secondsToMilliseconds } from '../utils/convert-time.js';

function animate(elements, keyframes, options) {
if (typeof elements === "string") {
elements = document.querySelectorAll(elements);
}
if (Array.isArray(elements) || elements instanceof NodeList) {
var _a = options.stagger, stagger_1 = _a === void 0 ? 0 : _a, _b = options.delay, delay_1 = _b === void 0 ? 0 : _b;
return Array.from(elements).map(function (element, i) {
animate(element, keyframes, __assign(__assign({}, options), { delay: delay_1 + stagger_1 * i }));
});
}
var element = elements;
var _c = options.delay, delay = _c === void 0 ? 0 : _c, _d = options.duration, duration = _d === void 0 ? 0.3 : _d, _e = options.repeat, repeat = _e === void 0 ? 0 : _e, iterationStart = options.initialProgress, easing = options.easing;
function animate(element,
// elements: Element | Element[] | NodeListOf<Element> | string,
keyframes, options) {
// if (typeof elements === "string") {
// elements = document.querySelectorAll(elements)
// }
if (options === void 0) { options = {}; }
// if (Array.isArray(elements) || elements instanceof NodeList) {
// const { stagger = 0, delay = 0 } = options
// return Array.from(elements).map((element, i) => {
// animate(element, keyframes, { ...options, delay: delay + stagger * i })
// })
// }
// const element = elements as HTMLElement
var _a = options.delay, delay = _a === void 0 ? 0 : _a, _b = options.duration, duration = _b === void 0 ? 0.3 : _b, _c = options.repeat, repeat = _c === void 0 ? 0 : _c, _d = options.initialProgress, iterationStart = _d === void 0 ? 0 : _d, _e = options.easing, easing = _e === void 0 ? "linear" : _e;
delay = secondsToMilliseconds(delay);
duration = secondsToMilliseconds(duration);
console.log({
delay: delay,
duration: duration,
easing: Array.isArray(easing) ? convertToBezierString(easing) : easing,
iterations: repeat + 1,
iterationStart: iterationStart,
});
function onComplete() {

@@ -22,0 +31,0 @@ Object.assign(element.style, getTargetKeyframe(keyframes));

export { animate } from './dom/animate.js';
export { animated, useAnimation } from './dom/react/index.js';
{
"name": "motion",
"version": "6.0.1-alpha.4",
"version": "6.0.1-alpha.5",
"description": "The Motion library for the web",

@@ -5,0 +5,0 @@ "author": "Matt Perry",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc