How to use the liquid-fire.animate 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 ember-animation / ember-animated / tests / dummy / snippets / use-examples.js View on Github external
.then(function(newView){
        return animate(newView, {opacity: [1, 0]}, opts);
      });
  })
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 / transitions / adapt-margin.js View on Github external
opts.adjust.forEach(({element, property}) => {
        animate(element, {[property]: `${size}px`}, { duration: 0, queue: false });
      });
    }
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 pzuraq / liquid-tether / app / transitions / fly-to.js View on Github external
var newTarget = this.newElement.find('.liquid-tether').length ?
                  this.newElement.find('.liquid-tether').children().eq(0) :
                  this.newElement;

  var oldOffset = oldTarget.offset();
  var newOffset = newTarget.offset();

  if (opts.movingSide === 'new') {
    let motion = {
      translateX: [0, oldOffset.left - newOffset.left],
      translateY: [0, oldOffset.top - newOffset.top],
      outerWidth: [newTarget.outerWidth(), oldTarget.outerWidth()],
      outerHeight: [newTarget.outerHeight(), oldTarget.outerHeight()]
    };
    oldTarget.css({ visibility: 'hidden' });
    return animate(newTarget, motion, opts);
  } else {
    let motion = {
      translateX: [newOffset.left - oldOffset.left, 0],
      translateY: [newOffset.top - oldOffset.top, 0],
      outerWidth: newTarget.outerWidth(),
      outerHeight: newTarget.outerHeight()
    };

    newTarget.css({ visibility: 'hidden', position: 'absolute' });
    return animate(oldTarget, motion, opts).then(() => {
      this.newElement.css({ visibility: '' })
      newTarget.css({ visibility: '', width: '', height: '', transform: ''});
      oldTarget.css({ width: '', height: '', transform: '', position: ''});
    });
  }
}
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')
    ]);
  });
}
github cardstack / ember-toolbars / addon / transitions / swap-out.js View on Github external
        () => 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: ''})
  ]);
}