x-cards.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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-icon-button/paper-icon-button.html">
  5. <link rel="import" href="../../bower_components/paper-tooltip/paper-tooltip.html">
  6. <link rel="import" href="../../styles/icons.html">
  7. <link rel="import" href="../invitation-link/invitation-link.html">
  8. <dom-module id="x-cards">
  9. <template>
  10. <style>
  11. :host {
  12. display: block;
  13. overflow: hidden;
  14. }
  15. #placeholder {
  16. opacity: 0;
  17. background-color: grey;
  18. @apply(--layout-fit);
  19. }
  20. paper-icon-button {
  21. color: #52524F;
  22. }
  23. paper-icon-button:hover {
  24. color: #4285f4;
  25. }
  26. .share {
  27. position: absolute;
  28. top: 16px;
  29. right: 16px;
  30. z-index: 10;
  31. }
  32. .share a {
  33. color: #52524F;
  34. text-decoration: none;
  35. padding-left: 8px;
  36. padding-right: 8px;
  37. }
  38. .share a:hover,
  39. #btn:hover {
  40. color: #4285f4;
  41. }
  42. </style>
  43. <div id="placeholder"></div>
  44. <div id="container">
  45. <div class="share">
  46. <paper-icon-button id="btn" icon="chat:info-outline" on-tap="_switch"></paper-icon-button>
  47. </div>
  48. <content select="div"></content>
  49. </div>
  50. </template>
  51. </dom-module>
  52. <script>
  53. (function() {
  54. Polymer({
  55. is: 'x-cards',
  56. behaviors: [
  57. Polymer.NeonSharedElementAnimatableBehavior
  58. ],
  59. properties: {
  60. animationConfig: {
  61. value: function() {
  62. return {
  63. 'entry': [{
  64. name: 'reverse-ripple-animation',
  65. id: 'reverse-ripple',
  66. toPage: this
  67. }],
  68. 'exit': [{
  69. name: 'fade-out-animation',
  70. node: this.$.container,
  71. timing: {
  72. delay: 150,
  73. duration: 0
  74. }
  75. }, {
  76. name: 'ripple-animation',
  77. id: 'ripple',
  78. fromPage: this
  79. }]
  80. };
  81. }
  82. },
  83. sharedElements: {
  84. value: function() {
  85. return {
  86. 'ripple': this.$.btn,
  87. 'reverse-ripple': this.$.btn
  88. };
  89. }
  90. }
  91. },
  92. _switch: function() {
  93. document.querySelector('#pages').select(1);
  94. }
  95. });
  96. })();
  97. </script>