x-card.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout.html">
  2. <link rel="import" href="../../bower_components/neon-animation/neon-shared-element-animatable-behavior.html">
  3. <link rel="import" href="../../bower_components/neon-animation/neon-animations.html">
  4. <link rel="import" href="../../bower_components/paper-styles/paper-styles-classes.html">
  5. <link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
  6. <dom-module id="x-card">
  7. <template>
  8. <style>
  9. :host {
  10. display: block;
  11. overflow: hidden;
  12. color: white;
  13. z-index: 3
  14. }
  15. #placeholder {
  16. opacity: 0;
  17. background-color: #4285f4;
  18. @apply(--layout-fit);
  19. }
  20. paper-icon-button {
  21. position: absolute;
  22. top: 16px;
  23. right: 16px;
  24. z-index: 2;
  25. }
  26. #container {
  27. @apply(--layout-fit);
  28. @apply(--layout-vertical);
  29. @apply(--layout-center-center);
  30. background-color: #4285f4;
  31. padding: 64px 32px 64px 32px;
  32. box-sizing: border-box;
  33. }
  34. iron-icon {
  35. width: 80px;
  36. height: 80px;
  37. }
  38. .paper-font-subhead {
  39. text-align: center;
  40. }
  41. a {
  42. text-decoration: none;
  43. color: white;
  44. @apply(--layout-self-end);
  45. }
  46. .center {
  47. @apply(--layout-vertical);
  48. @apply(--layout-center-center);
  49. }
  50. #footer {
  51. position: absolute;
  52. left: 50%;
  53. margin-left: -160px;
  54. width: 320px;
  55. bottom: 24px;
  56. text-align: center;
  57. }
  58. </style>
  59. <paper-icon-button id="btn" icon="chat:close" on-tap="_switch"></paper-icon-button>
  60. <div id="placeholder"></div>
  61. <div id="container">
  62. <div class="center">
  63. <iron-icon icon="chat:wifi-tethering"></iron-icon>
  64. <div class="paper-font-headline">Snapdrop</div>
  65. <div class="paper-font-subhead">The easiest way to send files across devices.</div>
  66. </div>
  67. <span id="footer">Built with &#9829; by <a href="mailto:robin@capira.de">Robin Linus</a></span>
  68. </div>
  69. </template>
  70. </dom-module>
  71. <script>
  72. (function() {
  73. Polymer({
  74. is: 'x-card',
  75. behaviors: [
  76. Polymer.NeonSharedElementAnimatableBehavior
  77. ],
  78. properties: {
  79. animationConfig: {
  80. value: function() {
  81. return {
  82. 'entry': [{
  83. name: 'ripple-animation',
  84. id: 'ripple',
  85. toPage: this
  86. }, {
  87. name: 'fade-out-animation',
  88. node: this.$.placeholder,
  89. timing: {
  90. delay: 250
  91. }
  92. }, {
  93. name: 'fade-in-animation',
  94. node: this.$.container,
  95. timing: {
  96. delay: 50
  97. }
  98. }],
  99. 'exit': [{
  100. name: 'opaque-animation',
  101. node: this.$.placeholder
  102. }, {
  103. name: 'fade-out-animation',
  104. node: this.$.container,
  105. timing: {
  106. duration: 0
  107. }
  108. }, {
  109. name: 'reverse-ripple-animation',
  110. id: 'reverse-ripple',
  111. fromPage: this
  112. }]
  113. };
  114. }
  115. },
  116. sharedElements: {
  117. value: function() {
  118. return {
  119. 'ripple': this.$.placeholder,
  120. 'reverse-ripple': this.$.placeholder
  121. };
  122. }
  123. }
  124. },
  125. _switch: function() {
  126. document.querySelector('#pages').select(0);
  127. }
  128. });
  129. })();
  130. </script>