UNPKG

@vimeo/iris

Version:
29 lines (26 loc) 771 B
import { c as __assign } from '../../tslib.es6-7f0e734f.js'; function domStyle(ref, style) { if (!ref.current) return; for (var key in style) ref.current.style[key] = style[key]; } function animate(ref, from, to) { var willChange = Object.keys(to).join(' '); requestAnimationFrame(function () { domStyle(ref, __assign(__assign(__assign({}, from), set), { willChange: willChange })); requestAnimationFrame(function () { domStyle(ref, __assign(__assign({}, to), unset)); }); }); } var set = { backfaceVisibility: 'hidden', transformStyle: 'preserve-3d', }; var unset = { backfaceVisibility: 'unset', willChange: 'unset', transformStyle: 'unset', }; export { animate, domStyle };