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
@@ -0,0 +1,452 @@
|
|
1
|
+
// Copyright 2014 Google Inc. All rights reserved.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
(function(scope, testing) {
|
16
|
+
var decomposeMatrix = (function() {
|
17
|
+
function determinant(m) {
|
18
|
+
return m[0][0] * m[1][1] * m[2][2] +
|
19
|
+
m[1][0] * m[2][1] * m[0][2] +
|
20
|
+
m[2][0] * m[0][1] * m[1][2] -
|
21
|
+
m[0][2] * m[1][1] * m[2][0] -
|
22
|
+
m[1][2] * m[2][1] * m[0][0] -
|
23
|
+
m[2][2] * m[0][1] * m[1][0];
|
24
|
+
}
|
25
|
+
|
26
|
+
// from Wikipedia:
|
27
|
+
//
|
28
|
+
// [A B]^-1 = [A^-1 + A^-1B(D - CA^-1B)^-1CA^-1 -A^-1B(D - CA^-1B)^-1]
|
29
|
+
// [C D] [-(D - CA^-1B)^-1CA^-1 (D - CA^-1B)^-1 ]
|
30
|
+
//
|
31
|
+
// Therefore
|
32
|
+
//
|
33
|
+
// [A [0]]^-1 = [A^-1 [0]]
|
34
|
+
// [C 1 ] [ -CA^-1 1 ]
|
35
|
+
function inverse(m) {
|
36
|
+
var iDet = 1 / determinant(m);
|
37
|
+
var a = m[0][0], b = m[0][1], c = m[0][2];
|
38
|
+
var d = m[1][0], e = m[1][1], f = m[1][2];
|
39
|
+
var g = m[2][0], h = m[2][1], k = m[2][2];
|
40
|
+
var Ainv = [
|
41
|
+
[(e * k - f * h) * iDet, (c * h - b * k) * iDet,
|
42
|
+
(b * f - c * e) * iDet, 0],
|
43
|
+
[(f * g - d * k) * iDet, (a * k - c * g) * iDet,
|
44
|
+
(c * d - a * f) * iDet, 0],
|
45
|
+
[(d * h - e * g) * iDet, (g * b - a * h) * iDet,
|
46
|
+
(a * e - b * d) * iDet, 0]
|
47
|
+
];
|
48
|
+
var lastRow = [];
|
49
|
+
for (var i = 0; i < 3; i++) {
|
50
|
+
var val = 0;
|
51
|
+
for (var j = 0; j < 3; j++) {
|
52
|
+
val += m[3][j] * Ainv[j][i];
|
53
|
+
}
|
54
|
+
lastRow.push(val);
|
55
|
+
}
|
56
|
+
lastRow.push(1);
|
57
|
+
Ainv.push(lastRow);
|
58
|
+
return Ainv;
|
59
|
+
}
|
60
|
+
|
61
|
+
function transposeMatrix4(m) {
|
62
|
+
return [[m[0][0], m[1][0], m[2][0], m[3][0]],
|
63
|
+
[m[0][1], m[1][1], m[2][1], m[3][1]],
|
64
|
+
[m[0][2], m[1][2], m[2][2], m[3][2]],
|
65
|
+
[m[0][3], m[1][3], m[2][3], m[3][3]]];
|
66
|
+
}
|
67
|
+
|
68
|
+
function multVecMatrix(v, m) {
|
69
|
+
var result = [];
|
70
|
+
for (var i = 0; i < 4; i++) {
|
71
|
+
var val = 0;
|
72
|
+
for (var j = 0; j < 4; j++) {
|
73
|
+
val += v[j] * m[j][i];
|
74
|
+
}
|
75
|
+
result.push(val);
|
76
|
+
}
|
77
|
+
return result;
|
78
|
+
}
|
79
|
+
|
80
|
+
function normalize(v) {
|
81
|
+
var len = length(v);
|
82
|
+
return [v[0] / len, v[1] / len, v[2] / len];
|
83
|
+
}
|
84
|
+
|
85
|
+
function length(v) {
|
86
|
+
return Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
|
87
|
+
}
|
88
|
+
|
89
|
+
function combine(v1, v2, v1s, v2s) {
|
90
|
+
return [v1s * v1[0] + v2s * v2[0], v1s * v1[1] + v2s * v2[1],
|
91
|
+
v1s * v1[2] + v2s * v2[2]];
|
92
|
+
}
|
93
|
+
|
94
|
+
function cross(v1, v2) {
|
95
|
+
return [v1[1] * v2[2] - v1[2] * v2[1],
|
96
|
+
v1[2] * v2[0] - v1[0] * v2[2],
|
97
|
+
v1[0] * v2[1] - v1[1] * v2[0]];
|
98
|
+
}
|
99
|
+
|
100
|
+
// TODO: Implement 2D matrix decomposition.
|
101
|
+
// http://dev.w3.org/csswg/css-transforms/#decomposing-a-2d-matrix
|
102
|
+
function decomposeMatrix(matrix) {
|
103
|
+
var m3d = [
|
104
|
+
matrix.slice(0, 4),
|
105
|
+
matrix.slice(4, 8),
|
106
|
+
matrix.slice(8, 12),
|
107
|
+
matrix.slice(12, 16)
|
108
|
+
];
|
109
|
+
|
110
|
+
// skip normalization step as m3d[3][3] should always be 1
|
111
|
+
if (m3d[3][3] !== 1) {
|
112
|
+
return null;
|
113
|
+
}
|
114
|
+
|
115
|
+
var perspectiveMatrix = [];
|
116
|
+
for (var i = 0; i < 4; i++) {
|
117
|
+
perspectiveMatrix.push(m3d[i].slice());
|
118
|
+
}
|
119
|
+
|
120
|
+
for (var i = 0; i < 3; i++) {
|
121
|
+
perspectiveMatrix[i][3] = 0;
|
122
|
+
}
|
123
|
+
|
124
|
+
if (determinant(perspectiveMatrix) === 0) {
|
125
|
+
return false;
|
126
|
+
}
|
127
|
+
|
128
|
+
var rhs = [];
|
129
|
+
|
130
|
+
var perspective;
|
131
|
+
if (m3d[0][3] || m3d[1][3] || m3d[2][3]) {
|
132
|
+
rhs.push(m3d[0][3]);
|
133
|
+
rhs.push(m3d[1][3]);
|
134
|
+
rhs.push(m3d[2][3]);
|
135
|
+
rhs.push(m3d[3][3]);
|
136
|
+
|
137
|
+
var inversePerspectiveMatrix = inverse(perspectiveMatrix);
|
138
|
+
var transposedInversePerspectiveMatrix =
|
139
|
+
transposeMatrix4(inversePerspectiveMatrix);
|
140
|
+
perspective = multVecMatrix(rhs, transposedInversePerspectiveMatrix);
|
141
|
+
} else {
|
142
|
+
perspective = [0, 0, 0, 1];
|
143
|
+
}
|
144
|
+
|
145
|
+
var translate = m3d[3].slice(0, 3);
|
146
|
+
|
147
|
+
var row = [];
|
148
|
+
row.push(m3d[0].slice(0, 3));
|
149
|
+
var scale = [];
|
150
|
+
scale.push(length(row[0]));
|
151
|
+
row[0] = normalize(row[0]);
|
152
|
+
|
153
|
+
var skew = [];
|
154
|
+
row.push(m3d[1].slice(0, 3));
|
155
|
+
skew.push(dot(row[0], row[1]));
|
156
|
+
row[1] = combine(row[1], row[0], 1.0, -skew[0]);
|
157
|
+
|
158
|
+
scale.push(length(row[1]));
|
159
|
+
row[1] = normalize(row[1]);
|
160
|
+
skew[0] /= scale[1];
|
161
|
+
|
162
|
+
row.push(m3d[2].slice(0, 3));
|
163
|
+
skew.push(dot(row[0], row[2]));
|
164
|
+
row[2] = combine(row[2], row[0], 1.0, -skew[1]);
|
165
|
+
skew.push(dot(row[1], row[2]));
|
166
|
+
row[2] = combine(row[2], row[1], 1.0, -skew[2]);
|
167
|
+
|
168
|
+
scale.push(length(row[2]));
|
169
|
+
row[2] = normalize(row[2]);
|
170
|
+
skew[1] /= scale[2];
|
171
|
+
skew[2] /= scale[2];
|
172
|
+
|
173
|
+
var pdum3 = cross(row[1], row[2]);
|
174
|
+
if (dot(row[0], pdum3) < 0) {
|
175
|
+
for (var i = 0; i < 3; i++) {
|
176
|
+
scale[i] *= -1;
|
177
|
+
row[i][0] *= -1;
|
178
|
+
row[i][1] *= -1;
|
179
|
+
row[i][2] *= -1;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
var t = row[0][0] + row[1][1] + row[2][2] + 1;
|
184
|
+
var s;
|
185
|
+
var quaternion;
|
186
|
+
|
187
|
+
if (t > 1e-4) {
|
188
|
+
s = 0.5 / Math.sqrt(t);
|
189
|
+
quaternion = [
|
190
|
+
(row[2][1] - row[1][2]) * s,
|
191
|
+
(row[0][2] - row[2][0]) * s,
|
192
|
+
(row[1][0] - row[0][1]) * s,
|
193
|
+
0.25 / s
|
194
|
+
];
|
195
|
+
} else if (row[0][0] > row[1][1] && row[0][0] > row[2][2]) {
|
196
|
+
s = Math.sqrt(1 + row[0][0] - row[1][1] - row[2][2]) * 2.0;
|
197
|
+
quaternion = [
|
198
|
+
0.25 * s,
|
199
|
+
(row[0][1] + row[1][0]) / s,
|
200
|
+
(row[0][2] + row[2][0]) / s,
|
201
|
+
(row[2][1] - row[1][2]) / s
|
202
|
+
];
|
203
|
+
} else if (row[1][1] > row[2][2]) {
|
204
|
+
s = Math.sqrt(1.0 + row[1][1] - row[0][0] - row[2][2]) * 2.0;
|
205
|
+
quaternion = [
|
206
|
+
(row[0][1] + row[1][0]) / s,
|
207
|
+
0.25 * s,
|
208
|
+
(row[1][2] + row[2][1]) / s,
|
209
|
+
(row[0][2] - row[2][0]) / s
|
210
|
+
];
|
211
|
+
} else {
|
212
|
+
s = Math.sqrt(1.0 + row[2][2] - row[0][0] - row[1][1]) * 2.0;
|
213
|
+
quaternion = [
|
214
|
+
(row[0][2] + row[2][0]) / s,
|
215
|
+
(row[1][2] + row[2][1]) / s,
|
216
|
+
0.25 * s,
|
217
|
+
(row[1][0] - row[0][1]) / s
|
218
|
+
];
|
219
|
+
}
|
220
|
+
|
221
|
+
return [translate, scale, skew, quaternion, perspective];
|
222
|
+
}
|
223
|
+
return decomposeMatrix;
|
224
|
+
})();
|
225
|
+
|
226
|
+
function dot(v1, v2) {
|
227
|
+
var result = 0;
|
228
|
+
for (var i = 0; i < v1.length; i++) {
|
229
|
+
result += v1[i] * v2[i];
|
230
|
+
}
|
231
|
+
return result;
|
232
|
+
}
|
233
|
+
|
234
|
+
function multiplyMatrices(a, b) {
|
235
|
+
return [
|
236
|
+
a[0] * b[0] + a[4] * b[1] + a[8] * b[2] + a[12] * b[3],
|
237
|
+
a[1] * b[0] + a[5] * b[1] + a[9] * b[2] + a[13] * b[3],
|
238
|
+
a[2] * b[0] + a[6] * b[1] + a[10] * b[2] + a[14] * b[3],
|
239
|
+
a[3] * b[0] + a[7] * b[1] + a[11] * b[2] + a[15] * b[3],
|
240
|
+
|
241
|
+
a[0] * b[4] + a[4] * b[5] + a[8] * b[6] + a[12] * b[7],
|
242
|
+
a[1] * b[4] + a[5] * b[5] + a[9] * b[6] + a[13] * b[7],
|
243
|
+
a[2] * b[4] + a[6] * b[5] + a[10] * b[6] + a[14] * b[7],
|
244
|
+
a[3] * b[4] + a[7] * b[5] + a[11] * b[6] + a[15] * b[7],
|
245
|
+
|
246
|
+
a[0] * b[8] + a[4] * b[9] + a[8] * b[10] + a[12] * b[11],
|
247
|
+
a[1] * b[8] + a[5] * b[9] + a[9] * b[10] + a[13] * b[11],
|
248
|
+
a[2] * b[8] + a[6] * b[9] + a[10] * b[10] + a[14] * b[11],
|
249
|
+
a[3] * b[8] + a[7] * b[9] + a[11] * b[10] + a[15] * b[11],
|
250
|
+
|
251
|
+
a[0] * b[12] + a[4] * b[13] + a[8] * b[14] + a[12] * b[15],
|
252
|
+
a[1] * b[12] + a[5] * b[13] + a[9] * b[14] + a[13] * b[15],
|
253
|
+
a[2] * b[12] + a[6] * b[13] + a[10] * b[14] + a[14] * b[15],
|
254
|
+
a[3] * b[12] + a[7] * b[13] + a[11] * b[14] + a[15] * b[15]
|
255
|
+
];
|
256
|
+
}
|
257
|
+
|
258
|
+
// TODO: This can probably be made smaller.
|
259
|
+
function convertItemToMatrix(item) {
|
260
|
+
switch (item.t) {
|
261
|
+
// TODO: Handle units other than rads and degs.
|
262
|
+
case 'rotatex':
|
263
|
+
var rads = item.d[0].rad || 0;
|
264
|
+
var degs = item.d[0].deg || 0;
|
265
|
+
var angle = (degs * Math.PI / 180) + rads;
|
266
|
+
return [1, 0, 0, 0,
|
267
|
+
0, Math.cos(angle), Math.sin(angle), 0,
|
268
|
+
0, -Math.sin(angle), Math.cos(angle), 0,
|
269
|
+
0, 0, 0, 1];
|
270
|
+
case 'rotatey':
|
271
|
+
var rads = item.d[0].rad || 0;
|
272
|
+
var degs = item.d[0].deg || 0;
|
273
|
+
var angle = (degs * Math.PI / 180) + rads;
|
274
|
+
return [Math.cos(angle), 0, -Math.sin(angle), 0,
|
275
|
+
0, 1, 0, 0,
|
276
|
+
Math.sin(angle), 0, Math.cos(angle), 0,
|
277
|
+
0, 0, 0, 1];
|
278
|
+
case 'rotate':
|
279
|
+
case 'rotatez':
|
280
|
+
var rads = item.d[0].rad || 0;
|
281
|
+
var degs = item.d[0].deg || 0;
|
282
|
+
var angle = (degs * Math.PI / 180) + rads;
|
283
|
+
return [Math.cos(angle), Math.sin(angle), 0, 0,
|
284
|
+
-Math.sin(angle), Math.cos(angle), 0, 0,
|
285
|
+
0, 0, 1, 0,
|
286
|
+
0, 0, 0, 1];
|
287
|
+
case 'rotate3d':
|
288
|
+
var x = item.d[0];
|
289
|
+
var y = item.d[1];
|
290
|
+
var z = item.d[2];
|
291
|
+
var rads = item.d[3].rad || 0;
|
292
|
+
var degs = item.d[3].deg || 0;
|
293
|
+
var angle = (degs * Math.PI / 180) + rads;
|
294
|
+
|
295
|
+
var sqrLength = x * x + y * y + z * z;
|
296
|
+
if (sqrLength === 0) {
|
297
|
+
x = 1;
|
298
|
+
y = 0;
|
299
|
+
z = 0;
|
300
|
+
} else if (sqrLength !== 1) {
|
301
|
+
var length = Math.sqrt(sqrLength);
|
302
|
+
x /= length;
|
303
|
+
y /= length;
|
304
|
+
z /= length;
|
305
|
+
}
|
306
|
+
|
307
|
+
var s = Math.sin(angle / 2);
|
308
|
+
var sc = s * Math.cos(angle / 2);
|
309
|
+
var sq = s * s;
|
310
|
+
return [
|
311
|
+
1 - 2 * (y * y + z * z) * sq,
|
312
|
+
2 * (x * y * sq + z * sc),
|
313
|
+
2 * (x * z * sq - y * sc),
|
314
|
+
0,
|
315
|
+
|
316
|
+
2 * (x * y * sq - z * sc),
|
317
|
+
1 - 2 * (x * x + z * z) * sq,
|
318
|
+
2 * (y * z * sq + x * sc),
|
319
|
+
0,
|
320
|
+
|
321
|
+
2 * (x * z * sq + y * sc),
|
322
|
+
2 * (y * z * sq - x * sc),
|
323
|
+
1 - 2 * (x * x + y * y) * sq,
|
324
|
+
0,
|
325
|
+
|
326
|
+
0, 0, 0, 1
|
327
|
+
];
|
328
|
+
case 'scale':
|
329
|
+
return [item.d[0], 0, 0, 0,
|
330
|
+
0, item.d[1], 0, 0,
|
331
|
+
0, 0, 1, 0,
|
332
|
+
0, 0, 0, 1];
|
333
|
+
case 'scalex':
|
334
|
+
return [item.d[0], 0, 0, 0,
|
335
|
+
0, 1, 0, 0,
|
336
|
+
0, 0, 1, 0,
|
337
|
+
0, 0, 0, 1];
|
338
|
+
case 'scaley':
|
339
|
+
return [1, 0, 0, 0,
|
340
|
+
0, item.d[0], 0, 0,
|
341
|
+
0, 0, 1, 0,
|
342
|
+
0, 0, 0, 1];
|
343
|
+
case 'scalez':
|
344
|
+
return [1, 0, 0, 0,
|
345
|
+
0, 1, 0, 0,
|
346
|
+
0, 0, item.d[0], 0,
|
347
|
+
0, 0, 0, 1];
|
348
|
+
case 'scale3d':
|
349
|
+
return [item.d[0], 0, 0, 0,
|
350
|
+
0, item.d[1], 0, 0,
|
351
|
+
0, 0, item.d[2], 0,
|
352
|
+
0, 0, 0, 1];
|
353
|
+
// FIXME: Skew behaves differently in Blink, FireFox and here. Need to work out why.
|
354
|
+
case 'skew':
|
355
|
+
var xDegs = item.d[0].deg || 0;
|
356
|
+
var xRads = item.d[0].rad || 0;
|
357
|
+
var yDegs = item.d[1].deg || 0;
|
358
|
+
var yRads = item.d[1].rad || 0;
|
359
|
+
var xAngle = (xDegs * Math.PI / 180) + xRads;
|
360
|
+
var yAngle = (yDegs * Math.PI / 180) + yRads;
|
361
|
+
return [1, Math.tan(yAngle), 0, 0,
|
362
|
+
Math.tan(xAngle), 1, 0, 0,
|
363
|
+
0, 0, 1, 0,
|
364
|
+
0, 0, 0, 1];
|
365
|
+
case 'skewx':
|
366
|
+
var rads = item.d[0].rad || 0;
|
367
|
+
var degs = item.d[0].deg || 0;
|
368
|
+
var angle = (degs * Math.PI / 180) + rads;
|
369
|
+
return [1, 0, 0, 0,
|
370
|
+
Math.tan(angle), 1, 0, 0,
|
371
|
+
0, 0, 1, 0,
|
372
|
+
0, 0, 0, 1];
|
373
|
+
case 'skewy':
|
374
|
+
var rads = item.d[0].rad || 0;
|
375
|
+
var degs = item.d[0].deg || 0;
|
376
|
+
var angle = (degs * Math.PI / 180) + rads;
|
377
|
+
return [1, Math.tan(angle), 0, 0,
|
378
|
+
0, 1, 0, 0,
|
379
|
+
0, 0, 1, 0,
|
380
|
+
0, 0, 0, 1];
|
381
|
+
// TODO: Work out what to do with non-px values.
|
382
|
+
case 'translate':
|
383
|
+
var x = item.d[0].px || 0;
|
384
|
+
var y = item.d[1].px || 0;
|
385
|
+
return [1, 0, 0, 0,
|
386
|
+
0, 1, 0, 0,
|
387
|
+
0, 0, 1, 0,
|
388
|
+
x, y, 0, 1];
|
389
|
+
case 'translatex':
|
390
|
+
var x = item.d[0].px || 0;
|
391
|
+
return [1, 0, 0, 0,
|
392
|
+
0, 1, 0, 0,
|
393
|
+
0, 0, 1, 0,
|
394
|
+
x, 0, 0, 1];
|
395
|
+
case 'translatey':
|
396
|
+
var y = item.d[0].px || 0;
|
397
|
+
return [1, 0, 0, 0,
|
398
|
+
0, 1, 0, 0,
|
399
|
+
0, 0, 1, 0,
|
400
|
+
0, y, 0, 1];
|
401
|
+
case 'translatez':
|
402
|
+
var z = item.d[0].px || 0;
|
403
|
+
return [1, 0, 0, 0,
|
404
|
+
0, 1, 0, 0,
|
405
|
+
0, 0, 1, 0,
|
406
|
+
0, 0, z, 1];
|
407
|
+
case 'translate3d':
|
408
|
+
var x = item.d[0].px || 0;
|
409
|
+
var y = item.d[1].px || 0;
|
410
|
+
var z = item.d[2].px || 0;
|
411
|
+
return [1, 0, 0, 0,
|
412
|
+
0, 1, 0, 0,
|
413
|
+
0, 0, 1, 0,
|
414
|
+
x, y, z, 1];
|
415
|
+
case 'perspective':
|
416
|
+
var p = item.d[0].px ? (-1 / item.d[0].px) : 0;
|
417
|
+
return [
|
418
|
+
1, 0, 0, 0,
|
419
|
+
0, 1, 0, 0,
|
420
|
+
0, 0, 1, p,
|
421
|
+
0, 0, 0, 1];
|
422
|
+
case 'matrix':
|
423
|
+
return [item.d[0], item.d[1], 0, 0,
|
424
|
+
item.d[2], item.d[3], 0, 0,
|
425
|
+
0, 0, 1, 0,
|
426
|
+
item.d[4], item.d[5], 0, 1];
|
427
|
+
case 'matrix3d':
|
428
|
+
return item.d;
|
429
|
+
default:
|
430
|
+
WEB_ANIMATIONS_TESTING && console.assert(false, 'Transform item type ' + item.t +
|
431
|
+
' conversion to matrix not yet implemented.');
|
432
|
+
}
|
433
|
+
}
|
434
|
+
|
435
|
+
function convertToMatrix(transformList) {
|
436
|
+
if (transformList.length === 0) {
|
437
|
+
return [1, 0, 0, 0,
|
438
|
+
0, 1, 0, 0,
|
439
|
+
0, 0, 1, 0,
|
440
|
+
0, 0, 0, 1];
|
441
|
+
}
|
442
|
+
return transformList.map(convertItemToMatrix).reduce(multiplyMatrices);
|
443
|
+
}
|
444
|
+
|
445
|
+
function makeMatrixDecomposition(transformList) {
|
446
|
+
return [decomposeMatrix(convertToMatrix(transformList))];
|
447
|
+
}
|
448
|
+
|
449
|
+
scope.dot = dot;
|
450
|
+
scope.makeMatrixDecomposition = makeMatrixDecomposition;
|
451
|
+
|
452
|
+
})(webAnimationsMinifill, webAnimationsTesting);
|
@@ -0,0 +1,130 @@
|
|
1
|
+
// Copyright 2014 Google Inc. All rights reserved.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
(function(scope, testing) {
|
16
|
+
var composeMatrix = (function() {
|
17
|
+
function multiply(a, b) {
|
18
|
+
var result = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]];
|
19
|
+
for (var i = 0; i < 4; i++) {
|
20
|
+
for (var j = 0; j < 4; j++) {
|
21
|
+
for (var k = 0; k < 4; k++) {
|
22
|
+
result[i][j] += b[i][k] * a[k][j];
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
return result;
|
27
|
+
}
|
28
|
+
|
29
|
+
function is2D(m) {
|
30
|
+
return (
|
31
|
+
m[0][2] == 0 &&
|
32
|
+
m[0][3] == 0 &&
|
33
|
+
m[1][2] == 0 &&
|
34
|
+
m[1][3] == 0 &&
|
35
|
+
m[2][0] == 0 &&
|
36
|
+
m[2][1] == 0 &&
|
37
|
+
m[2][2] == 1 &&
|
38
|
+
m[2][3] == 0 &&
|
39
|
+
m[3][2] == 0 &&
|
40
|
+
m[3][3] == 1);
|
41
|
+
}
|
42
|
+
|
43
|
+
function composeMatrix(translate, scale, skew, quat, perspective) {
|
44
|
+
var matrix = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
|
45
|
+
|
46
|
+
for (var i = 0; i < 4; i++) {
|
47
|
+
matrix[i][3] = perspective[i];
|
48
|
+
}
|
49
|
+
|
50
|
+
for (var i = 0; i < 3; i++) {
|
51
|
+
for (var j = 0; j < 3; j++) {
|
52
|
+
matrix[3][i] += translate[j] * matrix[j][i];
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
var x = quat[0], y = quat[1], z = quat[2], w = quat[3];
|
57
|
+
|
58
|
+
var rotMatrix = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
|
59
|
+
|
60
|
+
rotMatrix[0][0] = 1 - 2 * (y * y + z * z);
|
61
|
+
rotMatrix[0][1] = 2 * (x * y - z * w);
|
62
|
+
rotMatrix[0][2] = 2 * (x * z + y * w);
|
63
|
+
rotMatrix[1][0] = 2 * (x * y + z * w);
|
64
|
+
rotMatrix[1][1] = 1 - 2 * (x * x + z * z);
|
65
|
+
rotMatrix[1][2] = 2 * (y * z - x * w);
|
66
|
+
rotMatrix[2][0] = 2 * (x * z - y * w);
|
67
|
+
rotMatrix[2][1] = 2 * (y * z + x * w);
|
68
|
+
rotMatrix[2][2] = 1 - 2 * (x * x + y * y);
|
69
|
+
|
70
|
+
matrix = multiply(matrix, rotMatrix);
|
71
|
+
|
72
|
+
var temp = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
|
73
|
+
if (skew[2]) {
|
74
|
+
temp[2][1] = skew[2];
|
75
|
+
matrix = multiply(matrix, temp);
|
76
|
+
}
|
77
|
+
|
78
|
+
if (skew[1]) {
|
79
|
+
temp[2][1] = 0;
|
80
|
+
temp[2][0] = skew[0];
|
81
|
+
matrix = multiply(matrix, temp);
|
82
|
+
}
|
83
|
+
|
84
|
+
if (skew[0]) {
|
85
|
+
temp[2][0] = 0;
|
86
|
+
temp[1][0] = skew[0];
|
87
|
+
matrix = multiply(matrix, temp);
|
88
|
+
}
|
89
|
+
|
90
|
+
for (var i = 0; i < 3; i++) {
|
91
|
+
for (var j = 0; j < 3; j++) {
|
92
|
+
matrix[i][j] *= scale[i];
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
if (is2D(matrix)) {
|
97
|
+
return [matrix[0][0], matrix[0][1], matrix[1][0], matrix[1][1], matrix[3][0], matrix[3][1]];
|
98
|
+
}
|
99
|
+
return matrix[0].concat(matrix[1], matrix[2], matrix[3]);
|
100
|
+
}
|
101
|
+
return composeMatrix;
|
102
|
+
})();
|
103
|
+
|
104
|
+
function clamp(x, min, max) {
|
105
|
+
return Math.max(Math.min(x, max), min);
|
106
|
+
};
|
107
|
+
|
108
|
+
function quat(fromQ, toQ, f) {
|
109
|
+
var product = scope.dot(fromQ, toQ);
|
110
|
+
product = clamp(product, -1.0, 1.0);
|
111
|
+
|
112
|
+
var quat = [];
|
113
|
+
if (product === 1.0) {
|
114
|
+
quat = fromQ;
|
115
|
+
} else {
|
116
|
+
var theta = Math.acos(product);
|
117
|
+
var w = Math.sin(f * theta) * 1 / Math.sqrt(1 - product * product);
|
118
|
+
|
119
|
+
for (var i = 0; i < 4; i++) {
|
120
|
+
quat.push(fromQ[i] * (Math.cos(f * theta) - product * w) +
|
121
|
+
toQ[i] * w);
|
122
|
+
}
|
123
|
+
}
|
124
|
+
return quat;
|
125
|
+
}
|
126
|
+
|
127
|
+
scope.composeMatrix = composeMatrix;
|
128
|
+
scope.quat = quat;
|
129
|
+
|
130
|
+
})(webAnimationsMinifill, webAnimationsTesting);
|