polymer-paper-rails 0.2.0 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/components/core-a11y-keys/core-a11y-keys.html +335 -0
- data/app/assets/components/core-animation/core-animation.html +7 -6
- data/app/assets/components/core-animation/web-animations.html +1 -1
- data/app/assets/components/core-collapse/core-collapse.html +41 -5
- data/app/assets/components/core-component-page/core-component-page.html +1 -1
- data/app/assets/components/core-drawer-panel/core-drawer-panel.css +14 -9
- data/app/assets/components/core-drawer-panel/core-drawer-panel.html +76 -21
- data/app/assets/components/core-drawer-panel/metadata.html +1 -1
- data/app/assets/components/core-dropdown/core-dropdown-base.html +117 -0
- data/app/assets/components/core-dropdown/core-dropdown.html +305 -0
- data/app/assets/components/core-dropdown/metadata.html +62 -0
- data/app/assets/components/core-elements/paper-elements.html +2 -0
- data/app/assets/components/core-focusable/core-focusable.html +4 -0
- data/app/assets/components/core-focusable/core-focusable.js +134 -0
- data/app/assets/components/core-focusable/polymer-mixin.js +35 -0
- data/app/assets/components/core-header-panel/core-header-panel.css +6 -3
- data/app/assets/components/core-header-panel/core-header-panel.html +96 -44
- data/app/assets/components/core-header-panel/metadata.html +1 -1
- data/app/assets/components/core-icon/core-icon.html +19 -5
- data/app/assets/components/core-icons/av-icons.html +57 -31
- data/app/assets/components/core-icons/communication-icons.html +42 -44
- data/app/assets/components/core-icons/core-icons.html +267 -263
- data/app/assets/components/core-icons/device-icons.html +90 -44
- data/app/assets/components/core-icons/editor-icons.html +52 -52
- data/app/assets/components/core-icons/hardware-icons.html +42 -43
- data/app/assets/components/core-icons/image-icons.html +140 -130
- data/app/assets/components/core-icons/maps-icons.html +57 -54
- data/app/assets/components/core-icons/notification-icons.html +34 -35
- data/app/assets/components/core-icons/social-icons.html +38 -37
- data/app/assets/components/core-iconset-svg/core-iconset-svg.html +1 -1
- data/app/assets/components/core-input/core-input.css +3 -7
- data/app/assets/components/core-input/core-input.html +105 -411
- data/app/assets/components/core-input/metadata.html +6 -3
- data/app/assets/components/core-item/core-item.css +7 -6
- data/app/assets/components/core-item/core-item.html +4 -5
- data/app/assets/components/core-item/metadata.html +1 -1
- data/app/assets/components/core-label/core-label.html +124 -0
- data/app/assets/components/core-menu/core-menu.css +3 -3
- data/app/assets/components/core-menu/core-menu.html +8 -2
- data/app/assets/components/core-menu/core-submenu.css +14 -0
- data/app/assets/components/core-menu/core-submenu.html +21 -1
- data/app/assets/components/core-overlay/core-overlay-layer.html +1 -0
- data/app/assets/components/core-overlay/core-overlay.html +163 -90
- data/app/assets/components/core-overlay/gulpfile.js +2 -0
- data/app/assets/components/core-overlay/tests/html/core-overlay-basic.html +127 -0
- data/app/assets/components/core-overlay/tests/html/core-overlay-positioning-margin.html +153 -0
- data/app/assets/components/core-overlay/tests/html/core-overlay-positioning.html +167 -0
- data/app/assets/components/core-overlay/tests/html/core-overlay-scroll.html +130 -0
- data/app/assets/components/core-overlay/tests/js/htmltests.js +6 -0
- data/app/assets/components/core-overlay/tests/runner.html +14 -0
- data/app/assets/components/core-overlay/tests/tests.json +6 -0
- data/app/assets/components/core-scroll-header-panel/core-scroll-header-panel.html +45 -9
- data/app/assets/components/core-scroll-header-panel/metadata.html +1 -1
- data/app/assets/components/core-selector/core-selector.html +116 -28
- data/app/assets/components/core-selector/metadata.html +1 -1
- data/app/assets/components/core-style/core-style.html +4 -4
- data/app/assets/components/core-style/elements.html +1 -1
- data/app/assets/components/core-style/my-theme.html +1 -1
- data/app/assets/components/core-toolbar/core-toolbar.css +14 -7
- data/app/assets/components/core-toolbar/core-toolbar.html +88 -7
- data/app/assets/components/core-toolbar/metadata.html +1 -1
- data/app/assets/components/core-transition/core-transition-css.html +1 -2
- data/app/assets/components/core-transition/core-transition-overlay.css +9 -9
- data/app/assets/components/core-transition/core-transition.html +1 -1
- data/app/assets/components/font-roboto/roboto.html +1 -1
- data/app/assets/components/paper-button/metadata.html +2 -2
- data/app/assets/components/paper-button/paper-button-base.html +120 -0
- data/app/assets/components/paper-button/paper-button.html +114 -145
- data/app/assets/components/paper-checkbox/paper-checkbox.css +1 -1
- data/app/assets/components/paper-dialog/paper-action-dialog.html +104 -0
- data/app/assets/components/paper-dialog/paper-dialog-base.html +81 -0
- data/app/assets/components/paper-dialog/paper-dialog-transition.html +1 -1
- data/app/assets/components/paper-dialog/paper-dialog.html +68 -143
- data/app/assets/components/{paper-dropdown/paper-dropdown.css → paper-dropdown-menu/paper-dropdown-menu.css} +1 -5
- data/app/assets/components/paper-dropdown-menu/paper-dropdown-menu.html +181 -0
- data/app/assets/components/{polymer/polymer.html → paper-dropdown/paper-dropdown-transition.css} +9 -7
- data/app/assets/components/paper-dropdown/paper-dropdown-transition.html +166 -0
- data/app/assets/components/paper-dropdown/paper-dropdown.html +69 -143
- data/app/assets/components/paper-fab/metadata.html +1 -1
- data/app/assets/components/paper-fab/paper-fab.html +140 -16
- data/app/assets/components/paper-icon-button/paper-icon-button.html +99 -32
- data/app/assets/components/paper-input/metadata.html +1 -4
- data/app/assets/components/paper-input/paper-autogrow-textarea.html +157 -0
- data/app/assets/components/paper-input/{paper-input.css → paper-input-decorator.css} +25 -25
- data/app/assets/components/paper-input/paper-input-decorator.html +468 -0
- data/app/assets/components/paper-input/paper-input.html +74 -269
- data/app/assets/components/paper-item/metadata.html +1 -1
- data/app/assets/components/paper-item/paper-item.html +95 -52
- data/app/assets/components/paper-menu-button/metadata.html +1 -1
- data/app/assets/components/paper-menu-button/paper-menu-button.css +38 -19
- data/app/assets/components/paper-menu-button/paper-menu-button.html +57 -138
- data/app/assets/components/paper-progress/paper-progress.css +39 -6
- data/app/assets/components/paper-progress/paper-progress.html +30 -4
- data/app/assets/components/paper-radio-button/paper-radio-button.html +3 -0
- data/app/assets/components/paper-radio-group/paper-radio-group.html +34 -1
- data/app/assets/components/paper-ripple/paper-ripple.html +110 -61
- data/app/assets/components/paper-shadow/metadata.html +2 -2
- data/app/assets/components/paper-shadow/paper-shadow.css +20 -45
- data/app/assets/components/paper-shadow/paper-shadow.html +55 -195
- data/app/assets/components/paper-slider/paper-slider.css +15 -1
- data/app/assets/components/paper-slider/paper-slider.html +98 -57
- data/app/assets/components/paper-spinner/paper-spinner.css +311 -0
- data/app/assets/components/paper-spinner/paper-spinner.html +116 -0
- data/app/assets/components/paper-tabs/paper-tab.css +26 -16
- data/app/assets/components/paper-tabs/paper-tab.html +24 -8
- data/app/assets/components/paper-tabs/paper-tabs.css +31 -13
- data/app/assets/components/paper-tabs/paper-tabs.html +217 -20
- data/app/assets/components/paper-toast/paper-toast.html +44 -6
- data/app/assets/components/paper-toggle-button/paper-toggle-button.css +7 -1
- data/app/assets/components/paper-toggle-button/paper-toggle-button.html +12 -2
- data/app/assets/components/sampler-scaffold/sampler-scaffold.css +2 -1
- data/app/assets/components/web-animations-next/Gruntfile.js +279 -0
- data/app/assets/components/web-animations-next/History.md +76 -0
- data/app/assets/components/web-animations-next/package.json +33 -0
- data/app/assets/components/web-animations-next/src/animation-constructor.js +139 -0
- data/app/assets/components/web-animations-next/src/animation-node.js +31 -0
- data/app/assets/components/web-animations-next/src/animation.js +65 -0
- data/app/assets/components/web-animations-next/src/apply-preserving-inline-style.js +192 -0
- data/app/assets/components/web-animations-next/src/apply.js +25 -0
- data/app/assets/components/web-animations-next/src/box-handler.js +57 -0
- data/app/assets/components/web-animations-next/src/color-handler.js +62 -0
- data/app/assets/components/web-animations-next/src/deprecation.js +42 -0
- data/app/assets/components/web-animations-next/src/dev.js +16 -0
- data/app/assets/components/web-animations-next/src/dimension-handler.js +167 -0
- data/app/assets/components/web-animations-next/src/effect-callback.js +86 -0
- data/app/assets/components/web-animations-next/src/effect.js +110 -0
- data/app/assets/components/web-animations-next/src/element-animatable.js +19 -0
- data/app/assets/components/web-animations-next/src/font-weight-handler.js +42 -0
- data/app/assets/components/web-animations-next/src/group-constructors.js +81 -0
- data/app/assets/components/web-animations-next/src/handler-utils.js +177 -0
- data/app/assets/components/web-animations-next/src/interpolation.js +49 -0
- data/app/assets/components/web-animations-next/src/matrix-decomposition.js +452 -0
- data/app/assets/components/web-animations-next/src/matrix-interpolation.js +130 -0
- data/app/assets/components/web-animations-next/src/maxifill-player.js +162 -0
- data/app/assets/components/web-animations-next/src/normalize-keyframes.js +259 -0
- data/app/assets/components/web-animations-next/src/number-handler.js +72 -0
- data/app/assets/components/web-animations-next/src/player.js +193 -0
- data/app/assets/components/web-animations-next/src/position-handler.js +117 -0
- data/app/assets/components/web-animations-next/src/property-interpolation.js +62 -0
- data/app/assets/components/web-animations-next/src/property-names.js +35 -0
- data/app/assets/components/web-animations-next/src/scope.js +20 -0
- data/app/assets/components/web-animations-next/src/shadow-handler.js +108 -0
- data/app/assets/components/web-animations-next/src/shape-handler.js +85 -0
- data/app/assets/components/web-animations-next/src/tick.js +148 -0
- data/app/assets/components/web-animations-next/src/timeline.js +77 -0
- data/app/assets/components/web-animations-next/src/timing-utilities.js +242 -0
- data/app/assets/components/web-animations-next/src/transform-handler.js +262 -0
- data/app/assets/components/web-animations-next/src/visibility-handler.js +29 -0
- data/app/assets/components/web-animations-next/target-config.js +124 -0
- data/app/assets/components/web-animations-next/target-loader.js +13 -0
- data/app/assets/components/web-animations-next/templates/boilerplate +13 -0
- data/app/assets/components/web-animations-next/templates/runner.html +26 -0
- data/app/assets/components/web-animations-next/templates/web-animations.html +18 -0
- data/app/assets/components/web-animations-next/templates/web-animations.js +21 -0
- data/app/assets/components/web-animations-next/web-animations-next-lite.dev.html +44 -0
- data/app/assets/components/web-animations-next/web-animations-next-lite.dev.js +21 -0
- data/app/assets/components/web-animations-next/web-animations-next.dev.html +49 -0
- data/app/assets/components/web-animations-next/web-animations-next.dev.js +21 -0
- data/app/assets/components/web-animations-next/web-animations.dev.html +44 -0
- data/app/assets/components/web-animations-next/web-animations.dev.js +21 -0
- data/app/assets/components/web-animations-next/web-animations.html +50 -0
- data/lib/polymer-paper-rails/version.rb +1 -1
- metadata +82 -421
- data/app/assets/components/core-animation/README.md +0 -4
- data/app/assets/components/core-animation/bower.json +0 -8
- data/app/assets/components/core-animation/demo.html +0 -149
- data/app/assets/components/core-animation/index.html +0 -22
- data/app/assets/components/core-collapse/README.md +0 -4
- data/app/assets/components/core-collapse/bower.json +0 -7
- data/app/assets/components/core-collapse/demo.html +0 -93
- data/app/assets/components/core-collapse/index.html +0 -22
- data/app/assets/components/core-component-page/README.md +0 -6
- data/app/assets/components/core-component-page/bower.json +0 -8
- data/app/assets/components/core-component-page/demo.html +0 -23
- data/app/assets/components/core-component-page/index.html +0 -22
- data/app/assets/components/core-drawer-panel/README.md +0 -4
- data/app/assets/components/core-drawer-panel/bower.json +0 -8
- data/app/assets/components/core-drawer-panel/demo.html +0 -73
- data/app/assets/components/core-drawer-panel/index.html +0 -22
- data/app/assets/components/core-elements/README.md +0 -4
- data/app/assets/components/core-elements/bower.json +0 -29
- data/app/assets/components/core-elements/demo.html +0 -105
- data/app/assets/components/core-elements/demos/core-toolbar.html +0 -98
- data/app/assets/components/core-field/README.md +0 -4
- data/app/assets/components/core-field/bower.json +0 -7
- data/app/assets/components/core-field/demo.html +0 -67
- data/app/assets/components/core-field/index.html +0 -22
- data/app/assets/components/core-header-panel/README.md +0 -4
- data/app/assets/components/core-header-panel/bower.json +0 -7
- data/app/assets/components/core-header-panel/demo.html +0 -100
- data/app/assets/components/core-header-panel/index.html +0 -23
- data/app/assets/components/core-icon-button/README.md +0 -4
- data/app/assets/components/core-icon-button/bower.json +0 -7
- data/app/assets/components/core-icon-button/demo.html +0 -35
- data/app/assets/components/core-icon-button/index.html +0 -22
- data/app/assets/components/core-icon/README.md +0 -4
- data/app/assets/components/core-icon/bower.json +0 -8
- data/app/assets/components/core-icon/demo.html +0 -44
- data/app/assets/components/core-icon/index.html +0 -22
- data/app/assets/components/core-icons/README.md +0 -4
- data/app/assets/components/core-icons/bower.json +0 -9
- data/app/assets/components/core-icons/demo.html +0 -96
- data/app/assets/components/core-icons/index.html +0 -22
- data/app/assets/components/core-iconset-svg/README.md +0 -4
- data/app/assets/components/core-iconset-svg/bower.json +0 -8
- data/app/assets/components/core-iconset-svg/demo.html +0 -66
- data/app/assets/components/core-iconset-svg/index.html +0 -22
- data/app/assets/components/core-iconset/README.md +0 -4
- data/app/assets/components/core-iconset/bower.json +0 -9
- data/app/assets/components/core-iconset/demo.html +0 -62
- data/app/assets/components/core-iconset/index.html +0 -22
- data/app/assets/components/core-input/README.md +0 -2
- data/app/assets/components/core-input/bower.json +0 -6
- data/app/assets/components/core-input/demo.html +0 -142
- data/app/assets/components/core-input/index.html +0 -22
- data/app/assets/components/core-item/README.md +0 -4
- data/app/assets/components/core-item/bower.json +0 -8
- data/app/assets/components/core-item/demo.html +0 -92
- data/app/assets/components/core-item/index.html +0 -22
- data/app/assets/components/core-media-query/README.md +0 -4
- data/app/assets/components/core-media-query/bower.json +0 -7
- data/app/assets/components/core-media-query/demo.html +0 -44
- data/app/assets/components/core-media-query/index.html +0 -22
- data/app/assets/components/core-menu/README.md +0 -4
- data/app/assets/components/core-menu/bower.json +0 -9
- data/app/assets/components/core-menu/demo.html +0 -101
- data/app/assets/components/core-menu/index.html +0 -22
- data/app/assets/components/core-meta/README.md +0 -4
- data/app/assets/components/core-meta/bower.json +0 -7
- data/app/assets/components/core-meta/demo.html +0 -58
- data/app/assets/components/core-meta/index.html +0 -22
- data/app/assets/components/core-overlay/README.md +0 -4
- data/app/assets/components/core-overlay/bower.json +0 -8
- data/app/assets/components/core-overlay/demo.html +0 -155
- data/app/assets/components/core-overlay/index.html +0 -22
- data/app/assets/components/core-popup-menu/README.md +0 -6
- data/app/assets/components/core-popup-menu/bower.json +0 -13
- data/app/assets/components/core-popup-menu/demo.html +0 -542
- data/app/assets/components/core-popup-menu/index.html +0 -22
- data/app/assets/components/core-range/README.md +0 -2
- data/app/assets/components/core-range/bower.json +0 -7
- data/app/assets/components/core-range/demo.html +0 -64
- data/app/assets/components/core-range/index.html +0 -22
- data/app/assets/components/core-scroll-header-panel/README.md +0 -4
- data/app/assets/components/core-scroll-header-panel/bower.json +0 -11
- data/app/assets/components/core-scroll-header-panel/demo.html +0 -111
- data/app/assets/components/core-scroll-header-panel/demos/demo1.html +0 -80
- data/app/assets/components/core-scroll-header-panel/demos/demo2.html +0 -82
- data/app/assets/components/core-scroll-header-panel/demos/demo3.html +0 -81
- data/app/assets/components/core-scroll-header-panel/demos/demo4.html +0 -109
- data/app/assets/components/core-scroll-header-panel/demos/demo5.html +0 -109
- data/app/assets/components/core-scroll-header-panel/demos/demo6.html +0 -113
- data/app/assets/components/core-scroll-header-panel/demos/demo7.html +0 -120
- data/app/assets/components/core-scroll-header-panel/demos/demo8.html +0 -122
- data/app/assets/components/core-scroll-header-panel/demos/demo9.html +0 -100
- data/app/assets/components/core-scroll-header-panel/demos/images/bg2.jpg +0 -0
- data/app/assets/components/core-scroll-header-panel/demos/images/bg3.jpg +0 -0
- data/app/assets/components/core-scroll-header-panel/demos/images/bg5.jpg +0 -0
- data/app/assets/components/core-scroll-header-panel/demos/images/bg6.jpg +0 -0
- data/app/assets/components/core-scroll-header-panel/demos/images/bg9.jpg +0 -0
- data/app/assets/components/core-scroll-header-panel/demos/lorem-ipsum.html +0 -42
- data/app/assets/components/core-scroll-header-panel/index.html +0 -22
- data/app/assets/components/core-selection/README.md +0 -4
- data/app/assets/components/core-selection/bower.json +0 -7
- data/app/assets/components/core-selection/demo.html +0 -59
- data/app/assets/components/core-selection/index.html +0 -22
- data/app/assets/components/core-selector/README.md +0 -4
- data/app/assets/components/core-selector/bower.json +0 -8
- data/app/assets/components/core-selector/demo.html +0 -106
- data/app/assets/components/core-selector/index.html +0 -22
- data/app/assets/components/core-style/README.md +0 -4
- data/app/assets/components/core-style/bower.json +0 -7
- data/app/assets/components/core-style/demo.html +0 -58
- data/app/assets/components/core-style/index.html +0 -22
- data/app/assets/components/core-toolbar/README.md +0 -4
- data/app/assets/components/core-toolbar/bower.json +0 -7
- data/app/assets/components/core-toolbar/demo.html +0 -107
- data/app/assets/components/core-toolbar/index.html +0 -22
- data/app/assets/components/core-transition/README.md +0 -2
- data/app/assets/components/core-transition/bower.json +0 -8
- data/app/assets/components/core-transition/demo.html +0 -87
- data/app/assets/components/core-transition/index.html +0 -22
- data/app/assets/components/paper-button/README.md +0 -4
- data/app/assets/components/paper-button/bower.json +0 -11
- data/app/assets/components/paper-button/demo.html +0 -99
- data/app/assets/components/paper-button/demo2.html +0 -136
- data/app/assets/components/paper-button/index.html +0 -22
- data/app/assets/components/paper-button/paper-button.css +0 -125
- data/app/assets/components/paper-checkbox/README.md +0 -4
- data/app/assets/components/paper-checkbox/bower.json +0 -8
- data/app/assets/components/paper-checkbox/demo.html +0 -113
- data/app/assets/components/paper-checkbox/index.html +0 -22
- data/app/assets/components/paper-dialog/README.md +0 -4
- data/app/assets/components/paper-dialog/bower.json +0 -10
- data/app/assets/components/paper-dialog/demo.html +0 -85
- data/app/assets/components/paper-dialog/index.html +0 -22
- data/app/assets/components/paper-dialog/paper-dialog.css +0 -52
- data/app/assets/components/paper-dropdown/README.md +0 -9
- data/app/assets/components/paper-dropdown/bower.json +0 -12
- data/app/assets/components/paper-dropdown/demo.html +0 -345
- data/app/assets/components/paper-dropdown/index.html +0 -22
- data/app/assets/components/paper-fab/README.md +0 -4
- data/app/assets/components/paper-fab/bower.json +0 -8
- data/app/assets/components/paper-fab/demo.html +0 -72
- data/app/assets/components/paper-fab/demo2.html +0 -103
- data/app/assets/components/paper-fab/index.html +0 -22
- data/app/assets/components/paper-fab/paper-fab.css +0 -36
- data/app/assets/components/paper-focusable/README.md +0 -4
- data/app/assets/components/paper-focusable/bower.json +0 -7
- data/app/assets/components/paper-focusable/demo.html +0 -155
- data/app/assets/components/paper-icon-button/README.md +0 -4
- data/app/assets/components/paper-icon-button/bower.json +0 -9
- data/app/assets/components/paper-icon-button/demo.html +0 -102
- data/app/assets/components/paper-icon-button/index.html +0 -22
- data/app/assets/components/paper-icon-button/paper-icon-button.css +0 -17
- data/app/assets/components/paper-icon-button/pulse-ink.css +0 -20
- data/app/assets/components/paper-input/README.md +0 -4
- data/app/assets/components/paper-input/bower.json +0 -11
- data/app/assets/components/paper-input/demo.html +0 -124
- data/app/assets/components/paper-input/index.html +0 -22
- data/app/assets/components/paper-item/README.md +0 -4
- data/app/assets/components/paper-item/bower.json +0 -9
- data/app/assets/components/paper-item/demo.html +0 -39
- data/app/assets/components/paper-item/index.html +0 -22
- data/app/assets/components/paper-item/paper-item.css +0 -43
- data/app/assets/components/paper-menu-button/README.md +0 -4
- data/app/assets/components/paper-menu-button/bower.json +0 -16
- data/app/assets/components/paper-menu-button/demo.html +0 -95
- data/app/assets/components/paper-menu-button/index.html +0 -22
- data/app/assets/components/paper-menu-button/paper-menu-button-transition.css +0 -19
- data/app/assets/components/paper-menu-button/paper-menu-button-transition.html +0 -123
- data/app/assets/components/paper-progress/README.md +0 -4
- data/app/assets/components/paper-progress/bower.json +0 -8
- data/app/assets/components/paper-progress/demo.html +0 -107
- data/app/assets/components/paper-progress/index.html +0 -22
- data/app/assets/components/paper-radio-button/README.md +0 -4
- data/app/assets/components/paper-radio-button/bower.json +0 -7
- data/app/assets/components/paper-radio-button/demo.html +0 -75
- data/app/assets/components/paper-radio-button/index.html +0 -22
- data/app/assets/components/paper-radio-group/README.md +0 -4
- data/app/assets/components/paper-radio-group/bower.json +0 -9
- data/app/assets/components/paper-radio-group/demo.html +0 -82
- data/app/assets/components/paper-radio-group/index.html +0 -22
- data/app/assets/components/paper-ripple/README.md +0 -4
- data/app/assets/components/paper-ripple/bower.json +0 -9
- data/app/assets/components/paper-ripple/demo.html +0 -418
- data/app/assets/components/paper-ripple/index.html +0 -22
- data/app/assets/components/paper-ripple/raw.html +0 -799
- data/app/assets/components/paper-shadow/README.md +0 -4
- data/app/assets/components/paper-shadow/bower.json +0 -7
- data/app/assets/components/paper-shadow/demo.html +0 -252
- data/app/assets/components/paper-shadow/index.html +0 -22
- data/app/assets/components/paper-slider/README.md +0 -4
- data/app/assets/components/paper-slider/bower.json +0 -9
- data/app/assets/components/paper-slider/demo.html +0 -151
- data/app/assets/components/paper-slider/index.html +0 -22
- data/app/assets/components/paper-tabs/README.md +0 -4
- data/app/assets/components/paper-tabs/bower.json +0 -12
- data/app/assets/components/paper-tabs/demo.html +0 -166
- data/app/assets/components/paper-tabs/index.html +0 -22
- data/app/assets/components/paper-toast/README.md +0 -4
- data/app/assets/components/paper-toast/bower.json +0 -10
- data/app/assets/components/paper-toast/demo.html +0 -67
- data/app/assets/components/paper-toast/index.html +0 -22
- data/app/assets/components/paper-toggle-button/README.md +0 -4
- data/app/assets/components/paper-toggle-button/bower.json +0 -8
- data/app/assets/components/paper-toggle-button/demo.html +0 -77
- data/app/assets/components/paper-toggle-button/index.html +0 -22
- data/app/assets/components/platform/README.md +0 -6
- data/app/assets/components/platform/bower.json +0 -16
- data/app/assets/components/platform/build.log +0 -35
- data/app/assets/components/platform/platform.js.map +0 -1
- data/app/assets/components/polymer/README.md +0 -17
- data/app/assets/components/polymer/bower.json +0 -8
- data/app/assets/components/polymer/build.log +0 -35
- data/app/assets/components/polymer/layout.html +0 -286
- data/app/assets/components/polymer/polymer.js +0 -14
- data/app/assets/components/polymer/polymer.js.map +0 -1
- data/app/assets/components/sampler-scaffold/README.md +0 -4
- data/app/assets/components/sampler-scaffold/bower.json +0 -12
- data/app/assets/components/sampler-scaffold/demo.html +0 -54
- data/app/assets/components/sampler-scaffold/demos/checkbox.html +0 -20
- data/app/assets/components/sampler-scaffold/demos/color.html +0 -20
- data/app/assets/components/sampler-scaffold/demos/radio.html +0 -20
- data/app/assets/components/sampler-scaffold/demos/range.html +0 -20
- data/app/assets/components/sampler-scaffold/demos/string.html +0 -20
- data/app/assets/components/sampler-scaffold/index.html +0 -22
- data/app/assets/components/web-animations-js/COPYING +0 -202
- data/app/assets/components/web-animations-js/README.md +0 -237
- data/app/assets/components/web-animations-js/run-lint.sh +0 -19
- data/app/assets/components/web-animations-js/run-tests-android.sh +0 -25
- data/app/assets/components/web-animations-js/run-tests.sh +0 -15
- data/app/assets/components/web-animations-js/test/bootstrap.js +0 -1266
- data/app/assets/components/web-animations-js/test/img/error.png +0 -0
- data/app/assets/components/web-animations-js/test/img/success.png +0 -0
- data/app/assets/components/web-animations-js/test/img/unknown.png +0 -0
- data/app/assets/components/web-animations-js/test/perf/balls-add-compositing.html +0 -147
- data/app/assets/components/web-animations-js/test/perf/balls-replace-compositing.html +0 -144
- data/app/assets/components/web-animations-js/test/perf/perf.js +0 -158
- data/app/assets/components/web-animations-js/test/perf/updating-inline-style-during-animation.html +0 -165
- data/app/assets/components/web-animations-js/test/test-generator.html +0 -240
- data/app/assets/components/web-animations-js/test/test-results-post.html +0 -3
- data/app/assets/components/web-animations-js/test/test-runner.html +0 -810
- data/app/assets/components/web-animations-js/test/testcases.js +0 -93
- data/app/assets/components/web-animations-js/test/testcases/auto-test-box-shadow-checks.js +0 -42
- data/app/assets/components/web-animations-js/test/testcases/auto-test-box-shadow.html +0 -40
- data/app/assets/components/web-animations-js/test/testcases/auto-test-calc-checks.js +0 -41
- data/app/assets/components/web-animations-js/test/testcases/auto-test-calc.html +0 -156
- data/app/assets/components/web-animations-js/test/testcases/auto-test-change-playback-rate-checks.js +0 -23
- data/app/assets/components/web-animations-js/test/testcases/auto-test-circular-path-checks.js +0 -65
- data/app/assets/components/web-animations-js/test/testcases/auto-test-circular-path.html +0 -83
- data/app/assets/components/web-animations-js/test/testcases/auto-test-color-checks.js +0 -101
- data/app/assets/components/web-animations-js/test/testcases/auto-test-color-names-checks.js +0 -431
- data/app/assets/components/web-animations-js/test/testcases/auto-test-color-names.html +0 -204
- data/app/assets/components/web-animations-js/test/testcases/auto-test-color.html +0 -117
- data/app/assets/components/web-animations-js/test/testcases/auto-test-composite-transforms-checks.js +0 -45
- data/app/assets/components/web-animations-js/test/testcases/auto-test-composite-transforms.html +0 -97
- data/app/assets/components/web-animations-js/test/testcases/auto-test-compositor-checks.js +0 -26
- data/app/assets/components/web-animations-js/test/testcases/auto-test-compositor.html +0 -68
- data/app/assets/components/web-animations-js/test/testcases/auto-test-delay-checks.js +0 -92
- data/app/assets/components/web-animations-js/test/testcases/auto-test-delay.html +0 -39
- data/app/assets/components/web-animations-js/test/testcases/auto-test-element-animate-checks.js +0 -8
- data/app/assets/components/web-animations-js/test/testcases/auto-test-element-animate.html +0 -30
- data/app/assets/components/web-animations-js/test/testcases/auto-test-fill-values-checks.js +0 -266
- data/app/assets/components/web-animations-js/test/testcases/auto-test-fill-values.html +0 -114
- data/app/assets/components/web-animations-js/test/testcases/auto-test-font-weight-checks.js +0 -26
- data/app/assets/components/web-animations-js/test/testcases/auto-test-font-weight.html +0 -43
- data/app/assets/components/web-animations-js/test/testcases/auto-test-initial-checks.js +0 -74
- data/app/assets/components/web-animations-js/test/testcases/auto-test-initial.html +0 -242
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style-checks.js +0 -17
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style-fallback-checks.js +0 -17
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style-fallback.html +0 -78
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style-methods-checks.js +0 -17
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style-methods.html +0 -70
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style.html +0 -69
- data/app/assets/components/web-animations-js/test/testcases/auto-test-integer-checks.js +0 -38
- data/app/assets/components/web-animations-js/test/testcases/auto-test-integer.html +0 -52
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iteration-start-checks.js +0 -506
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iteration-start.html +0 -160
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-alternate-checks.js +0 -44
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-alternate-holes-checks.js +0 -41
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-alternate-holes.html +0 -48
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-alternate.html +0 -50
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-basic-checks.js +0 -162
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-basic.html +0 -116
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-fill-checks.js +0 -602
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-fill.html +0 -167
- data/app/assets/components/web-animations-js/test/testcases/auto-test-keyframe-creation-checks.js +0 -67
- data/app/assets/components/web-animations-js/test/testcases/auto-test-keyframe-creation.html +0 -109
- data/app/assets/components/web-animations-js/test/testcases/auto-test-keyframe-easing-checks.js +0 -65
- data/app/assets/components/web-animations-js/test/testcases/auto-test-keyframe-easing.html +0 -64
- data/app/assets/components/web-animations-js/test/testcases/auto-test-length-units-checks.js +0 -342
- data/app/assets/components/web-animations-js/test/testcases/auto-test-length-units.html +0 -103
- data/app/assets/components/web-animations-js/test/testcases/auto-test-matrix-transforms-checks.js +0 -56
- data/app/assets/components/web-animations-js/test/testcases/auto-test-matrix-transforms.html +0 -90
- data/app/assets/components/web-animations-js/test/testcases/auto-test-motion-path-checks.js +0 -110
- data/app/assets/components/web-animations-js/test/testcases/auto-test-motion-path.html +0 -133
- data/app/assets/components/web-animations-js/test/testcases/auto-test-non-numeric-checks.js +0 -26
- data/app/assets/components/web-animations-js/test/testcases/auto-test-non-numeric.html +0 -42
- data/app/assets/components/web-animations-js/test/testcases/auto-test-parent-checks.js +0 -38
- data/app/assets/components/web-animations-js/test/testcases/auto-test-parent.html +0 -52
- data/app/assets/components/web-animations-js/test/testcases/auto-test-partial-keyframes-checks.js +0 -27
- data/app/assets/components/web-animations-js/test/testcases/auto-test-partial-keyframes.html +0 -43
- data/app/assets/components/web-animations-js/test/testcases/auto-test-path-checks.js +0 -20
- data/app/assets/components/web-animations-js/test/testcases/auto-test-path.html +0 -41
- data/app/assets/components/web-animations-js/test/testcases/auto-test-pause-checks.js +0 -79
- data/app/assets/components/web-animations-js/test/testcases/auto-test-pause.html +0 -82
- data/app/assets/components/web-animations-js/test/testcases/auto-test-perspective-checks.js +0 -37
- data/app/assets/components/web-animations-js/test/testcases/auto-test-perspective-origin-checks.js +0 -61
- data/app/assets/components/web-animations-js/test/testcases/auto-test-perspective-origin.html +0 -94
- data/app/assets/components/web-animations-js/test/testcases/auto-test-perspective.html +0 -79
- data/app/assets/components/web-animations-js/test/testcases/auto-test-playback-rate-checks.js +0 -146
- data/app/assets/components/web-animations-js/test/testcases/auto-test-playback-rate.html +0 -128
- data/app/assets/components/web-animations-js/test/testcases/auto-test-position-list-type-checks.js +0 -73
- data/app/assets/components/web-animations-js/test/testcases/auto-test-rectangle-checks.js +0 -23
- data/app/assets/components/web-animations-js/test/testcases/auto-test-rectangle.html +0 -57
- data/app/assets/components/web-animations-js/test/testcases/auto-test-reparent-checks.js +0 -95
- data/app/assets/components/web-animations-js/test/testcases/auto-test-reparent.html +0 -60
- data/app/assets/components/web-animations-js/test/testcases/auto-test-seq-speed-checks.js +0 -69
- data/app/assets/components/web-animations-js/test/testcases/auto-test-seq-speed.html +0 -86
- data/app/assets/components/web-animations-js/test/testcases/auto-test-shorthand-checks.js +0 -197
- data/app/assets/components/web-animations-js/test/testcases/auto-test-shorthand.html +0 -115
- data/app/assets/components/web-animations-js/test/testcases/auto-test-start-time-checks.js +0 -58
- data/app/assets/components/web-animations-js/test/testcases/auto-test-start-time-iterations-checks.js +0 -92
- data/app/assets/components/web-animations-js/test/testcases/auto-test-start-time-iterations.html +0 -107
- data/app/assets/components/web-animations-js/test/testcases/auto-test-start-time.html +0 -90
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-anim-checks.js +0 -23
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-anim.html +0 -39
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-circle-checks.js +0 -23
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-circle.html +0 -38
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-color-checks.js +0 -20
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-color.html +0 -36
- data/app/assets/components/web-animations-js/test/testcases/auto-test-text-shadow-checks.js +0 -20
- data/app/assets/components/web-animations-js/test/testcases/auto-test-text-shadow.html +0 -37
- data/app/assets/components/web-animations-js/test/testcases/auto-test-timing-functions-checks.js +0 -89
- data/app/assets/components/web-animations-js/test/testcases/auto-test-timing-functions.html +0 -77
- data/app/assets/components/web-animations-js/test/testcases/auto-test-to-animation-checks.js +0 -58
- data/app/assets/components/web-animations-js/test/testcases/auto-test-to-animation.html +0 -83
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-3d-checks.js +0 -134
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-3d.html +0 -123
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-functions-checks.js +0 -160
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-functions.html +0 -158
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-origin-checks.js +0 -37
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-origin.html +0 -80
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-primitives-checks.js +0 -292
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-primitives.html +0 -97
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-units-checks.js +0 -202
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-units.html +0 -98
- data/app/assets/components/web-animations-js/test/testcases/auto-test-visibility-checks.js +0 -54
- data/app/assets/components/web-animations-js/test/testcases/auto-test-visibility.html +0 -80
- data/app/assets/components/web-animations-js/test/testcases/auto-test-wrapping-bug-checks.js +0 -58
- data/app/assets/components/web-animations-js/test/testcases/auto-test-wrapping-bug.html +0 -60
- data/app/assets/components/web-animations-js/test/testcases/background.png +0 -0
- data/app/assets/components/web-animations-js/test/testcases/disabled-auto-test-change-playback-rate.html +0 -65
- data/app/assets/components/web-animations-js/test/testcases/disabled-auto-test-position-list-type.html +0 -103
- data/app/assets/components/web-animations-js/test/testcases/disabled-media.html +0 -439
- data/app/assets/components/web-animations-js/test/testcases/disabled-test-compositing-order.html +0 -112
- data/app/assets/components/web-animations-js/test/testcases/impl-test-deprecation.html +0 -85
- data/app/assets/components/web-animations-js/test/testcases/impl-test-from-css-value.html +0 -219
- data/app/assets/components/web-animations-js/test/testcases/impl-test-paced-timing-function.html +0 -83
- data/app/assets/components/web-animations-js/test/testcases/impl-test-totimelinetime.html +0 -37
- data/app/assets/components/web-animations-js/test/testcases/impl-unit-test-position-type.html +0 -256
- data/app/assets/components/web-animations-js/test/testcases/manual-test-add-player-onend.html +0 -57
- data/app/assets/components/web-animations-js/test/testcases/manual-test-preset-timings.html +0 -71
- data/app/assets/components/web-animations-js/test/testcases/manual-test-step.html +0 -88
- data/app/assets/components/web-animations-js/test/testcases/small.mp4 +0 -0
- data/app/assets/components/web-animations-js/test/testcases/small.webm +0 -0
- data/app/assets/components/web-animations-js/test/testcases/test-bounds.html +0 -69
- data/app/assets/components/web-animations-js/test/testcases/test-document-timeline.html +0 -53
- data/app/assets/components/web-animations-js/test/testcases/test-dynamic-load.html +0 -65
- data/app/assets/components/web-animations-js/test/testcases/test-fill-auto.html +0 -78
- data/app/assets/components/web-animations-js/test/testcases/test-getcurrent.html +0 -324
- data/app/assets/components/web-animations-js/test/testcases/test-keyframe-animation-effect.html +0 -248
- data/app/assets/components/web-animations-js/test/testcases/test-keyframe-composite-operation.html +0 -182
- data/app/assets/components/web-animations-js/test/testcases/test-null-target.html +0 -66
- data/app/assets/components/web-animations-js/test/testcases/test-pause-for-testing.html +0 -52
- data/app/assets/components/web-animations-js/test/testcases/test-player-addeventlistener.html +0 -161
- data/app/assets/components/web-animations-js/test/testcases/test-player-cleanup.html +0 -79
- data/app/assets/components/web-animations-js/test/testcases/test-player-finish-event.html +0 -101
- data/app/assets/components/web-animations-js/test/testcases/test-player-sort.html +0 -48
- data/app/assets/components/web-animations-js/test/testcases/test-player.html +0 -786
- data/app/assets/components/web-animations-js/test/testcases/test-pseudo-element-reference.html +0 -38
- data/app/assets/components/web-animations-js/test/testcases/test-repeated-pause.html +0 -54
- data/app/assets/components/web-animations-js/test/testcases/test-restart.html +0 -115
- data/app/assets/components/web-animations-js/test/testcases/test-reversed-player-active-phase.html +0 -28
- data/app/assets/components/web-animations-js/test/testcases/test-rotation-not-reversed.html +0 -55
- data/app/assets/components/web-animations-js/test/testcases/test-update-state.html +0 -113
- data/app/assets/components/web-animations-js/test/testcases/unit-test-clone.html +0 -80
- data/app/assets/components/web-animations-js/test/testcases/unit-test-delay.html +0 -66
- data/app/assets/components/web-animations-js/test/testcases/unit-test-dom-operations.html +0 -164
- data/app/assets/components/web-animations-js/test/testcases/unit-test-duration.html +0 -66
- data/app/assets/components/web-animations-js/test/testcases/unit-test-get-siblings.html +0 -112
- data/app/assets/components/web-animations-js/test/testcases/unit-test-modify-timing-params.html +0 -105
- data/app/assets/components/web-animations-js/test/testcases/unit-test-null-effect.html +0 -43
- data/app/assets/components/web-animations-js/test/testcases/unit-test-set-parent.html +0 -111
- data/app/assets/components/web-animations-js/test/testcases/unit-test-testharness-failure.html +0 -54
- data/app/assets/components/web-animations-js/test/testcases/unit-test-testharness.html +0 -248
- data/app/assets/components/web-animations-js/test/testcases/unit-test-unpause.html +0 -68
- data/app/assets/components/web-animations-js/test/testharness_timing.css +0 -75
- data/app/assets/components/web-animations-js/test/update-testcases.py +0 -63
- data/app/assets/components/web-animations-js/tools/android/config.sh +0 -8
- data/app/assets/components/web-animations-js/tools/android/setup.sh +0 -152
- data/app/assets/components/web-animations-js/tools/android/stop.sh +0 -20
- data/app/assets/components/web-animations-js/tools/python/requirements.txt +0 -12
- data/app/assets/components/web-animations-js/tools/python/run-tests.py +0 -813
- data/app/assets/components/web-animations-js/tools/python/setup.sh +0 -60
- data/app/assets/components/web-animations-js/tutorial/basic-animations/basic-animation-exercise-1.html +0 -62
- data/app/assets/components/web-animations-js/tutorial/basic-animations/basic-animation.html +0 -120
- data/app/assets/components/web-animations-js/tutorial/iframe-contents.html +0 -29
- data/app/assets/components/web-animations-js/tutorial/jquery.js +0 -9555
- data/app/assets/components/web-animations-js/tutorial/page-load.js +0 -114
- data/app/assets/components/web-animations-js/tutorial/parallel/parallel-exercise-1.html +0 -58
- data/app/assets/components/web-animations-js/tutorial/parallel/parallel.html +0 -101
- data/app/assets/components/web-animations-js/tutorial/sample-tutorial.html +0 -44
- data/app/assets/components/web-animations-js/tutorial/try-it-yourself.js +0 -216
- data/app/assets/components/web-animations-js/tutorial/tutorial-style.css +0 -344
- data/app/assets/components/web-animations-js/tutorial/tutorial-testing.js +0 -84
@@ -17,7 +17,7 @@ Example:
|
|
17
17
|
<paper-ripple></paper-ripple>
|
18
18
|
|
19
19
|
`paper-ripple` listens to "down" and "up" events so it would display ripple
|
20
|
-
effect when touches on it. You can also defeat the default behavior and
|
20
|
+
effect when touches on it. You can also defeat the default behavior and
|
21
21
|
manually route the down and up actions to the ripple element. Note that it is
|
22
22
|
important if you call downAction() you will have to make sure to call upAction()
|
23
23
|
so that `paper-ripple` would end the animation loop.
|
@@ -57,6 +57,15 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
57
57
|
@homepage github.io
|
58
58
|
-->
|
59
59
|
|
60
|
+
<!--
|
61
|
+
Fired when the animation finishes. This is useful if you want to wait until the ripple
|
62
|
+
animation finishes to perform some action.
|
63
|
+
|
64
|
+
@event core-transitionend
|
65
|
+
@param {Object} detail
|
66
|
+
@param {Object} detail.node The animated node
|
67
|
+
-->
|
68
|
+
|
60
69
|
<link rel="import" href="../polymer/polymer.html" >
|
61
70
|
|
62
71
|
<polymer-element name="paper-ripple" attributes="initialOpacity opacityDecayVelocity">
|
@@ -67,9 +76,15 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
67
76
|
:host {
|
68
77
|
display: block;
|
69
78
|
position: relative;
|
79
|
+
border-radius: inherit;
|
80
|
+
overflow: hidden;
|
70
81
|
}
|
71
82
|
|
72
|
-
|
83
|
+
:host-context([noink]) {
|
84
|
+
pointer-events: none;
|
85
|
+
}
|
86
|
+
|
87
|
+
#bg, #waves, .wave-container, .wave {
|
73
88
|
pointer-events: none;
|
74
89
|
position: absolute;
|
75
90
|
top: 0;
|
@@ -78,12 +93,33 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
78
93
|
height: 100%;
|
79
94
|
}
|
80
95
|
|
81
|
-
|
96
|
+
#bg, .wave {
|
97
|
+
opacity: 0;
|
98
|
+
}
|
99
|
+
|
100
|
+
#waves, .wave {
|
101
|
+
overflow: hidden;
|
102
|
+
}
|
103
|
+
|
104
|
+
.wave-container, .wave {
|
82
105
|
border-radius: 50%;
|
83
106
|
}
|
84
107
|
|
108
|
+
:host(.circle) #bg,
|
109
|
+
:host(.circle) #waves {
|
110
|
+
border-radius: 50%;
|
111
|
+
}
|
112
|
+
|
113
|
+
:host(.circle) .wave-container {
|
114
|
+
overflow: hidden;
|
115
|
+
}
|
116
|
+
|
85
117
|
</style>
|
86
118
|
|
119
|
+
<div id="bg"></div>
|
120
|
+
<div id="waves">
|
121
|
+
</div>
|
122
|
+
|
87
123
|
</template>
|
88
124
|
<script>
|
89
125
|
|
@@ -94,7 +130,7 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
94
130
|
// INK EQUATIONS
|
95
131
|
//
|
96
132
|
function waveRadiusFn(touchDownMs, touchUpMs, anim) {
|
97
|
-
// Convert from ms to s
|
133
|
+
// Convert from ms to s
|
98
134
|
var touchDown = touchDownMs / 1000;
|
99
135
|
var touchUp = touchUpMs / 1000;
|
100
136
|
var totalElapsed = touchDown + touchUp;
|
@@ -135,34 +171,39 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
135
171
|
// Determines whether the wave should be completely removed.
|
136
172
|
function waveDidFinish(wave, radius, anim) {
|
137
173
|
var waveOpacity = waveOpacityFn(wave.tDown, wave.tUp, anim);
|
174
|
+
|
138
175
|
// If the wave opacity is 0 and the radius exceeds the bounds
|
139
176
|
// of the element, then this is finished.
|
140
|
-
|
141
|
-
return true;
|
142
|
-
}
|
143
|
-
return false;
|
177
|
+
return waveOpacity < 0.01 && radius >= Math.min(wave.maxRadius, waveMaxRadius);
|
144
178
|
};
|
145
179
|
|
146
180
|
function waveAtMaximum(wave, radius, anim) {
|
147
181
|
var waveOpacity = waveOpacityFn(wave.tDown, wave.tUp, anim);
|
148
|
-
|
149
|
-
|
150
|
-
}
|
151
|
-
return false;
|
182
|
+
|
183
|
+
return waveOpacity >= anim.initialOpacity && radius >= Math.min(wave.maxRadius, waveMaxRadius);
|
152
184
|
}
|
153
185
|
|
154
186
|
//
|
155
187
|
// DRAWING
|
156
188
|
//
|
157
|
-
function drawRipple(ctx, x, y, radius,
|
158
|
-
|
159
|
-
|
160
|
-
ctx.
|
189
|
+
function drawRipple(ctx, x, y, radius, innerAlpha, outerAlpha) {
|
190
|
+
// Only animate opacity and transform
|
191
|
+
if (outerAlpha !== undefined) {
|
192
|
+
ctx.bg.style.opacity = outerAlpha;
|
161
193
|
}
|
162
|
-
ctx.
|
163
|
-
|
164
|
-
ctx.
|
165
|
-
ctx.
|
194
|
+
ctx.wave.style.opacity = innerAlpha;
|
195
|
+
|
196
|
+
var s = radius / (ctx.containerSize / 2);
|
197
|
+
var dx = x - (ctx.containerWidth / 2);
|
198
|
+
var dy = y - (ctx.containerHeight / 2);
|
199
|
+
|
200
|
+
ctx.wc.style.webkitTransform = 'translate3d(' + dx + 'px,' + dy + 'px,0)';
|
201
|
+
ctx.wc.style.transform = 'translate3d(' + dx + 'px,' + dy + 'px,0)';
|
202
|
+
|
203
|
+
// 2d transform for safari because of border-radius and overflow:hidden clipping bug.
|
204
|
+
// https://bugs.webkit.org/show_bug.cgi?id=98538
|
205
|
+
ctx.wave.style.webkitTransform = 'scale(' + s + ',' + s + ')';
|
206
|
+
ctx.wave.style.transform = 'scale3d(' + s + ',' + s + ',1)';
|
166
207
|
}
|
167
208
|
|
168
209
|
//
|
@@ -172,7 +213,23 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
172
213
|
var elementStyle = window.getComputedStyle(elem);
|
173
214
|
var fgColor = elementStyle.color;
|
174
215
|
|
216
|
+
var inner = document.createElement('div');
|
217
|
+
inner.style.backgroundColor = fgColor;
|
218
|
+
inner.classList.add('wave');
|
219
|
+
|
220
|
+
var outer = document.createElement('div');
|
221
|
+
outer.classList.add('wave-container');
|
222
|
+
outer.appendChild(inner);
|
223
|
+
|
224
|
+
var container = elem.$.waves;
|
225
|
+
container.appendChild(outer);
|
226
|
+
|
227
|
+
elem.$.bg.style.backgroundColor = fgColor;
|
228
|
+
|
175
229
|
var wave = {
|
230
|
+
bg: elem.$.bg,
|
231
|
+
wc: outer,
|
232
|
+
wave: inner,
|
176
233
|
waveColor: fgColor,
|
177
234
|
maxRadius: 0,
|
178
235
|
isMouseDown: false,
|
@@ -188,6 +245,8 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
188
245
|
if (scope.waves) {
|
189
246
|
var pos = scope.waves.indexOf(wave);
|
190
247
|
scope.waves.splice(pos, 1);
|
248
|
+
// FIXME cache nodes
|
249
|
+
wave.wc.remove();
|
191
250
|
}
|
192
251
|
};
|
193
252
|
|
@@ -249,37 +308,12 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
249
308
|
up: 'upAction'
|
250
309
|
},
|
251
310
|
|
252
|
-
attached: function() {
|
253
|
-
// create the canvas element manually becase ios
|
254
|
-
// does not render the canvas element if it is not created in the
|
255
|
-
// main document (component templates are created in a
|
256
|
-
// different document). See:
|
257
|
-
// https://bugs.webkit.org/show_bug.cgi?id=109073.
|
258
|
-
if (!this.$.canvas) {
|
259
|
-
var canvas = document.createElement('canvas');
|
260
|
-
canvas.id = 'canvas';
|
261
|
-
this.shadowRoot.appendChild(canvas);
|
262
|
-
this.$.canvas = canvas;
|
263
|
-
}
|
264
|
-
},
|
265
|
-
|
266
311
|
ready: function() {
|
267
312
|
this.waves = [];
|
268
313
|
},
|
269
314
|
|
270
|
-
setupCanvas: function() {
|
271
|
-
this.$.canvas.setAttribute('width', this.$.canvas.clientWidth * this.pixelDensity + "px");
|
272
|
-
this.$.canvas.setAttribute('height', this.$.canvas.clientHeight * this.pixelDensity + "px");
|
273
|
-
var ctx = this.$.canvas.getContext('2d');
|
274
|
-
ctx.scale(this.pixelDensity, this.pixelDensity);
|
275
|
-
if (!this._loop) {
|
276
|
-
this._loop = this.animate.bind(this, ctx);
|
277
|
-
}
|
278
|
-
},
|
279
|
-
|
280
315
|
downAction: function(e) {
|
281
|
-
this
|
282
|
-
var wave = createWave(this.$.canvas);
|
316
|
+
var wave = createWave(this);
|
283
317
|
|
284
318
|
this.cancelled = false;
|
285
319
|
wave.isMouseDown = true;
|
@@ -288,9 +322,9 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
288
322
|
wave.mouseUpStart = 0.0;
|
289
323
|
wave.mouseDownStart = now();
|
290
324
|
|
291
|
-
var width = this.$.canvas.width / 2; // Retina canvas
|
292
|
-
var height = this.$.canvas.height / 2;
|
293
325
|
var rect = this.getBoundingClientRect();
|
326
|
+
var width = rect.width;
|
327
|
+
var height = rect.height;
|
294
328
|
var touchX = e.x - rect.left;
|
295
329
|
var touchY = e.y - rect.top;
|
296
330
|
|
@@ -301,9 +335,26 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
301
335
|
wave.slideDistance = dist(wave.startPosition, wave.endPosition);
|
302
336
|
}
|
303
337
|
wave.containerSize = Math.max(width, height);
|
338
|
+
wave.containerWidth = width;
|
339
|
+
wave.containerHeight = height;
|
304
340
|
wave.maxRadius = distanceFromPointToFurthestCorner(wave.startPosition, {w: width, h: height});
|
341
|
+
|
342
|
+
// The wave is circular so constrain its container to 1:1
|
343
|
+
wave.wc.style.top = (wave.containerHeight - wave.containerSize) / 2 + 'px';
|
344
|
+
wave.wc.style.left = (wave.containerWidth - wave.containerSize) / 2 + 'px';
|
345
|
+
wave.wc.style.width = wave.containerSize + 'px';
|
346
|
+
wave.wc.style.height = wave.containerSize + 'px';
|
347
|
+
|
305
348
|
this.waves.push(wave);
|
306
|
-
|
349
|
+
|
350
|
+
if (!this._loop) {
|
351
|
+
this._loop = this.animate.bind(this, {
|
352
|
+
width: width,
|
353
|
+
height: height
|
354
|
+
});
|
355
|
+
requestAnimationFrame(this._loop);
|
356
|
+
}
|
357
|
+
// else there is already a rAF
|
307
358
|
},
|
308
359
|
|
309
360
|
upAction: function() {
|
@@ -328,9 +379,6 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
328
379
|
animate: function(ctx) {
|
329
380
|
var shouldRenderNextFrame = false;
|
330
381
|
|
331
|
-
// Clear the canvas
|
332
|
-
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
333
|
-
|
334
382
|
var deleteTheseWaves = [];
|
335
383
|
// The oldest wave's touch down duration
|
336
384
|
var longestTouchDownDuration = 0;
|
@@ -341,8 +389,8 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
341
389
|
var anim = {
|
342
390
|
initialOpacity: this.initialOpacity,
|
343
391
|
opacityDecayVelocity: this.opacityDecayVelocity,
|
344
|
-
height: ctx.
|
345
|
-
width: ctx.
|
392
|
+
height: ctx.height,
|
393
|
+
width: ctx.width
|
346
394
|
}
|
347
395
|
|
348
396
|
for (var i = 0; i < this.waves.length; i++) {
|
@@ -374,7 +422,7 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
374
422
|
// Ripple gravitational pull to the center of the canvas.
|
375
423
|
if (wave.endPosition) {
|
376
424
|
|
377
|
-
// This translates from the origin to the center of the view based on the max dimension of
|
425
|
+
// This translates from the origin to the center of the view based on the max dimension of
|
378
426
|
var translateFraction = Math.min(1, radius / wave.containerSize * 2 / Math.sqrt(2) );
|
379
427
|
|
380
428
|
x += translateFraction * (wave.endPosition.x - wave.startPosition.x);
|
@@ -389,13 +437,14 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
389
437
|
}
|
390
438
|
|
391
439
|
// Draw the ripple.
|
392
|
-
drawRipple(
|
440
|
+
drawRipple(wave, x, y, radius, waveAlpha, bgFillAlpha);
|
393
441
|
|
394
442
|
// Determine whether there is any more rendering to be done.
|
395
443
|
var maximumWave = waveAtMaximum(wave, radius, anim);
|
396
444
|
var waveDissipated = waveDidFinish(wave, radius, anim);
|
397
445
|
var shouldKeepWave = !waveDissipated || maximumWave;
|
398
|
-
|
446
|
+
// keep rendering dissipating wave when at maximum radius on upAction
|
447
|
+
var shouldRenderWaveAgain = wave.mouseUpStart ? !waveDissipated : !maximumWave;
|
399
448
|
shouldRenderNextFrame = shouldRenderNextFrame || shouldRenderWaveAgain;
|
400
449
|
if (!shouldKeepWave || this.cancelled) {
|
401
450
|
deleteTheseWaves.push(wave);
|
@@ -411,11 +460,11 @@ Apply `circle` class to make the rippling effect within a circle.
|
|
411
460
|
removeWaveFromScope(this, wave);
|
412
461
|
}
|
413
462
|
|
414
|
-
if (!this.waves.length) {
|
415
|
-
//
|
416
|
-
|
417
|
-
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
463
|
+
if (!this.waves.length && this._loop) {
|
464
|
+
// clear the background color
|
465
|
+
this.$.bg.style.backgroundColor = null;
|
418
466
|
this._loop = null;
|
467
|
+
this.fire('core-transitionend');
|
419
468
|
}
|
420
469
|
}
|
421
470
|
|
@@ -7,9 +7,9 @@
|
|
7
7
|
Code distributed by Google as part of the polymer project is also
|
8
8
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
9
|
-->
|
10
|
-
<x-meta id="paper-shadow" label="Shadow" group="Paper">
|
10
|
+
<x-meta id="paper-shadow" label="Shadow" group="Paper" isContainer>
|
11
11
|
<template>
|
12
|
-
<paper-shadow></paper-shadow>
|
12
|
+
<paper-shadow style="width:200px; height:200px;"></paper-shadow>
|
13
13
|
</template>
|
14
14
|
<template id="imports">
|
15
15
|
<link rel="import" href="paper-shadow.html">
|
@@ -8,84 +8,59 @@
|
|
8
8
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
html /deep/ paper-shadow,
|
12
|
+
html /deep/ paper-animated-shadow {
|
13
|
+
display: block;
|
14
|
+
position: relative;
|
15
|
+
}
|
16
|
+
|
17
|
+
html /deep/ paper-shadow::shadow #shadow-bottom,
|
18
|
+
html /deep/ paper-shadow::shadow #shadow-top {
|
17
19
|
border-radius: inherit;
|
18
20
|
pointer-events: none;
|
19
21
|
}
|
20
22
|
|
21
|
-
|
23
|
+
html /deep/ paper-shadow::shadow #shadow-bottom[animated],
|
24
|
+
html /deep/ paper-shadow::shadow #shadow-top[animated] {
|
22
25
|
transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
|
23
26
|
}
|
24
27
|
|
25
|
-
.paper-shadow-top-z-1 {
|
28
|
+
html /deep/ .paper-shadow-top-z-1 {
|
26
29
|
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.16);
|
27
30
|
}
|
28
31
|
|
29
|
-
.paper-shadow-bottom-z-1 {
|
32
|
+
html /deep/ .paper-shadow-bottom-z-1 {
|
30
33
|
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
|
31
34
|
}
|
32
35
|
|
33
|
-
.paper-shadow-top-z-2 {
|
36
|
+
html /deep/ .paper-shadow-top-z-2 {
|
34
37
|
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
35
38
|
}
|
36
39
|
|
37
|
-
.paper-shadow-bottom-z-2 {
|
40
|
+
html /deep/ .paper-shadow-bottom-z-2 {
|
38
41
|
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2);
|
39
42
|
}
|
40
43
|
|
41
|
-
.paper-shadow-top-z-3 {
|
44
|
+
html /deep/ .paper-shadow-top-z-3 {
|
42
45
|
box-shadow: 0 17px 50px 0 rgba(0, 0, 0, 0.19);
|
43
46
|
}
|
44
47
|
|
45
|
-
.paper-shadow-bottom-z-3 {
|
48
|
+
html /deep/ .paper-shadow-bottom-z-3 {
|
46
49
|
box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24);
|
47
50
|
}
|
48
51
|
|
49
|
-
.paper-shadow-top-z-4 {
|
52
|
+
html /deep/ .paper-shadow-top-z-4 {
|
50
53
|
box-shadow: 0 25px 55px 0 rgba(0, 0, 0, 0.21);
|
51
54
|
}
|
52
55
|
|
53
|
-
.paper-shadow-bottom-z-4 {
|
56
|
+
html /deep/ .paper-shadow-bottom-z-4 {
|
54
57
|
box-shadow: 0 16px 28px 0 rgba(0, 0, 0, 0.22);
|
55
58
|
}
|
56
59
|
|
57
|
-
.paper-shadow-top-z-5 {
|
60
|
+
html /deep/ .paper-shadow-top-z-5 {
|
58
61
|
box-shadow: 0 40px 77px 0 rgba(0, 0, 0, 0.22);
|
59
62
|
}
|
60
63
|
|
61
|
-
.paper-shadow-bottom-z-5 {
|
64
|
+
html /deep/ .paper-shadow-bottom-z-5 {
|
62
65
|
box-shadow: 0 27px 24px 0 rgba(0, 0, 0, 0.2);
|
63
|
-
}
|
64
|
-
|
65
|
-
.paper-shadow-animate-z-1-z-2.paper-shadow-top {
|
66
|
-
-webkit-transition: none;
|
67
|
-
-webkit-animation: animate-shadow-top-z-1-z-2 0.7s infinite alternate;
|
68
|
-
}
|
69
|
-
|
70
|
-
.paper-shadow-animate-z-1-z-2 .paper-shadow-bottom {
|
71
|
-
-webkit-transition: none;
|
72
|
-
-webkit-animation: animate-shadow-bottom-z-1-z-2 0.7s infinite alternate;
|
73
|
-
}
|
74
|
-
|
75
|
-
@-webkit-keyframes animate-shadow-top-z-1-z-2 {
|
76
|
-
0% {
|
77
|
-
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.16);
|
78
|
-
}
|
79
|
-
100% {
|
80
|
-
box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
81
|
-
}
|
82
|
-
}
|
83
|
-
|
84
|
-
@-webkit-keyframes animate-shadow-bottom-z-1-z-2 {
|
85
|
-
0% {
|
86
|
-
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
|
87
|
-
}
|
88
|
-
100% {
|
89
|
-
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2);
|
90
|
-
}
|
91
66
|
}
|
@@ -8,44 +8,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
8
8
|
-->
|
9
9
|
|
10
10
|
<!--
|
11
|
-
The `paper-shadow` element is a helper to add shadows to elements.
|
12
|
-
Paper shadows are composed of two shadows on top of each other. We
|
13
|
-
mimic this effect by using two elements on top of each other, each with a
|
14
|
-
different drop shadow. You can apply the shadow to an element by assigning
|
15
|
-
it as the target. If you do not specify a target, the shadow is applied to
|
16
|
-
the `paper-shadow` element's parent element or shadow host element if its
|
17
|
-
parent is a shadow root. Alternatively, you can use the CSS classes included
|
18
|
-
by this element directly.
|
19
11
|
|
20
|
-
|
21
|
-
|
22
|
-
<div id="myCard" class="card"></div>
|
23
|
-
<paper-shadow id="myShadow" z="1"></div>
|
24
|
-
|
25
|
-
// Assign a target explicitly
|
26
|
-
myShadow.target = document.getElementById('myCard');
|
27
|
-
|
28
|
-
// Auto-assign the target.
|
29
|
-
<div class="card">
|
30
|
-
<paper-shadow z="1"></paper-shadow>
|
31
|
-
</div>
|
12
|
+
`paper-shadow` is a container that renders two shadows on top of each other to
|
13
|
+
create the effect of a lifted piece of paper.
|
32
14
|
|
33
|
-
|
34
|
-
<div class="card paper-shadow-top paper-shadow-top-z-1">
|
35
|
-
<div class="card-inner paper-shadow-bottom paper-shadow-bottom-z-1"></div>
|
36
|
-
</div>
|
37
|
-
|
38
|
-
If you assign a target to a `paper-shadow` element, it creates two nodes and inserts
|
39
|
-
them as the first children of the target, or the first children of the target's shadow
|
40
|
-
root if there is one. This implies:
|
41
|
-
|
42
|
-
1. If the primary node that drops the shadow has styling that affects its shape,
|
43
|
-
the same styling must be applied to elements with class `paper-shadow`.
|
44
|
-
`border-radius` is a very common property and is inherited automatically.
|
15
|
+
Example:
|
45
16
|
|
46
|
-
|
47
|
-
|
48
|
-
|
17
|
+
<paper-shadow z="1">
|
18
|
+
... card content ...
|
19
|
+
</paper-shadow>
|
49
20
|
|
50
21
|
@group Paper Elements
|
51
22
|
@class paper-shadow
|
@@ -53,167 +24,56 @@ root if there is one. This implies:
|
|
53
24
|
|
54
25
|
<link href="../polymer/polymer.html" rel="import">
|
55
26
|
|
27
|
+
<link href="paper-shadow.css" rel="stylesheet" shim-shadowdom>
|
28
|
+
|
56
29
|
<polymer-element name="paper-shadow">
|
57
30
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
* @type boolean
|
102
|
-
* @default false
|
103
|
-
*/
|
104
|
-
hasPosition: false
|
105
|
-
},
|
106
|
-
|
107
|
-
// NOTE: include template so that styles are loaded, but remove
|
108
|
-
// so that we can decide dynamically what part to include
|
109
|
-
registerCallback: function(polymerElement) {
|
110
|
-
var template = polymerElement.querySelector('template');
|
111
|
-
this._style = template.content.querySelector('style');
|
112
|
-
this._style.removeAttribute('no-shim');
|
113
|
-
},
|
114
|
-
|
115
|
-
fetchTemplate: function() {
|
116
|
-
return null;
|
117
|
-
},
|
118
|
-
|
119
|
-
attached: function() {
|
120
|
-
// If no target is bound at attach, default the target to the parent
|
121
|
-
// element or shadow host.
|
122
|
-
if (!this.target) {
|
123
|
-
if (!this.parentElement && this.parentNode.host) {
|
124
|
-
this.target = this.parentNode.host;
|
125
|
-
} else if (this.parentElement && (window.ShadowDOMPolyfill ? this.parentElement !== wrap(document.body) : this.parentElement !== document.body)) {
|
126
|
-
this.target = this.parentElement;
|
127
|
-
}
|
128
|
-
}
|
129
|
-
},
|
130
|
-
|
131
|
-
targetChanged: function(old) {
|
132
|
-
if (old) {
|
133
|
-
this.removeShadow(old);
|
134
|
-
}
|
135
|
-
if (this.target) {
|
136
|
-
this.addShadow(this.target);
|
137
|
-
}
|
138
|
-
},
|
139
|
-
|
140
|
-
zChanged: function(old) {
|
141
|
-
if (this.target && this.target._paperShadow) {
|
142
|
-
var shadow = this.target._paperShadow;
|
143
|
-
['top', 'bottom'].forEach(function(s) {
|
144
|
-
shadow[s].classList.remove('paper-shadow-' + s + '-z-' + old);
|
145
|
-
shadow[s].classList.add('paper-shadow-' + s + '-z-' + this.z);
|
146
|
-
}.bind(this));
|
147
|
-
}
|
148
|
-
},
|
149
|
-
|
150
|
-
animatedChanged: function() {
|
151
|
-
if (this.target && this.target._paperShadow) {
|
152
|
-
var shadow = this.target._paperShadow;
|
153
|
-
['top', 'bottom'].forEach(function(s) {
|
154
|
-
if (this.animated) {
|
155
|
-
shadow[s].classList.add('paper-shadow-animated');
|
156
|
-
} else {
|
157
|
-
shadow[s].classList.remove('paper-shadow-animated');
|
158
|
-
}
|
159
|
-
}.bind(this));
|
160
|
-
}
|
161
|
-
},
|
162
|
-
|
163
|
-
addShadow: function(node) {
|
164
|
-
if (node._paperShadow) {
|
165
|
-
return;
|
166
|
-
}
|
167
|
-
|
168
|
-
if (!node._hasShadowStyle) {
|
169
|
-
if (!node.shadowRoot) {
|
170
|
-
node.createShadowRoot().innerHTML = '<content></content>';
|
171
|
-
}
|
172
|
-
this.installScopeStyle(this._style, 'shadow', node.shadowRoot);
|
173
|
-
node._hasShadowStyle = true;
|
174
|
-
}
|
175
|
-
|
176
|
-
var computed = getComputedStyle(node);
|
177
|
-
if (!this.hasPosition && computed.position === 'static') {
|
178
|
-
node.style.position = 'relative';
|
179
|
-
}
|
180
|
-
node.style.overflow = 'visible';
|
181
|
-
|
182
|
-
// Both the top and bottom shadows are children of the target, so
|
183
|
-
// it does not affect the classes and CSS properties of the target.
|
184
|
-
['top', 'bottom'].forEach(function(s) {
|
185
|
-
var inner = (node._paperShadow && node._paperShadow[s]) || document.createElement('div');
|
186
|
-
inner.classList.add('paper-shadow');
|
187
|
-
inner.classList.add('paper-shadow-' + s + '-z-' + this.z);
|
188
|
-
if (this.animated) {
|
189
|
-
inner.classList.add('paper-shadow-animated');
|
190
|
-
}
|
191
|
-
|
192
|
-
if (node.shadowRoot) {
|
193
|
-
node.shadowRoot.insertBefore(inner, node.shadowRoot.firstChild);
|
194
|
-
} else {
|
195
|
-
node.insertBefore(inner, node.firstChild);
|
196
|
-
}
|
197
|
-
|
198
|
-
node._paperShadow = node._paperShadow || {};
|
199
|
-
node._paperShadow[s] = inner;
|
200
|
-
}.bind(this));
|
201
|
-
|
202
|
-
},
|
203
|
-
|
204
|
-
removeShadow: function(node) {
|
205
|
-
if (!node._paperShadow) {
|
206
|
-
return;
|
207
|
-
}
|
208
|
-
|
209
|
-
['top', 'bottom'].forEach(function(s) {
|
210
|
-
node._paperShadow[s].remove();
|
211
|
-
});
|
212
|
-
node._paperShadow = null;
|
213
|
-
|
214
|
-
node.style.position = null;
|
31
|
+
<template>
|
32
|
+
|
33
|
+
<div id="shadow-bottom" fit animated?="[[animated]]" class="paper-shadow-bottom-z-[[z]]"></div>
|
34
|
+
<div id="shadow-top" fit animated?="[[animated]]" class="paper-shadow-top-z-[[z]]"></div>
|
35
|
+
|
36
|
+
<content></content>
|
37
|
+
|
38
|
+
</template>
|
39
|
+
|
40
|
+
<script>
|
41
|
+
Polymer({
|
42
|
+
|
43
|
+
publish: {
|
44
|
+
|
45
|
+
/**
|
46
|
+
* The z-depth of this shadow, from 0-5. Setting this property
|
47
|
+
* after element creation has no effect. Use `setZ()` instead.
|
48
|
+
*
|
49
|
+
* @attribute z
|
50
|
+
* @type number
|
51
|
+
* @default 1
|
52
|
+
*/
|
53
|
+
z: 1,
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Set this to true to animate the shadow when setting a new
|
57
|
+
* `z` value.
|
58
|
+
*
|
59
|
+
* @attribute animated
|
60
|
+
* @type boolean
|
61
|
+
* @default false
|
62
|
+
*/
|
63
|
+
animated: false
|
64
|
+
|
65
|
+
},
|
66
|
+
|
67
|
+
setZ: function(newZ) {
|
68
|
+
if (this.z !== newZ) {
|
69
|
+
this.$['shadow-bottom'].classList.remove('paper-shadow-bottom-z-' + this.z);
|
70
|
+
this.$['shadow-bottom'].classList.add('paper-shadow-bottom-z-' + newZ);
|
71
|
+
this.$['shadow-top'].classList.remove('paper-shadow-top-z-' + this.z);
|
72
|
+
this.$['shadow-top'].classList.add('paper-shadow-top-z-' + newZ);
|
73
|
+
this.z = newZ;
|
215
74
|
}
|
75
|
+
}
|
216
76
|
|
217
|
-
|
218
|
-
|
219
|
-
</polymer-element>
|
77
|
+
});
|
78
|
+
</script>
|
79
|
+
</polymer-element>
|