alert-transitions.js 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 { Transition } from '../../transitions/transition';
  13. /**
  14. * Animations for alerts
  15. */
  16. var AlertPopIn = (function (_super) {
  17. __extends(AlertPopIn, _super);
  18. function AlertPopIn() {
  19. return _super !== null && _super.apply(this, arguments) || this;
  20. }
  21. AlertPopIn.prototype.init = function () {
  22. var ele = this.enteringView.pageRef().nativeElement;
  23. var backdrop = new Animation(this.plt, ele.querySelector('ion-backdrop'));
  24. var wrapper = new Animation(this.plt, ele.querySelector('.alert-wrapper'));
  25. wrapper.fromTo('opacity', 0.01, 1).fromTo('scale', 1.1, 1);
  26. backdrop.fromTo('opacity', 0.01, 0.3);
  27. this
  28. .easing('ease-in-out')
  29. .duration(200)
  30. .add(backdrop)
  31. .add(wrapper);
  32. };
  33. return AlertPopIn;
  34. }(Transition));
  35. export { AlertPopIn };
  36. var AlertPopOut = (function (_super) {
  37. __extends(AlertPopOut, _super);
  38. function AlertPopOut() {
  39. return _super !== null && _super.apply(this, arguments) || this;
  40. }
  41. AlertPopOut.prototype.init = function () {
  42. var ele = this.leavingView.pageRef().nativeElement;
  43. var backdrop = new Animation(this.plt, ele.querySelector('ion-backdrop'));
  44. var wrapper = new Animation(this.plt, ele.querySelector('.alert-wrapper'));
  45. wrapper.fromTo('opacity', 0.99, 0).fromTo('scale', 1, 0.9);
  46. backdrop.fromTo('opacity', 0.3, 0);
  47. this
  48. .easing('ease-in-out')
  49. .duration(200)
  50. .add(backdrop)
  51. .add(wrapper);
  52. };
  53. return AlertPopOut;
  54. }(Transition));
  55. export { AlertPopOut };
  56. var AlertMdPopIn = (function (_super) {
  57. __extends(AlertMdPopIn, _super);
  58. function AlertMdPopIn() {
  59. return _super !== null && _super.apply(this, arguments) || this;
  60. }
  61. AlertMdPopIn.prototype.init = function () {
  62. var ele = this.enteringView.pageRef().nativeElement;
  63. var backdrop = new Animation(this.plt, ele.querySelector('ion-backdrop'));
  64. var wrapper = new Animation(this.plt, ele.querySelector('.alert-wrapper'));
  65. wrapper.fromTo('opacity', 0.01, 1).fromTo('scale', 1.1, 1);
  66. backdrop.fromTo('opacity', 0.01, 0.5);
  67. this
  68. .easing('ease-in-out')
  69. .duration(200)
  70. .add(backdrop)
  71. .add(wrapper);
  72. };
  73. return AlertMdPopIn;
  74. }(Transition));
  75. export { AlertMdPopIn };
  76. var AlertMdPopOut = (function (_super) {
  77. __extends(AlertMdPopOut, _super);
  78. function AlertMdPopOut() {
  79. return _super !== null && _super.apply(this, arguments) || this;
  80. }
  81. AlertMdPopOut.prototype.init = function () {
  82. var ele = this.leavingView.pageRef().nativeElement;
  83. var backdrop = new Animation(this.plt, ele.querySelector('ion-backdrop'));
  84. var wrapper = new Animation(this.plt, ele.querySelector('.alert-wrapper'));
  85. wrapper.fromTo('opacity', 0.99, 0).fromTo('scale', 1, 0.9);
  86. backdrop.fromTo('opacity', 0.5, 0);
  87. this
  88. .easing('ease-in-out')
  89. .duration(200)
  90. .add(backdrop)
  91. .add(wrapper);
  92. };
  93. return AlertMdPopOut;
  94. }(Transition));
  95. export { AlertMdPopOut };
  96. var AlertWpPopIn = (function (_super) {
  97. __extends(AlertWpPopIn, _super);
  98. function AlertWpPopIn() {
  99. return _super !== null && _super.apply(this, arguments) || this;
  100. }
  101. AlertWpPopIn.prototype.init = function () {
  102. var ele = this.enteringView.pageRef().nativeElement;
  103. var backdrop = new Animation(this.plt, ele.querySelector('ion-backdrop'));
  104. var wrapper = new Animation(this.plt, ele.querySelector('.alert-wrapper'));
  105. wrapper.fromTo('opacity', 0.01, 1).fromTo('scale', 1.3, 1);
  106. backdrop.fromTo('opacity', 0.01, 0.5);
  107. this
  108. .easing('cubic-bezier(0,0,0.05,1)')
  109. .duration(200)
  110. .add(backdrop)
  111. .add(wrapper);
  112. };
  113. return AlertWpPopIn;
  114. }(Transition));
  115. export { AlertWpPopIn };
  116. var AlertWpPopOut = (function (_super) {
  117. __extends(AlertWpPopOut, _super);
  118. function AlertWpPopOut() {
  119. return _super !== null && _super.apply(this, arguments) || this;
  120. }
  121. AlertWpPopOut.prototype.init = function () {
  122. var ele = this.leavingView.pageRef().nativeElement;
  123. var backdrop = new Animation(this.plt, ele.querySelector('ion-backdrop'));
  124. var wrapper = new Animation(this.plt, ele.querySelector('.alert-wrapper'));
  125. wrapper.fromTo('opacity', 0.99, 0).fromTo('scale', 1, 1.3);
  126. backdrop.fromTo('opacity', 0.5, 0);
  127. this
  128. .easing('ease-out')
  129. .duration(150)
  130. .add(backdrop)
  131. .add(wrapper);
  132. };
  133. return AlertWpPopOut;
  134. }(Transition));
  135. export { AlertWpPopOut };
  136. //# sourceMappingURL=alert-transitions.js.map