x-card.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. .logo {
  35. width: 80px;
  36. height: 80px;
  37. }
  38. .slogan{
  39. text-align: center;
  40. }
  41. .paper-font-headline {
  42. margin-bottom: 8px;
  43. font-size: 32px;
  44. }
  45. a {
  46. text-decoration: none;
  47. color: white;
  48. }
  49. .center {
  50. @apply(--layout-vertical);
  51. @apply(--layout-center-center);
  52. }
  53. #footer {
  54. position: absolute;
  55. left: 50%;
  56. margin-left: -160px;
  57. width: 320px;
  58. bottom: 24px;
  59. text-align: center;
  60. }
  61. a {
  62. display: inline-block;
  63. text-align: center;
  64. }
  65. .donate-icon {
  66. padding-top: 32px;
  67. width: 32px;
  68. height: 32px;
  69. }
  70. .paper-font-subhead {
  71. font-size: 20px;
  72. }
  73. a.paper-font-subhead {
  74. padding-top: 32px;
  75. }
  76. </style>
  77. <paper-icon-button id="btn" icon="chat:close" on-tap="_switch"></paper-icon-button>
  78. <div id="placeholder"></div>
  79. <div id="container">
  80. <div class="center">
  81. <iron-icon icon="chat:wifi-tethering" class="logo"></iron-icon>
  82. <div class="paper-font-headline">Snapdrop</div>
  83. <div class="slogan">The easiest way to transfer files accross devices.</div>
  84. <a class="paper-font-subhead" href="https://github.com/capira12/snapdrop/blob/master/faq.md" target="_blank">Frequently Asked Questions</a>
  85. </div>
  86. <span id="footer">Built with &#9829; by <a href="https://twitter.com/capira42" target="_blank">Robin Linus</a></span>
  87. </div>
  88. </template>
  89. </dom-module>
  90. <script>
  91. (function() {
  92. Polymer({
  93. is: 'x-card',
  94. behaviors: [
  95. Polymer.NeonSharedElementAnimatableBehavior
  96. ],
  97. properties: {
  98. animationConfig: {
  99. value: function() {
  100. return {
  101. 'entry': [{
  102. name: 'ripple-animation',
  103. id: 'ripple',
  104. toPage: this
  105. }, {
  106. name: 'fade-out-animation',
  107. node: this.$.placeholder,
  108. timing: {
  109. delay: 250
  110. }
  111. }, {
  112. name: 'fade-in-animation',
  113. node: this.$.container,
  114. timing: {
  115. delay: 50
  116. }
  117. }],
  118. 'exit': [{
  119. name: 'opaque-animation',
  120. node: this.$.placeholder
  121. }, {
  122. name: 'fade-out-animation',
  123. node: this.$.container,
  124. timing: {
  125. duration: 0
  126. }
  127. }, {
  128. name: 'reverse-ripple-animation',
  129. id: 'reverse-ripple',
  130. fromPage: this
  131. }]
  132. };
  133. }
  134. },
  135. sharedElements: {
  136. value: function() {
  137. return {
  138. 'ripple': this.$.placeholder,
  139. 'reverse-ripple': this.$.placeholder
  140. };
  141. }
  142. }
  143. },
  144. _switch: function() {
  145. document.querySelector('#pages').select(0);
  146. }
  147. });
  148. })();
  149. </script>