polymer-neon-rails 1.0.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +39 -0
  3. data/Rakefile +1 -0
  4. data/app/assets/components/iron-flex-layout/README.md +4 -0
  5. data/app/assets/components/iron-flex-layout/bower.json +21 -0
  6. data/app/assets/components/iron-flex-layout/classes/iron-flex-layout.html +307 -0
  7. data/app/assets/components/iron-flex-layout/classes/iron-shadow-flex-layout.html +302 -0
  8. data/app/assets/components/iron-flex-layout/demo/index.html +40 -0
  9. data/app/assets/components/iron-flex-layout/demo/x-app.html +106 -0
  10. data/app/assets/components/iron-flex-layout/iron-flex-layout.html +313 -0
  11. data/app/assets/components/iron-meta/README.md +46 -0
  12. data/app/assets/components/iron-meta/bower.json +28 -0
  13. data/app/assets/components/iron-meta/demo/index.html +45 -0
  14. data/app/assets/components/iron-meta/hero.svg +33 -0
  15. data/app/assets/components/iron-meta/index.html +27 -0
  16. data/app/assets/components/iron-meta/iron-meta.html +352 -0
  17. data/app/assets/components/iron-meta/test/basic.html +48 -0
  18. data/app/assets/components/iron-meta/test/index.html +30 -0
  19. data/app/assets/components/iron-meta/test/iron-meta.html +186 -0
  20. data/app/assets/components/iron-resizable-behavior/README.md +16 -0
  21. data/app/assets/components/iron-resizable-behavior/bower.json +26 -0
  22. data/app/assets/components/iron-resizable-behavior/demo/index.html +29 -0
  23. data/app/assets/components/iron-resizable-behavior/demo/src/x-app.html +114 -0
  24. data/app/assets/components/iron-resizable-behavior/index.html +25 -0
  25. data/app/assets/components/iron-resizable-behavior/iron-resizable-behavior.html +139 -0
  26. data/app/assets/components/iron-resizable-behavior/test/basic.html +263 -0
  27. data/app/assets/components/iron-resizable-behavior/test/index.html +31 -0
  28. data/app/assets/components/iron-resizable-behavior/test/test-elements.html +143 -0
  29. data/app/assets/components/iron-selector/README.md +50 -0
  30. data/app/assets/components/iron-selector/bower.json +31 -0
  31. data/app/assets/components/iron-selector/demo/index.html +66 -0
  32. data/app/assets/components/iron-selector/index.html +28 -0
  33. data/app/assets/components/iron-selector/iron-multi-selectable.html +120 -0
  34. data/app/assets/components/iron-selector/iron-selectable.html +307 -0
  35. data/app/assets/components/iron-selector/iron-selection.html +115 -0
  36. data/app/assets/components/iron-selector/iron-selector.html +71 -0
  37. data/app/assets/components/iron-selector/test/activate-event.html +138 -0
  38. data/app/assets/components/iron-selector/test/basic.html +150 -0
  39. data/app/assets/components/iron-selector/test/content-element.html +43 -0
  40. data/app/assets/components/iron-selector/test/content.html +168 -0
  41. data/app/assets/components/iron-selector/test/index.html +36 -0
  42. data/app/assets/components/iron-selector/test/multi.html +135 -0
  43. data/app/assets/components/iron-selector/test/next-previous.html +134 -0
  44. data/app/assets/components/iron-selector/test/selected-attribute.html +72 -0
  45. data/app/assets/components/iron-selector/test/template-repeat.html +110 -0
  46. data/app/assets/components/neon-animation/README.md +304 -0
  47. data/app/assets/components/neon-animation/animations/cascaded-animation.html +84 -0
  48. data/app/assets/components/neon-animation/animations/fade-in-animation.html +49 -0
  49. data/app/assets/components/neon-animation/animations/fade-out-animation.html +49 -0
  50. data/app/assets/components/neon-animation/animations/hero-animation.html +83 -0
  51. data/app/assets/components/neon-animation/animations/opaque-animation.html +46 -0
  52. data/app/assets/components/neon-animation/animations/ripple-animation.html +92 -0
  53. data/app/assets/components/neon-animation/animations/scale-down-animation.html +65 -0
  54. data/app/assets/components/neon-animation/animations/scale-up-animation.html +58 -0
  55. data/app/assets/components/neon-animation/animations/slide-down-animation.html +59 -0
  56. data/app/assets/components/neon-animation/animations/slide-from-left-animation.html +60 -0
  57. data/app/assets/components/neon-animation/animations/slide-from-right-animation.html +60 -0
  58. data/app/assets/components/neon-animation/animations/slide-left-animation.html +59 -0
  59. data/app/assets/components/neon-animation/animations/slide-right-animation.html +59 -0
  60. data/app/assets/components/neon-animation/animations/slide-up-animation.html +59 -0
  61. data/app/assets/components/neon-animation/animations/transform-animation.html +61 -0
  62. data/app/assets/components/neon-animation/bower.json +51 -0
  63. data/app/assets/components/neon-animation/demo/declarative/index.html +108 -0
  64. data/app/assets/components/neon-animation/demo/doc/basic.html +47 -0
  65. data/app/assets/components/neon-animation/demo/doc/my-animatable.html +73 -0
  66. data/app/assets/components/neon-animation/demo/doc/my-dialog.html +97 -0
  67. data/app/assets/components/neon-animation/demo/doc/types.html +53 -0
  68. data/app/assets/components/neon-animation/demo/dropdown/animated-dropdown.html +97 -0
  69. data/app/assets/components/neon-animation/demo/dropdown/index.html +54 -0
  70. data/app/assets/components/neon-animation/demo/grid/animated-grid.html +166 -0
  71. data/app/assets/components/neon-animation/demo/grid/fullsize-page-with-card.html +124 -0
  72. data/app/assets/components/neon-animation/demo/grid/index.html +70 -0
  73. data/app/assets/components/neon-animation/demo/index.html +6 -0
  74. data/app/assets/components/neon-animation/demo/list/full-view.html +122 -0
  75. data/app/assets/components/neon-animation/demo/list/index.html +29 -0
  76. data/app/assets/components/neon-animation/demo/list/list-demo.html +112 -0
  77. data/app/assets/components/neon-animation/demo/list/list-view.html +127 -0
  78. data/app/assets/components/neon-animation/demo/load/animated-grid.html +147 -0
  79. data/app/assets/components/neon-animation/demo/load/full-page.html +86 -0
  80. data/app/assets/components/neon-animation/demo/load/index.html +45 -0
  81. data/app/assets/components/neon-animation/demo/reprojection/animated-grid.html +166 -0
  82. data/app/assets/components/neon-animation/demo/reprojection/fullsize-page-with-card.html +124 -0
  83. data/app/assets/components/neon-animation/demo/reprojection/index.html +66 -0
  84. data/app/assets/components/neon-animation/demo/reprojection/reprojected-pages.html +42 -0
  85. data/app/assets/components/neon-animation/demo/shared.css +40 -0
  86. data/app/assets/components/neon-animation/demo/tiles/circles-page.html +110 -0
  87. data/app/assets/components/neon-animation/demo/tiles/index.html +77 -0
  88. data/app/assets/components/neon-animation/demo/tiles/squares-page.html +104 -0
  89. data/app/assets/components/neon-animation/guides/neon-animation.md +313 -0
  90. data/app/assets/components/neon-animation/index.html +30 -0
  91. data/app/assets/components/neon-animation/neon-animatable-behavior.html +156 -0
  92. data/app/assets/components/neon-animation/neon-animatable.html +54 -0
  93. data/app/assets/components/neon-animation/neon-animated-pages.html +208 -0
  94. data/app/assets/components/neon-animation/neon-animation-behavior.html +88 -0
  95. data/app/assets/components/neon-animation/neon-animation-runner-behavior.html +110 -0
  96. data/app/assets/components/neon-animation/neon-animation.html +17 -0
  97. data/app/assets/components/neon-animation/neon-animations.html +25 -0
  98. data/app/assets/components/neon-animation/neon-shared-element-animatable-behavior.html +37 -0
  99. data/app/assets/components/neon-animation/neon-shared-element-animation-behavior.html +66 -0
  100. data/app/assets/components/neon-animation/web-animations.html +11 -0
  101. data/app/assets/components/neon-elements/README.md +19 -0
  102. data/app/assets/components/neon-elements/bower.json +26 -0
  103. data/app/assets/components/paper-styles/README.md +3 -0
  104. data/app/assets/components/paper-styles/bower.json +27 -0
  105. data/app/assets/components/paper-styles/classes/global.html +96 -0
  106. data/app/assets/components/paper-styles/classes/shadow-layout.html +302 -0
  107. data/app/assets/components/paper-styles/classes/shadow.html +39 -0
  108. data/app/assets/components/paper-styles/classes/typography.html +171 -0
  109. data/app/assets/components/paper-styles/color.html +333 -0
  110. data/app/assets/components/paper-styles/default-theme.html +39 -0
  111. data/app/assets/components/paper-styles/demo-pages.html +72 -0
  112. data/app/assets/components/paper-styles/demo.css +25 -0
  113. data/app/assets/components/paper-styles/paper-styles-classes.html +14 -0
  114. data/app/assets/components/paper-styles/paper-styles.html +17 -0
  115. data/app/assets/components/paper-styles/shadow.html +61 -0
  116. data/app/assets/components/paper-styles/typography.html +240 -0
  117. data/app/assets/components/polymer/LICENSE.txt +27 -0
  118. data/app/assets/components/polymer/bower.json +26 -0
  119. data/app/assets/components/polymer/build.log +27 -0
  120. data/app/assets/components/polymer/polymer-micro.html +523 -0
  121. data/app/assets/components/polymer/polymer-mini.html +1368 -0
  122. data/app/assets/components/polymer/polymer.html +3768 -0
  123. data/app/assets/components/web-animations-js/COPYING +202 -0
  124. data/app/assets/components/web-animations-js/History.md +108 -0
  125. data/app/assets/components/web-animations-js/README.md +161 -0
  126. data/app/assets/components/web-animations-js/bower.json +31 -0
  127. data/app/assets/components/web-animations-js/web-animations-next-lite.min.js +17 -0
  128. data/app/assets/components/web-animations-js/web-animations-next-lite.min.js.map +1 -0
  129. data/app/assets/components/web-animations-js/web-animations-next.min.js +17 -0
  130. data/app/assets/components/web-animations-js/web-animations-next.min.js.map +1 -0
  131. data/app/assets/components/web-animations-js/web-animations.html +50 -0
  132. data/app/assets/components/web-animations-js/web-animations.min.js +17 -0
  133. data/app/assets/components/web-animations-js/web-animations.min.js.gz +0 -0
  134. data/app/assets/components/web-animations-js/web-animations.min.js.map +1 -0
  135. data/app/assets/components/webcomponentsjs/CustomElements.js +956 -0
  136. data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
  137. data/app/assets/components/webcomponentsjs/HTMLImports.js +1078 -0
  138. data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
  139. data/app/assets/components/webcomponentsjs/MutationObserver.js +344 -0
  140. data/app/assets/components/webcomponentsjs/MutationObserver.min.js +11 -0
  141. data/app/assets/components/webcomponentsjs/README.md +125 -0
  142. data/app/assets/components/webcomponentsjs/ShadowDOM.js +4414 -0
  143. data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +15 -0
  144. data/app/assets/components/webcomponentsjs/bower.json +14 -0
  145. data/app/assets/components/webcomponentsjs/build.log +33 -0
  146. data/app/assets/components/webcomponentsjs/package.json +31 -0
  147. data/app/assets/components/webcomponentsjs/webcomponents-lite.js +2300 -0
  148. data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +13 -0
  149. data/app/assets/components/webcomponentsjs/webcomponents.js +7112 -0
  150. data/app/assets/components/webcomponentsjs/webcomponents.min.js +15 -0
  151. data/lib/polymer-neon-rails.rb +2 -0
  152. data/lib/polymer-neon-rails/engine.rb +4 -0
  153. data/lib/polymer-neon-rails/version.rb +3 -0
  154. metadata +264 -0
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "neon-animation",
3
+ "version": "1.0.1",
4
+ "authors": [
5
+ "The Polymer Authors"
6
+ ],
7
+ "keywords": [
8
+ "web-components",
9
+ "web-component",
10
+ "polymer",
11
+ "web-animations"
12
+ ],
13
+ "main": [
14
+ "neon-animatable-behavior.html",
15
+ "neon-animation-behavior.html",
16
+ "neon-animation-runner-behavior.html",
17
+ "neon-shared-element-animatable-behavior.html",
18
+ "neon-shared-element-animation-behavior.html",
19
+ "neon-animated-pages.html",
20
+ "neon-animatable.html",
21
+ "neon-animations.html"
22
+ ],
23
+ "private": true,
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git://github.com/PolymerElements/neon-animation"
27
+ },
28
+ "license": "http://polymer.github.io/LICENSE.txt",
29
+ "homepage": "https://github.com/PolymerElements/neon-animation",
30
+ "ignore": [],
31
+ "dependencies": {
32
+ "polymer": "Polymer/polymer#^1.0.0",
33
+ "iron-meta": "PolymerElements/iron-meta#^1.0.0",
34
+ "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0",
35
+ "iron-selector": "PolymerElements/iron-selector#^1.0.0",
36
+ "paper-styles": "PolymerElements/paper-styles#^1.0.0",
37
+ "web-animations-js": "web-animations/web-animations-js#^2.0.0"
38
+ },
39
+ "devDependencies": {
40
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
41
+ "paper-toolbar": "PolymerElements/paper-toolbar#^1.0.0",
42
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
43
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
44
+ "web-component-tester": "*",
45
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
46
+ "paper-item": "PolymerElements/paper-item#^1.0.0",
47
+ "iron-icon": "PolymerElements/iron-icon#^1.0.0",
48
+ "iron-icons": "PolymerElements/iron-icons#^1.0.0",
49
+ "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0"
50
+ }
51
+ }
@@ -0,0 +1,108 @@
1
+ <!doctype html>
2
+ <!--
3
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
+ Code distributed by Google as part of the polymer project is also
8
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
+ -->
10
+ <html>
11
+ <head>
12
+ <title>neon-animated-pages demo: declarative</title>
13
+
14
+ <meta charset="utf-8">
15
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
16
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
17
+
18
+ <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
19
+
20
+ <link rel="import" href="../../../paper-styles/paper-styles.html">
21
+ <link rel="import" href="../../neon-animated-pages.html">
22
+ <link rel="import" href="../../neon-animatable.html">
23
+ <link rel="import" href="../../neon-animations.html">
24
+
25
+ <style>
26
+
27
+ body {
28
+ overflow: hidden;
29
+ }
30
+
31
+ .toolbar {
32
+ padding: 8px;
33
+ }
34
+
35
+ </style>
36
+
37
+ <style is="custom-style">
38
+
39
+ neon-animatable {
40
+ color: white;
41
+ @apply(--layout-horizontal);
42
+ @apply(--layout-center-center);
43
+ @apply(--paper-font-display4);
44
+ }
45
+
46
+ neon-animatable:nth-child(1) {
47
+ background: var(--paper-red-500);
48
+ }
49
+
50
+ neon-animatable:nth-child(2) {
51
+ background: var(--paper-blue-500);
52
+ }
53
+
54
+ neon-animatable:nth-child(3) {
55
+ background: var(--paper-orange-500);
56
+ }
57
+
58
+ neon-animatable:nth-child(4) {
59
+ background: var(--paper-green-500);
60
+ }
61
+
62
+ neon-animatable:nth-child(5) {
63
+ background: var(--paper-purple-500);
64
+ }
65
+
66
+ </style>
67
+
68
+ </head>
69
+ <body class="fullbleed layout vertical">
70
+
71
+ <template is="dom-bind">
72
+
73
+ <div class="toolbar">
74
+ <button on-click="_onPrevClick">&lt;&lt;</button>
75
+ <button on-click="_onNextClick">&gt;&gt;</button>
76
+ </div>
77
+
78
+ <neon-animated-pages id="pages" class="flex" selected="[[selected]]" entry-animation="[[entryAnimation]]" exit-animation="[[exitAnimation]]">
79
+ <neon-animatable>1</neon-animatable>
80
+ <neon-animatable>2</neon-animatable>
81
+ <neon-animatable>3</neon-animatable>
82
+ <neon-animatable>4</neon-animatable>
83
+ <neon-animatable>5</neon-animatable>
84
+ </neon-animated-pages>
85
+
86
+ </template>
87
+
88
+ <script>
89
+
90
+ var scope = document.querySelector('template[is="dom-bind"]');
91
+ scope.selected = 0;
92
+
93
+ scope._onPrevClick = function() {
94
+ this.entryAnimation = 'slide-from-left-animation';
95
+ this.exitAnimation = 'slide-right-animation';
96
+ this.selected = this.selected === 0 ? 4 : (this.selected - 1);
97
+ }
98
+
99
+ scope._onNextClick = function() {
100
+ this.entryAnimation = 'slide-from-right-animation';
101
+ this.exitAnimation = 'slide-left-animation';
102
+ this.selected = this.selected === 4 ? 0 : (this.selected + 1);
103
+ }
104
+
105
+ </script>
106
+
107
+ </body>
108
+ </html>
@@ -0,0 +1,47 @@
1
+ <!doctype html>
2
+ <!--
3
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
+ Code distributed by Google as part of the polymer project is also
8
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
+ -->
10
+ <html>
11
+ <head>
12
+ <title>neon-animation demo: basic</title>
13
+
14
+ <meta charset="utf-8">
15
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
16
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
17
+
18
+ <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
19
+
20
+ <link rel="import" href="my-animatable.html">
21
+
22
+ </head>
23
+ <body>
24
+
25
+ <template is="dom-bind">
26
+
27
+ <button on-click="_onButtonClick">click me</button>
28
+ <br>
29
+ <my-animatable></my-animatable>
30
+
31
+ </template>
32
+
33
+ <script>
34
+
35
+ var scope = document.querySelector('template[is="dom-bind"]');
36
+
37
+ scope._onButtonClick = function(event) {
38
+ var node = document.querySelector('my-animatable');
39
+ if (node) {
40
+ node.animate();
41
+ }
42
+ };
43
+
44
+ </script>
45
+
46
+ </body>
47
+ </html>
@@ -0,0 +1,73 @@
1
+ <!--
2
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6
+ Code distributed by Google as part of the polymer project is also
7
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8
+ -->
9
+ <link rel="import" href="../../../polymer/polymer.html">
10
+ <link rel="import" href="../../neon-animation-runner-behavior.html">
11
+ <link rel="import" href="../../animations/scale-down-animation.html">
12
+
13
+ <dom-module id="my-animatable">
14
+
15
+ <style>
16
+
17
+ :host {
18
+ display: inline-block;
19
+ border-radius: 50%;
20
+ width: 300px;
21
+ height: 300px;
22
+ background: orange;
23
+ }
24
+
25
+ </style>
26
+
27
+ <template>
28
+
29
+ <content></content>
30
+
31
+ </template>
32
+
33
+ </dom-module>
34
+
35
+ <script>
36
+
37
+ Polymer({
38
+
39
+ is: 'my-animatable',
40
+
41
+ behaviors: [
42
+ Polymer.NeonAnimationRunnerBehavior
43
+ ],
44
+
45
+ properties: {
46
+
47
+ animationConfig: {
48
+ type: Object,
49
+ value: function() {
50
+ return {
51
+ name: 'scale-down-animation',
52
+ node: this
53
+ }
54
+ }
55
+ }
56
+
57
+ },
58
+
59
+ listeners: {
60
+ 'neon-animation-finish': '_onNeonAnimationFinish'
61
+ },
62
+
63
+ animate: function() {
64
+ this.playAnimation();
65
+ },
66
+
67
+ _onNeonAnimationFinish: function() {
68
+ console.log('animation finish!');
69
+ }
70
+
71
+ });
72
+
73
+ </script>
@@ -0,0 +1,97 @@
1
+ <!--
2
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6
+ Code distributed by Google as part of the polymer project is also
7
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8
+ -->
9
+ <link rel="import" href="../../../polymer/polymer.html">
10
+ <link rel="import" href="../../../paper-styles/paper-styles.html">
11
+ <link rel="import" href="../../neon-animation-runner-behavior.html">
12
+ <link rel="import" href="../../animations/scale-up-animation.html">
13
+ <link rel="import" href="../../animations/fade-out-animation.html">
14
+
15
+
16
+ <dom-module id="my-dialog">
17
+
18
+ <style>
19
+
20
+ :host {
21
+ display: none;
22
+ padding: 16px;
23
+ background: white;
24
+ color: black;
25
+ margin: 0 auto;
26
+
27
+ @apply(--shadow-elevation-2dp);
28
+ }
29
+
30
+ </style>
31
+
32
+ <template>
33
+
34
+ <content></content>
35
+
36
+ </template>
37
+
38
+ </dom-module>
39
+
40
+ <script>
41
+
42
+ Polymer({
43
+
44
+ is: 'my-dialog',
45
+
46
+ behaviors: [
47
+ Polymer.NeonAnimationRunnerBehavior
48
+ ],
49
+
50
+ properties: {
51
+
52
+ opened: {
53
+ type: Boolean
54
+ },
55
+
56
+ animationConfig: {
57
+ type: Object,
58
+ value: function() {
59
+ return {
60
+ 'entry': [{
61
+ name: 'scale-up-animation',
62
+ node: this
63
+ }],
64
+ 'exit': [{
65
+ name: 'fade-out-animation',
66
+ node: this
67
+ }]
68
+ }
69
+ }
70
+ }
71
+
72
+ },
73
+
74
+ listeners: {
75
+ 'neon-animation-finish': '_onAnimationFinish'
76
+ },
77
+
78
+ _onAnimationFinish: function() {
79
+ if (!this.opened) {
80
+ this.style.display = '';
81
+ }
82
+ },
83
+
84
+ show: function() {
85
+ this.opened = true;
86
+ this.style.display = 'inline-block';
87
+ this.playAnimation('entry');
88
+ },
89
+
90
+ hide: function() {
91
+ this.opened = false;
92
+ this.playAnimation('exit');
93
+ }
94
+
95
+ });
96
+
97
+ </script>
@@ -0,0 +1,53 @@
1
+ <!doctype html>
2
+ <!--
3
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
+ Code distributed by Google as part of the polymer project is also
8
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
+ -->
10
+ <html>
11
+ <head>
12
+ <title>neon-animation demo: basic</title>
13
+
14
+ <meta charset="utf-8">
15
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
16
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
17
+
18
+ <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
19
+
20
+ <link rel="import" href="my-dialog.html">
21
+
22
+ </head>
23
+ <body>
24
+
25
+ <template is="dom-bind">
26
+
27
+ <button on-click="_onButtonClick">Toggle</button>
28
+
29
+ <div style="text-align: center">
30
+ <my-dialog>Hello World!</my-dialog>
31
+ </div>
32
+
33
+ </template>
34
+
35
+ <script>
36
+
37
+ var scope = document.querySelector('template[is="dom-bind"]');
38
+
39
+ scope._onButtonClick = function(event) {
40
+ var node = document.querySelector('my-dialog');
41
+ if (node) {
42
+ if (node.opened) {
43
+ node.hide();
44
+ } else {
45
+ node.show();
46
+ }
47
+ }
48
+ };
49
+
50
+ </script>
51
+
52
+ </body>
53
+ </html>
@@ -0,0 +1,97 @@
1
+ <!--
2
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6
+ Code distributed by Google as part of the polymer project is also
7
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8
+ -->
9
+ <link rel="import" href="../../../polymer/polymer.html">
10
+ <link rel="import" href="../../../paper-styles/paper-styles.html">
11
+ <link rel="import" href="../../neon-animation-runner-behavior.html">
12
+
13
+
14
+ <dom-module id="animated-dropdown">
15
+
16
+ <style>
17
+
18
+ :host {
19
+ display: none;
20
+ padding: 16px;
21
+ background: white;
22
+ color: black;
23
+
24
+ @apply(--shadow-elevation-2dp);
25
+ }
26
+
27
+ </style>
28
+
29
+ <template>
30
+
31
+ <content></content>
32
+
33
+ </template>
34
+
35
+ </dom-module>
36
+
37
+ <script>
38
+
39
+ Polymer({
40
+
41
+ is: 'animated-dropdown',
42
+
43
+ behaviors: [
44
+ Polymer.NeonAnimationRunnerBehavior
45
+ ],
46
+
47
+ properties: {
48
+
49
+ animationConfig: {
50
+ type: Object,
51
+ value: function() {
52
+ return {
53
+ 'entry': [{
54
+ name: 'scale-up-animation',
55
+ node: this,
56
+ transformOrigin: '0 0'
57
+ }],
58
+ 'exit': [{
59
+ name: 'fade-out-animation',
60
+ node: this
61
+ }]
62
+ }
63
+ }
64
+ },
65
+
66
+ _showing: {
67
+ type: Boolean,
68
+ value: false
69
+ }
70
+
71
+ },
72
+
73
+ listeners: {
74
+ 'neon-animation-finish': '_onAnimationFinish'
75
+ },
76
+
77
+ _onAnimationFinish: function() {
78
+ if (this._showing) {
79
+ } else {
80
+ this.style.display = '';
81
+ }
82
+ },
83
+
84
+ show: function() {
85
+ this.style.display = 'inline-block';
86
+ this._showing = true;
87
+ this.playAnimation('entry');
88
+ },
89
+
90
+ hide: function() {
91
+ this._showing = false;
92
+ this.playAnimation('exit');
93
+ }
94
+
95
+ });
96
+
97
+ </script>