MCPcopy
hub / github.com/greensock/GSAP / _fromTo

Function _fromTo

esm/Flip.js:513–876  ·  view source on GitHub ↗
(fromState, toState, vars, relative)

Source from the content-addressed store, hash-verified

511 }
512},
513 _fromTo = function _fromTo(fromState, toState, vars, relative) {
514 // relative is -1 if "from()", and 1 if "to()"
515 fromState instanceof FlipState && toState instanceof FlipState || console.warn("Not a valid state object.");
516 vars = vars || {};
517
518 var _vars = vars,
519 clearProps = _vars.clearProps,
520 onEnter = _vars.onEnter,
521 onLeave = _vars.onLeave,
522 absolute = _vars.absolute,
523 absoluteOnLeave = _vars.absoluteOnLeave,
524 custom = _vars.custom,
525 delay = _vars.delay,
526 paused = _vars.paused,
527 repeat = _vars.repeat,
528 repeatDelay = _vars.repeatDelay,
529 yoyo = _vars.yoyo,
530 toggleClass = _vars.toggleClass,
531 nested = _vars.nested,
532 _zIndex = _vars.zIndex,
533 scale = _vars.scale,
534 fade = _vars.fade,
535 stagger = _vars.stagger,
536 spin = _vars.spin,
537 prune = _vars.prune,
538 props = ("props" in vars ? vars : fromState).props,
539 tweenVars = _copy(vars, _reserved),
540 animation = gsap.timeline({
541 delay: delay,
542 paused: paused,
543 repeat: repeat,
544 repeatDelay: repeatDelay,
545 yoyo: yoyo,
546 data: "isFlip"
547 }),
548 remainingProps = tweenVars,
549 entering = [],
550 leaving = [],
551 comps = [],
552 swapOutTargets = [],
553 spinNum = spin === true ? 1 : spin || 0,
554 spinFunc = typeof spin === "function" ? spin : function () {
555 return spinNum;
556 },
557 interrupted = fromState.interrupted || toState.interrupted,
558 addFunc = animation[relative !== 1 ? "to" : "from"],
559 v,
560 p,
561 endTime,
562 i,
563 el,
564 comp,
565 state,
566 targets,
567 finalStates,
568 fromNode,
569 toNode,
570 run,

Callers 1

Flip.jsFile · 0.70

Calls 15

getGlobalMatrixFunction · 0.90
isDifferentMethod · 0.80
getBoundingClientRectMethod · 0.80
eventCallbackMethod · 0.80
callMethod · 0.80
durationMethod · 0.80
timeMethod · 0.80
applyMethod · 0.80
_copyFunction · 0.70
_getChangingElStateFunction · 0.70
_recordInlineStylesFunction · 0.70
_memoizePropsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…