How to use the liquid-fire.Promise.all function in liquid-fire

To help you get started, we’ve selected a few liquid-fire 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 ember-animation / ember-animated / tests / dummy / app / transitions / rotate-below.js View on Github external
export default function rotateBelow(opts={}) {
  var direction = 1;
  if (opts.direction === 'cw') {
    direction = -1;
  }
  stop(this.oldElement);
  if (this.oldElement) {
    this.oldElement.css('transform-origin', '50% 150%');
  }
  if (this.newElement) {
    this.newElement.css('transform-origin', '50% 150%');
  }
  return Promise.all([
    animate(this.oldElement, { rotateZ: -90*direction + 'deg' }, opts),
    animate(this.newElement, { rotateZ: ['0deg', 90*direction+'deg'] }, opts),
  ]);
}
// END-SNIPPET
github cardstack / squishable-container / tests / dummy / app / controllers / index.js View on Github external
function animateWidth() {
  let promises = [];
  if (this.newElement) {
    let width = this.newElement.width();
    this.newElement.css('display', 'none');
    promises.push(
      animate(this.newElement, { display: '', width: [ width, 0] }).then(() => {
        this.newElement.css('width', '');
      })
    );
  }
  if (this.oldElement) {
    promises.push(animate(this.oldElement, { width: 0 }));
  }
  return Promise.all(promises);
}
github cardstack / ember-toolbars / addon / transition-helpers.js View on Github external
  return () => Promise.all(targets.map(target => animate(target.element, {[target.property]: `${distance}px`}, opts)));
}
github ember-animation / ember-animated / app / transitions / modal-popup.js View on Github external
overlayAnimation = this.lookup(opts.overlay);
    }
  }

  var boxAnimation = animateDialog;
  var boxAnimationArgs = [];
  if (opts.box) {
    if (Ember.isArray(opts.box)) {
      boxAnimation = this.lookup(opts.box[0]);
      boxAnimationArgs = opts.box.slice(1);
    } else {
      boxAnimation = this.lookup(opts.box);
    }
  }

  return Promise.all([
    overlayAnimation.apply(overlay, overlayAnimationArgs),
    boxAnimation.apply(box, boxAnimationArgs)
  ]);

}
github runspired / liquid-fire-ios / addon / transitions / move-over-half.js View on Github external
return firstStep.then(() => {
    var bigger = biggestSize(this, measure);

    this.oldElement[0].style.zIndex = direction > 0 ? 5 : 0;
    this.newElement[0].style.zIndex = direction > 0 ? 0 : 5;

    oldParams[property] = (bigger * (direction > 0 ? 1 : -0.5)) + 'px';
    newParams[property] = ["0px", (bigger * (direction > 0 ? -0.5 : 1)) + 'px'];

    return Promise.all([
      animate(overlay, overlayParams, opts),
      animate(this.oldElement, oldParams, opts),
      animate(this.newElement, newParams, opts, 'moving-in')
    ]).then(() => overlay.remove());
  });
}
github ember-animation / ember-animated / app / transitions / modal-popup.js View on Github external
function animateOverlay() {
  return Promise.all([
    animate(this.oldElement, {opacity: [0, 0.5]}, {duration: 250}),
    animate(this.newElement, {opacity: [0.5, 0]}, {duration: 250, display: ''})
  ]);
}
github cardstack / ember-toolbars / addon / transitions / swap-out.js View on Github external
return waitForPrevious(this, 'moving-in').then(() => {
    let bigger = biggestSize(this, measure);
    let animateMargin = marginAdjustment(this, measure, opts);
    let halfDuration = { duration: opts.duration / 2 };
    return Promise.all([
      animateMargin(),
      animate(this.oldElement, {
        [property]: (-1 * bigger * direction) + 'px'
      }, halfDuration).then(
        () => animate(this.newElement, {
          [property]: ["0px", (-1 * bigger * direction) + 'px']
        }, halfDuration, 'moving-in')
      )
    ]);
  });
}
github ember-animation / ember-animated / app / transitions / modal-popup.js View on Github external
function animateDialog() {
  return Promise.all([
    animate(this.oldElement, {scale: [0, 1]}, {duration: 250}),
    animate(this.newElement, {scale: [1, 0]}, {duration: 250, display: ''})
  ]);
}
github html-next / vertical-collection / addon / transitions / move-over-half.js View on Github external
return firstStep.then(() => {
    var bigger = biggestSize(this, measure);

    this.oldElement[0].style.zIndex = direction > 0 ? 5 : 0;
    this.newElement[0].style.zIndex = direction > 0 ? 0 : 5;

    oldParams[property] = (bigger * (direction > 0 ? 1 : -0.5)) + 'px';
    newParams[property] = ["0px", (bigger * (direction > 0 ? -0.5 : 1)) + 'px'];

    return Promise.all([
      animate(overlay, overlayParams, opts),
      animate(this.oldElement, oldParams, opts),
      animate(this.newElement, newParams, opts, 'moving-in')
    ]);
  });
}
github pzuraq / liquid-tether / app / transitions / move-over.js View on Github external
return firstStep.then(() => {
    var bigger = biggestSize(this, measure);
    oldParams[property] = (bigger * direction) + 'px';
    newParams[property] = ["0px", (-1 * bigger * direction) + 'px'];

    return Promise.all([
      animate(this.oldElement, oldParams, opts),
      animate(this.newElement, newParams, opts, 'moving-in')
    ]);
  });
}