UNPKG

maycur-business

Version:

maycur business react components of web

31 lines (22 loc) 834 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = applyTransitionDuration; var _globals = require("../core/globals"); var _prefix = _interopRequireDefault(require("./prefix")); var _matches = require("./matches"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Applies the transition duration to each element * @param {Element[]} els - Array of elements * @param {Number} duration */ function applyTransitionDuration(els, duration) { els.forEach(function (el) { if (!el) return; var isContent = _matches.matches.call(el, _globals.Selectors.CONTENT); var _duration = isContent ? Math.round(duration / 1.3) : duration; el.style[(0, _prefix["default"])('transitionDuration')] = _duration + 'ms'; }); }