a zip code crypto-currency system good for red ONLY

transition-md.js 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. var __extends = (this && this.__extends) || (function () {
  2. var extendStatics = Object.setPrototypeOf ||
  3. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5. return function (d, b) {
  6. extendStatics(d, b);
  7. function __() { this.constructor = d; }
  8. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9. };
  10. })();
  11. import { Animation } from '../animations/animation';
  12. import { isPresent } from '../util/util';
  13. import { PageTransition } from './page-transition';
  14. var TRANSLATEY = 'translateY';
  15. var OFF_BOTTOM = '40px';
  16. var CENTER = '0px';
  17. var SHOW_BACK_BTN_CSS = 'show-back-button';
  18. var MDTransition = (function (_super) {
  19. __extends(MDTransition, _super);
  20. function MDTransition() {
  21. return _super !== null && _super.apply(this, arguments) || this;
  22. }
  23. MDTransition.prototype.init = function () {
  24. _super.prototype.init.call(this);
  25. var plt = this.plt;
  26. var enteringView = this.enteringView;
  27. var leavingView = this.leavingView;
  28. var opts = this.opts;
  29. // what direction is the transition going
  30. var backDirection = (opts.direction === 'back');
  31. if (enteringView) {
  32. if (backDirection) {
  33. this.duration(isPresent(opts.duration) ? opts.duration : 200).easing('cubic-bezier(0.47,0,0.745,0.715)');
  34. }
  35. else {
  36. this.duration(isPresent(opts.duration) ? opts.duration : 280).easing('cubic-bezier(0.36,0.66,0.04,1)');
  37. this.enteringPage
  38. .fromTo(TRANSLATEY, OFF_BOTTOM, CENTER, true)
  39. .fromTo('opacity', 0.01, 1, true);
  40. }
  41. if (enteringView.hasNavbar()) {
  42. var enteringPageEle = enteringView.pageRef().nativeElement;
  43. var enteringNavbarEle = enteringPageEle.querySelector('ion-navbar');
  44. var enteringNavBar = new Animation(plt, enteringNavbarEle);
  45. this.add(enteringNavBar);
  46. var enteringBackButton = new Animation(plt, enteringNavbarEle.querySelector('.back-button'));
  47. this.add(enteringBackButton);
  48. if (enteringView.enableBack()) {
  49. enteringBackButton.beforeAddClass(SHOW_BACK_BTN_CSS);
  50. }
  51. else {
  52. enteringBackButton.beforeRemoveClass(SHOW_BACK_BTN_CSS);
  53. }
  54. }
  55. }
  56. // setup leaving view
  57. if (leavingView && backDirection) {
  58. // leaving content
  59. this.duration(opts.duration || 200).easing('cubic-bezier(0.47,0,0.745,0.715)');
  60. var leavingPage = new Animation(plt, leavingView.pageRef());
  61. this.add(leavingPage.fromTo(TRANSLATEY, CENTER, OFF_BOTTOM).fromTo('opacity', 1, 0));
  62. }
  63. };
  64. return MDTransition;
  65. }(PageTransition));
  66. export { MDTransition };
  67. //# sourceMappingURL=transition-md.js.map