@mxtommy/kip 1.2.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +180 -135
- package/CONTRIBUTORS.md +16 -16
- package/KipGaugeSample3-1024x508.png +0 -0
- package/LICENSE +21 -0
- package/README.md +140 -102
- package/package.json +93 -84
- package/public/3rdpartylicenses.txt +68 -139
- package/public/assets/NoSleep.min.js +2 -2
- package/public/assets/fontawesome6/css/all.min.css +6 -0
- package/public/assets/fontawesome6/webfonts/fa-brands-400.ttf +0 -0
- package/public/assets/fontawesome6/webfonts/fa-brands-400.woff2 +0 -0
- package/public/assets/fontawesome6/webfonts/fa-regular-400.ttf +0 -0
- package/public/assets/fontawesome6/webfonts/fa-regular-400.woff2 +0 -0
- package/public/assets/fontawesome6/webfonts/fa-solid-900.ttf +0 -0
- package/public/assets/fontawesome6/webfonts/fa-solid-900.woff2 +0 -0
- package/public/assets/fontawesome6/webfonts/fa-v4compatibility.ttf +0 -0
- package/public/assets/fontawesome6/webfonts/fa-v4compatibility.woff2 +0 -0
- package/public/assets/icon-192x192.png +0 -0
- package/public/assets/icon-256x256.png +0 -0
- package/public/assets/icon-384x384.png +0 -0
- package/public/assets/icon-512x512.png +0 -0
- package/public/assets/icon-64x64.png +0 -0
- package/public/assets/steelseries-min.js +25 -25
- package/public/assets/steelseries-min.js.map +8 -8
- package/public/assets/steelseries.js +15834 -15834
- package/public/assets/svg-autopilot-inkscape-plain.svg +983 -983
- package/public/assets/svg-wind-inkscape.svg +1358 -1358
- package/public/assets/tween.js +381 -381
- package/public/index.html +19 -20
- package/public/main.9dba30de44eed02b.js +1 -0
- package/public/manifest.json +38 -0
- package/public/polyfills.d1da7d2e907c253a.js +1 -0
- package/public/runtime.e75056c32c37f59d.js +1 -0
- package/public/styles.6b1c2c92be18a2cc.css +1 -0
- package/.angulardoc.json +0 -4
- package/angular.json +0 -153
- package/e2e/app.e2e-spec.ts +0 -14
- package/e2e/app.po.ts +0 -11
- package/e2e/tsconfig.e2e.json +0 -14
- package/karma.conf.js +0 -31
- package/public/assets/font-awesome/HELP-US-OUT.txt +0 -7
- package/public/assets/font-awesome/css/font-awesome.css +0 -2337
- package/public/assets/font-awesome/css/font-awesome.min.css +0 -4
- package/public/assets/font-awesome/desktop.ini +0 -4
- package/public/assets/font-awesome/fonts/FontAwesome.otf +0 -0
- package/public/assets/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/public/assets/font-awesome/fonts/fontawesome-webfont.svg +0 -2671
- package/public/assets/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/public/assets/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/public/assets/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/public/assets/font-awesome/less/animated.less +0 -34
- package/public/assets/font-awesome/less/bordered-pulled.less +0 -25
- package/public/assets/font-awesome/less/core.less +0 -12
- package/public/assets/font-awesome/less/fixed-width.less +0 -6
- package/public/assets/font-awesome/less/font-awesome.less +0 -18
- package/public/assets/font-awesome/less/icons.less +0 -789
- package/public/assets/font-awesome/less/larger.less +0 -13
- package/public/assets/font-awesome/less/list.less +0 -19
- package/public/assets/font-awesome/less/mixins.less +0 -60
- package/public/assets/font-awesome/less/path.less +0 -15
- package/public/assets/font-awesome/less/rotated-flipped.less +0 -20
- package/public/assets/font-awesome/less/screen-reader.less +0 -5
- package/public/assets/font-awesome/less/stacked.less +0 -20
- package/public/assets/font-awesome/less/variables.less +0 -800
- package/public/assets/font-awesome/scss/_animated.scss +0 -34
- package/public/assets/font-awesome/scss/_bordered-pulled.scss +0 -25
- package/public/assets/font-awesome/scss/_core.scss +0 -12
- package/public/assets/font-awesome/scss/_fixed-width.scss +0 -6
- package/public/assets/font-awesome/scss/_icons.scss +0 -789
- package/public/assets/font-awesome/scss/_larger.scss +0 -13
- package/public/assets/font-awesome/scss/_list.scss +0 -19
- package/public/assets/font-awesome/scss/_mixins.scss +0 -60
- package/public/assets/font-awesome/scss/_path.scss +0 -15
- package/public/assets/font-awesome/scss/_rotated-flipped.scss +0 -20
- package/public/assets/font-awesome/scss/_screen-reader.scss +0 -5
- package/public/assets/font-awesome/scss/_stacked.scss +0 -20
- package/public/assets/font-awesome/scss/_variables.scss +0 -800
- package/public/assets/font-awesome/scss/font-awesome.scss +0 -18
- package/public/main-es2018.ab0adc5af3ab3e70c849.js +0 -1
- package/public/main-es5.ab0adc5af3ab3e70c849.js +0 -1
- package/public/polyfills-es2018.713f95af1f028e444854.js +0 -1
- package/public/polyfills-es5.c78877945523541d2597.js +0 -1
- package/public/runtime-es2018.a4dadbc03350107420a4.js +0 -1
- package/public/runtime-es5.a4dadbc03350107420a4.js +0 -1
- package/public/styles.71bb0d04cad96b5efbe1.css +0 -19
- package/src/app/alarm-menu/alarm-menu.component.html +0 -55
- package/src/app/alarm-menu/alarm-menu.component.scss +0 -53
- package/src/app/alarm-menu/alarm-menu.component.spec.ts +0 -25
- package/src/app/alarm-menu/alarm-menu.component.ts +0 -186
- package/src/app/app-help/app-help.component.css +0 -4
- package/src/app/app-help/app-help.component.html +0 -135
- package/src/app/app-help/app-help.component.ts +0 -45
- package/src/app/app-settings.service.spec.ts +0 -15
- package/src/app/app-settings.service.ts +0 -478
- package/src/app/app.component.css +0 -39
- package/src/app/app.component.html +0 -93
- package/src/app/app.component.scss +0 -79
- package/src/app/app.component.spec.ts +0 -32
- package/src/app/app.component.ts +0 -192
- package/src/app/app.module.ts +0 -200
- package/src/app/config.blank.const.ts +0 -52
- package/src/app/config.blank.notification.const.ts +0 -19
- package/src/app/config.blank.units.const.ts +0 -23
- package/src/app/config.demo.const.ts +0 -384
- package/src/app/data-browser/data-browser.component.css +0 -29
- package/src/app/data-browser/data-browser.component.html +0 -44
- package/src/app/data-browser/data-browser.component.spec.ts +0 -25
- package/src/app/data-browser/data-browser.component.ts +0 -91
- package/src/app/data-browser-row/data-browser-row-unit-modal.html +0 -17
- package/src/app/data-browser-row/data-browser-row.component.css +0 -10
- package/src/app/data-browser-row/data-browser-row.component.html +0 -5
- package/src/app/data-browser-row/data-browser-row.component.ts +0 -79
- package/src/app/data-set.service.spec.ts +0 -15
- package/src/app/data-set.service.ts +0 -273
- package/src/app/dynamic-widget.directive.spec.ts +0 -8
- package/src/app/dynamic-widget.directive.ts +0 -11
- package/src/app/filter-self.pipe.spec.ts +0 -8
- package/src/app/filter-self.pipe.ts +0 -14
- package/src/app/fit-text.directive.spec.ts +0 -8
- package/src/app/fit-text.directive.ts +0 -61
- package/src/app/gauge-steel/gauge-steel.component.css +0 -5
- package/src/app/gauge-steel/gauge-steel.component.html +0 -4
- package/src/app/gauge-steel/gauge-steel.component.spec.ts +0 -25
- package/src/app/gauge-steel/gauge-steel.component.ts +0 -282
- package/src/app/gauges-module/base-gauge.ts +0 -301
- package/src/app/gauges-module/gauges.module.ts +0 -17
- package/src/app/gauges-module/linear-gauge.ts +0 -50
- package/src/app/gauges-module/radial-gauge.ts +0 -48
- package/src/app/layout-split/layout-split.component.html +0 -30
- package/src/app/layout-split/layout-split.component.scss +0 -33
- package/src/app/layout-split/layout-split.component.spec.ts +0 -25
- package/src/app/layout-split/layout-split.component.ts +0 -59
- package/src/app/layout-splits.service.spec.ts +0 -15
- package/src/app/layout-splits.service.ts +0 -284
- package/src/app/modal-path-selector/modal-path-selector.component.html +0 -62
- package/src/app/modal-path-selector/modal-path-selector.component.scss +0 -39
- package/src/app/modal-path-selector/modal-path-selector.component.spec.ts +0 -25
- package/src/app/modal-path-selector/modal-path-selector.component.ts +0 -132
- package/src/app/modal-widget/modal-widget.component.css +0 -33
- package/src/app/modal-widget/modal-widget.component.html +0 -341
- package/src/app/modal-widget/modal-widget.component.spec.ts +0 -25
- package/src/app/modal-widget/modal-widget.component.ts +0 -84
- package/src/app/notifications.service.spec.ts +0 -12
- package/src/app/notifications.service.ts +0 -392
- package/src/app/object-keys.pipe.spec.ts +0 -8
- package/src/app/object-keys.pipe.ts +0 -13
- package/src/app/reset-config/reset-config.component.css +0 -0
- package/src/app/reset-config/reset-config.component.html +0 -3
- package/src/app/reset-config/reset-config.component.spec.ts +0 -25
- package/src/app/reset-config/reset-config.component.ts +0 -31
- package/src/app/root-display/root-display.component.css +0 -0
- package/src/app/root-display/root-display.component.html +0 -4
- package/src/app/root-display/root-display.component.spec.ts +0 -25
- package/src/app/root-display/root-display.component.ts +0 -57
- package/src/app/safe.pipe.ts +0 -16
- package/src/app/settings/settings.component.css +0 -9
- package/src/app/settings/settings.component.html +0 -25
- package/src/app/settings/settings.component.spec.ts +0 -25
- package/src/app/settings/settings.component.ts +0 -22
- package/src/app/settings-config/settings-config.component.css +0 -39
- package/src/app/settings-config/settings-config.component.html +0 -118
- package/src/app/settings-config/settings-config.component.spec.ts +0 -25
- package/src/app/settings-config/settings-config.component.ts +0 -161
- package/src/app/settings-datasets/settings-datasets.component.html +0 -43
- package/src/app/settings-datasets/settings-datasets.component.scss +0 -39
- package/src/app/settings-datasets/settings-datasets.component.spec.ts +0 -25
- package/src/app/settings-datasets/settings-datasets.component.ts +0 -98
- package/src/app/settings-datasets/settings-datasets.modal.html +0 -54
- package/src/app/settings-notifications/settings-notifications.component.css +0 -0
- package/src/app/settings-notifications/settings-notifications.component.html +0 -65
- package/src/app/settings-notifications/settings-notifications.component.spec.ts +0 -25
- package/src/app/settings-notifications/settings-notifications.component.ts +0 -29
- package/src/app/settings-signalk/settings-signalk.component.css +0 -3
- package/src/app/settings-signalk/settings-signalk.component.html +0 -89
- package/src/app/settings-signalk/settings-signalk.component.spec.ts +0 -25
- package/src/app/settings-signalk/settings-signalk.component.ts +0 -174
- package/src/app/settings-units/settings-units.component.css +0 -4
- package/src/app/settings-units/settings-units.component.html +0 -19
- package/src/app/settings-units/settings-units.component.spec.ts +0 -25
- package/src/app/settings-units/settings-units.component.ts +0 -62
- package/src/app/settings-zones/settings-zones.component.css +0 -22
- package/src/app/settings-zones/settings-zones.component.html +0 -70
- package/src/app/settings-zones/settings-zones.component.ts +0 -154
- package/src/app/settings-zones/settings-zones.modal.css +0 -14
- package/src/app/settings-zones/settings-zones.modal.html +0 -39
- package/src/app/signalk-connection.service.ts +0 -344
- package/src/app/signalk-delta.service.spec.ts +0 -15
- package/src/app/signalk-delta.service.ts +0 -97
- package/src/app/signalk-full.service.spec.ts +0 -15
- package/src/app/signalk-full.service.ts +0 -99
- package/src/app/signalk-interfaces.ts +0 -129
- package/src/app/signalk-requests.service.spec.ts +0 -12
- package/src/app/signalk-requests.service.ts +0 -180
- package/src/app/signalk.service.spec.ts +0 -15
- package/src/app/signalk.service.ts +0 -428
- package/src/app/svg-autopilot/svg-autopilot.component.html +0 -1036
- package/src/app/svg-autopilot/svg-autopilot.component.spec.ts +0 -25
- package/src/app/svg-autopilot/svg-autopilot.component.ts +0 -174
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.html +0 -119
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.scss +0 -0
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.spec.ts +0 -25
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.ts +0 -49
- package/src/app/svg-wind/svg-wind.component.css +0 -0
- package/src/app/svg-wind/svg-wind.component.html +0 -969
- package/src/app/svg-wind/svg-wind.component.scss +0 -76
- package/src/app/svg-wind/svg-wind.component.spec.ts +0 -25
- package/src/app/svg-wind/svg-wind.component.ts +0 -280
- package/src/app/unit-window/unit-window.component.css +0 -37
- package/src/app/unit-window/unit-window.component.html +0 -8
- package/src/app/unit-window/unit-window.component.spec.ts +0 -25
- package/src/app/unit-window/unit-window.component.ts +0 -134
- package/src/app/unit-window/unit-window.modal.html +0 -25
- package/src/app/units.service.ts +0 -300
- package/src/app/widget-autopilot/widget-autopilot.component.html +0 -85
- package/src/app/widget-autopilot/widget-autopilot.component.scss +0 -191
- package/src/app/widget-autopilot/widget-autopilot.component.spec.ts +0 -25
- package/src/app/widget-autopilot/widget-autopilot.component.ts +0 -781
- package/src/app/widget-blank/widget-blank.component.html +0 -5
- package/src/app/widget-blank/widget-blank.component.scss +0 -22
- package/src/app/widget-blank/widget-blank.component.spec.ts +0 -25
- package/src/app/widget-blank/widget-blank.component.ts +0 -17
- package/src/app/widget-gauge/widget-gauge.component.css +0 -26
- package/src/app/widget-gauge/widget-gauge.component.html +0 -29
- package/src/app/widget-gauge/widget-gauge.component.spec.ts +0 -25
- package/src/app/widget-gauge/widget-gauge.component.ts +0 -120
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.html +0 -126
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.scss +0 -93
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.spec.ts +0 -25
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.ts +0 -424
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.html +0 -122
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.scss +0 -69
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.spec.ts +0 -25
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.ts +0 -553
- package/src/app/widget-historical/widget-historical.component.css +0 -31
- package/src/app/widget-historical/widget-historical.component.html +0 -14
- package/src/app/widget-historical/widget-historical.component.scss +0 -0
- package/src/app/widget-historical/widget-historical.component.spec.ts +0 -25
- package/src/app/widget-historical/widget-historical.component.ts +0 -306
- package/src/app/widget-iframe/widget-iframe.component.css +0 -12
- package/src/app/widget-iframe/widget-iframe.component.html +0 -21
- package/src/app/widget-iframe/widget-iframe.component.spec.ts +0 -25
- package/src/app/widget-iframe/widget-iframe.component.ts +0 -63
- package/src/app/widget-list.service.spec.ts +0 -15
- package/src/app/widget-list.service.ts +0 -135
- package/src/app/widget-manager.service.spec.ts +0 -15
- package/src/app/widget-manager.service.ts +0 -141
- package/src/app/widget-numeric/widget-numeric.component.html +0 -13
- package/src/app/widget-numeric/widget-numeric.component.scss +0 -52
- package/src/app/widget-numeric/widget-numeric.component.spec.ts +0 -25
- package/src/app/widget-numeric/widget-numeric.component.ts +0 -457
- package/src/app/widget-simple-linear/widget-simple-linear.component.html +0 -28
- package/src/app/widget-simple-linear/widget-simple-linear.component.scss +0 -64
- package/src/app/widget-simple-linear/widget-simple-linear.component.spec.ts +0 -25
- package/src/app/widget-simple-linear/widget-simple-linear.component.ts +0 -199
- package/src/app/widget-state/widget-state.component.html +0 -27
- package/src/app/widget-state/widget-state.component.scss +0 -68
- package/src/app/widget-state/widget-state.component.spec.ts +0 -25
- package/src/app/widget-state/widget-state.component.ts +0 -178
- package/src/app/widget-switch/widget-switch.component.css +0 -70
- package/src/app/widget-switch/widget-switch.component.html +0 -17
- package/src/app/widget-switch/widget-switch.component.spec.ts +0 -25
- package/src/app/widget-switch/widget-switch.component.ts +0 -134
- package/src/app/widget-text-generic/widget-text-generic.component.css +0 -55
- package/src/app/widget-text-generic/widget-text-generic.component.html +0 -9
- package/src/app/widget-text-generic/widget-text-generic.component.spec.ts +0 -25
- package/src/app/widget-text-generic/widget-text-generic.component.ts +0 -253
- package/src/app/widget-tutorial/widget-tutorial.component.css +0 -0
- package/src/app/widget-tutorial/widget-tutorial.component.html +0 -34
- package/src/app/widget-tutorial/widget-tutorial.component.spec.ts +0 -25
- package/src/app/widget-tutorial/widget-tutorial.component.ts +0 -18
- package/src/app/widget-unknown/widget-unknown.component.css +0 -0
- package/src/app/widget-unknown/widget-unknown.component.html +0 -3
- package/src/app/widget-unknown/widget-unknown.component.spec.ts +0 -25
- package/src/app/widget-unknown/widget-unknown.component.ts +0 -15
- package/src/app/widget-wind/widget-wind.component.css +0 -24
- package/src/app/widget-wind/widget-wind.component.html +0 -20
- package/src/app/widget-wind/widget-wind.component.spec.ts +0 -25
- package/src/app/widget-wind/widget-wind.component.ts +0 -369
- package/src/assets/.gitkeep +0 -0
- package/src/assets/NoSleep.min.js +0 -2
- package/src/assets/alarm.mp3 +0 -0
- package/src/assets/alert.mp3 +0 -0
- package/src/assets/alertl.old.mp3 +0 -0
- package/src/assets/emergency.mp3 +0 -0
- package/src/assets/font-awesome/HELP-US-OUT.txt +0 -7
- package/src/assets/font-awesome/css/font-awesome.css +0 -2337
- package/src/assets/font-awesome/css/font-awesome.min.css +0 -4
- package/src/assets/font-awesome/desktop.ini +0 -4
- package/src/assets/font-awesome/fonts/FontAwesome.otf +0 -0
- package/src/assets/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/src/assets/font-awesome/fonts/fontawesome-webfont.svg +0 -2671
- package/src/assets/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/src/assets/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/src/assets/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/src/assets/font-awesome/less/animated.less +0 -34
- package/src/assets/font-awesome/less/bordered-pulled.less +0 -25
- package/src/assets/font-awesome/less/core.less +0 -12
- package/src/assets/font-awesome/less/fixed-width.less +0 -6
- package/src/assets/font-awesome/less/font-awesome.less +0 -18
- package/src/assets/font-awesome/less/icons.less +0 -789
- package/src/assets/font-awesome/less/larger.less +0 -13
- package/src/assets/font-awesome/less/list.less +0 -19
- package/src/assets/font-awesome/less/mixins.less +0 -60
- package/src/assets/font-awesome/less/path.less +0 -15
- package/src/assets/font-awesome/less/rotated-flipped.less +0 -20
- package/src/assets/font-awesome/less/screen-reader.less +0 -5
- package/src/assets/font-awesome/less/stacked.less +0 -20
- package/src/assets/font-awesome/less/variables.less +0 -800
- package/src/assets/font-awesome/scss/_animated.scss +0 -34
- package/src/assets/font-awesome/scss/_bordered-pulled.scss +0 -25
- package/src/assets/font-awesome/scss/_core.scss +0 -12
- package/src/assets/font-awesome/scss/_fixed-width.scss +0 -6
- package/src/assets/font-awesome/scss/_icons.scss +0 -789
- package/src/assets/font-awesome/scss/_larger.scss +0 -13
- package/src/assets/font-awesome/scss/_list.scss +0 -19
- package/src/assets/font-awesome/scss/_mixins.scss +0 -60
- package/src/assets/font-awesome/scss/_path.scss +0 -15
- package/src/assets/font-awesome/scss/_rotated-flipped.scss +0 -20
- package/src/assets/font-awesome/scss/_screen-reader.scss +0 -5
- package/src/assets/font-awesome/scss/_stacked.scss +0 -20
- package/src/assets/font-awesome/scss/_variables.scss +0 -800
- package/src/assets/font-awesome/scss/font-awesome.scss +0 -18
- package/src/assets/notification.mp3 +0 -0
- package/src/assets/steelseries-min.js +0 -25
- package/src/assets/steelseries-min.js.map +0 -8
- package/src/assets/steelseries.js +0 -15834
- package/src/assets/svg-autopilot-inkscape-plain.svg +0 -983
- package/src/assets/svg-wind-inkscape.svg +0 -1358
- package/src/assets/tween-min.js +0 -1
- package/src/assets/tween.js +0 -381
- package/src/assets/warn.mp3 +0 -0
- package/src/environments/environment.prod.ts +0 -3
- package/src/environments/environment.ts +0 -8
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -20
- package/src/main.ts +0 -11
- package/src/polyfills.ts +0 -76
- package/src/styles.css +0 -47
- package/src/styles.scss +0 -157
- package/src/test.ts +0 -32
- package/src/themes/darkBlueTheme.scss +0 -116
- package/src/themes/defaultTheme.scss +0 -49
- package/src/themes/highContrastTheme.scss +0 -46
- package/src/themes/modernTheme.scss +0 -142
- package/src/themes/nightMode.scss +0 -184
- package/src/themes/platypusTheme.scss +0 -79
- package/src/themes/signalkTheme.scss +0 -111
- package/src/tsconfig.app.json +0 -15
- package/src/tsconfig.spec.json +0 -20
- package/src/typings.d.ts +0 -5
- package/tsconfig.json +0 -24
- package/tslint.json +0 -143
- /package/{KipGaugeSample-1-1024x545.png → KipGaugeSample1-1024x545.png} +0 -0
- /package/{KipMonitor-1024x488.png → KipGaugeSample2-1024x488.png} +0 -0
package/public/assets/tween.js
CHANGED
|
@@ -1,381 +1,381 @@
|
|
|
1
|
-
/**********************************************************************
|
|
2
|
-
TERMS OF USE - EASING EQUATIONS
|
|
3
|
-
Open source under the BSD License.
|
|
4
|
-
Copyright (c) 2001 Robert Penner
|
|
5
|
-
JavaScript version copyright (C) 2006 by Philippe Maegerman
|
|
6
|
-
All rights reserved.
|
|
7
|
-
|
|
8
|
-
Redistribution and use in source and binary forms, with or without
|
|
9
|
-
modification, are permitted provided that the following conditions are
|
|
10
|
-
met:
|
|
11
|
-
|
|
12
|
-
* Redistributions of source code must retain the above copyright
|
|
13
|
-
notice, this list of conditions and the following disclaimer.
|
|
14
|
-
* Redistributions in binary form must reproduce the above
|
|
15
|
-
copyright notice, this list of conditions and the following disclaimer
|
|
16
|
-
in the documentation and/or other materials provided with the
|
|
17
|
-
distribution.
|
|
18
|
-
* Neither the name of the author nor the names of contributors may
|
|
19
|
-
be used to endorse or promote products derived from this software
|
|
20
|
-
without specific prior written permission.
|
|
21
|
-
|
|
22
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
23
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
25
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
26
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
27
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
28
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
29
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
30
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
|
-
|
|
34
|
-
*****************************************/
|
|
35
|
-
function Delegate() {}
|
|
36
|
-
Delegate.create = function (o, f) {
|
|
37
|
-
var a = [], i, l = arguments.length;
|
|
38
|
-
for (i = 2; i < l; i++) {
|
|
39
|
-
a[i - 2] = arguments[i];
|
|
40
|
-
}
|
|
41
|
-
return function () {
|
|
42
|
-
var aP = [].concat(arguments, a);
|
|
43
|
-
f.apply(o, aP);
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/*
|
|
48
|
-
object:
|
|
49
|
-
type:Object
|
|
50
|
-
The object you want to modify. It can be any object, a visual object that you want to animate ( document.body.style ) or an anymous object ( new Object() ).
|
|
51
|
-
property:
|
|
52
|
-
type:String
|
|
53
|
-
The property that is updated on the target object, it can be empty ('')
|
|
54
|
-
easing:
|
|
55
|
-
type:Function
|
|
56
|
-
The easing that will be applied to motion.
|
|
57
|
-
start:
|
|
58
|
-
type:Number
|
|
59
|
-
Start value
|
|
60
|
-
end:
|
|
61
|
-
type:Number
|
|
62
|
-
End value
|
|
63
|
-
duration:
|
|
64
|
-
type:Number
|
|
65
|
-
Animation duration in seconds
|
|
66
|
-
suffixe:
|
|
67
|
-
type:String
|
|
68
|
-
A string to append to the updated property ('%','pt','em' ...).
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
var Tween = function (obj, prop, func, begin, finish, duration, suffixe) {
|
|
72
|
-
this.init(obj, prop, func, begin, finish, duration, suffixe);
|
|
73
|
-
};
|
|
74
|
-
var t = Tween.prototype;
|
|
75
|
-
|
|
76
|
-
t.obj = {};
|
|
77
|
-
t.prop = '';
|
|
78
|
-
t.func = function (t, b, c, d) { return c * t / d + b; };
|
|
79
|
-
t.begin = 0;
|
|
80
|
-
t.change = 0;
|
|
81
|
-
t.prevTime = 0;
|
|
82
|
-
t.prevPos = 0;
|
|
83
|
-
t.looping = false;
|
|
84
|
-
t._duration = 0;
|
|
85
|
-
t._time = 0;
|
|
86
|
-
t._pos = 0;
|
|
87
|
-
t._position = 0;
|
|
88
|
-
t._startTime = 0;
|
|
89
|
-
t._finish = 0;
|
|
90
|
-
t.name = '';
|
|
91
|
-
t.suffixe = '';
|
|
92
|
-
t._listeners = [];
|
|
93
|
-
t.setTime = function (t) {
|
|
94
|
-
this.prevTime = this._time;
|
|
95
|
-
if (t > this.getDuration()) {
|
|
96
|
-
if (this.looping) {
|
|
97
|
-
this.rewind(t - this._duration);
|
|
98
|
-
this.update();
|
|
99
|
-
this.broadcastMessage('onMotionLooped', {target: this, type: 'onMotionLooped'});
|
|
100
|
-
} else {
|
|
101
|
-
this._time = this._duration;
|
|
102
|
-
this.update();
|
|
103
|
-
this.stop();
|
|
104
|
-
this.broadcastMessage('onMotionFinished', {target: this, type: 'onMotionFinished'});
|
|
105
|
-
}
|
|
106
|
-
} else if (t < 0) {
|
|
107
|
-
this.rewind();
|
|
108
|
-
this.update();
|
|
109
|
-
} else {
|
|
110
|
-
this._time = t;
|
|
111
|
-
this.update();
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
t.getTime = function () {
|
|
115
|
-
return this._time;
|
|
116
|
-
};
|
|
117
|
-
t.setDuration = function (d) {
|
|
118
|
-
this._duration = (d === null || d <= 0) ? 100000 : d;
|
|
119
|
-
};
|
|
120
|
-
t.getDuration = function () {
|
|
121
|
-
return this._duration;
|
|
122
|
-
};
|
|
123
|
-
t.setPosition = function (p) {
|
|
124
|
-
this.prevPos = this._pos;
|
|
125
|
-
var a = this.suffixe !== '' ? this.suffixe : '';
|
|
126
|
-
this.obj[this.prop] = Math.round(p) + a;
|
|
127
|
-
this._pos = p;
|
|
128
|
-
this.broadcastMessage('onMotionChanged', {target: this, type: 'onMotionChanged'});
|
|
129
|
-
};
|
|
130
|
-
t.getPosition = function (t) {
|
|
131
|
-
if (t === undefined) {
|
|
132
|
-
t = this._time;
|
|
133
|
-
}
|
|
134
|
-
return this.func(t, this.begin, this.change, this._duration);
|
|
135
|
-
};
|
|
136
|
-
t.setFinish = function (f) {
|
|
137
|
-
this.change = f - this.begin;
|
|
138
|
-
};
|
|
139
|
-
t.getFinish = function () {
|
|
140
|
-
return this.begin + this.change;
|
|
141
|
-
};
|
|
142
|
-
t.init = function (obj, prop, func, begin, finish, duration, suffixe) {
|
|
143
|
-
if (!arguments.length) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
this._listeners = [];
|
|
147
|
-
this.addListener(this);
|
|
148
|
-
if (suffixe) {
|
|
149
|
-
this.suffixe = suffixe;
|
|
150
|
-
}
|
|
151
|
-
this.obj = obj;
|
|
152
|
-
this.prop = prop;
|
|
153
|
-
this.begin = begin;
|
|
154
|
-
this._pos = begin;
|
|
155
|
-
this.setDuration(duration);
|
|
156
|
-
if (func !== null && func !== '') {
|
|
157
|
-
this.func = func;
|
|
158
|
-
}
|
|
159
|
-
this.setFinish(finish);
|
|
160
|
-
};
|
|
161
|
-
t.start = function () {
|
|
162
|
-
this.rewind();
|
|
163
|
-
this.startEnterFrame();
|
|
164
|
-
this.broadcastMessage('onMotionStarted', {target: this, type: 'onMotionStarted'});
|
|
165
|
-
//alert('in');
|
|
166
|
-
};
|
|
167
|
-
t.rewind = function (t) {
|
|
168
|
-
this.stop();
|
|
169
|
-
this._time = (t === undefined) ? 0 : t;
|
|
170
|
-
this.fixTime();
|
|
171
|
-
this.update();
|
|
172
|
-
};
|
|
173
|
-
t.fforward = function () {
|
|
174
|
-
this._time = this._duration;
|
|
175
|
-
this.fixTime();
|
|
176
|
-
this.update();
|
|
177
|
-
};
|
|
178
|
-
t.update = function () {
|
|
179
|
-
this.setPosition(this.getPosition(this._time));
|
|
180
|
-
};
|
|
181
|
-
t.startEnterFrame = function () {
|
|
182
|
-
this.stopEnterFrame();
|
|
183
|
-
this.isPlaying = true;
|
|
184
|
-
this.onEnterFrame();
|
|
185
|
-
};
|
|
186
|
-
t.onEnterFrame = function () {
|
|
187
|
-
if (this.isPlaying) {
|
|
188
|
-
this.nextFrame();
|
|
189
|
-
// To get real smooth movement you have to set the timeout to 0 instead of 25
|
|
190
|
-
setTimeout(Delegate.create(this, this.onEnterFrame), 25);
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
t.nextFrame = function () {
|
|
194
|
-
this.setTime((this.getTimer() - this._startTime) / 1000);
|
|
195
|
-
};
|
|
196
|
-
t.stop = function () {
|
|
197
|
-
this.stopEnterFrame();
|
|
198
|
-
this.broadcastMessage('onMotionStopped', {target: this, type: 'onMotionStopped'});
|
|
199
|
-
};
|
|
200
|
-
t.stopEnterFrame = function () {
|
|
201
|
-
this.isPlaying = false;
|
|
202
|
-
};
|
|
203
|
-
t.playing = function () {
|
|
204
|
-
return this.isPlaying;
|
|
205
|
-
};
|
|
206
|
-
t.continueTo = function (finish, duration) {
|
|
207
|
-
this.begin = this._pos;
|
|
208
|
-
this.setFinish(finish);
|
|
209
|
-
if (this._duration !== undefined) {
|
|
210
|
-
this.setDuration(duration);
|
|
211
|
-
}
|
|
212
|
-
this.start();
|
|
213
|
-
};
|
|
214
|
-
t.resume = function () {
|
|
215
|
-
this.fixTime();
|
|
216
|
-
this.startEnterFrame();
|
|
217
|
-
this.broadcastMessage('onMotionResumed', {target: this, type: 'onMotionResumed'});
|
|
218
|
-
};
|
|
219
|
-
t.yoyo = function () {
|
|
220
|
-
this.continueTo(this.begin, this._time);
|
|
221
|
-
};
|
|
222
|
-
t.addListener = function (o) {
|
|
223
|
-
this.removeListener(o);
|
|
224
|
-
return this._listeners.push(o);
|
|
225
|
-
};
|
|
226
|
-
t.removeListener = function (o) {
|
|
227
|
-
var a = this._listeners,
|
|
228
|
-
i = a.length;
|
|
229
|
-
while (i--) {
|
|
230
|
-
if (a[i] === o) {
|
|
231
|
-
a.splice(i, 1);
|
|
232
|
-
return true;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
return false;
|
|
236
|
-
};
|
|
237
|
-
t.broadcastMessage = function () {
|
|
238
|
-
var arr = [], i, e, a = this._listeners,
|
|
239
|
-
l = a.length;
|
|
240
|
-
for (i = 0; i < arguments.length; i++) {
|
|
241
|
-
arr.push(arguments[i]);
|
|
242
|
-
}
|
|
243
|
-
e = arr.shift();
|
|
244
|
-
|
|
245
|
-
for (i = 0; i < l; i++) {
|
|
246
|
-
if (a[i][e]) {
|
|
247
|
-
a[i][e].apply(a[i], arr);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
t.fixTime = function () {
|
|
252
|
-
this._startTime = this.getTimer() - this._time * 1000;
|
|
253
|
-
};
|
|
254
|
-
t.getTimer = function () {
|
|
255
|
-
return new Date().getTime() - this._time;
|
|
256
|
-
};
|
|
257
|
-
Tween.backEaseIn = function (t, b, c, d, a, p) {
|
|
258
|
-
var s = 1.70158;
|
|
259
|
-
return c * (t /= d) * t * ((s + 1) * t - s) + b;
|
|
260
|
-
};
|
|
261
|
-
Tween.backEaseOut = function (t, b, c, d, a, p) {
|
|
262
|
-
var s = 1.70158;
|
|
263
|
-
return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
|
|
264
|
-
};
|
|
265
|
-
Tween.backEaseInOut = function (t, b, c, d, a, p) {
|
|
266
|
-
var s = 1.70158;
|
|
267
|
-
if ((t /= d / 2) < 1) {
|
|
268
|
-
return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
|
|
269
|
-
}
|
|
270
|
-
return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
|
|
271
|
-
};
|
|
272
|
-
Tween.elasticEaseIn = function (t, b, c, d, a, p) {
|
|
273
|
-
var s;
|
|
274
|
-
if (t === 0) {
|
|
275
|
-
return b;
|
|
276
|
-
}
|
|
277
|
-
if ((t /= d) === 1) {
|
|
278
|
-
return b + c;
|
|
279
|
-
}
|
|
280
|
-
if (!p) {
|
|
281
|
-
p = d * 0.3;
|
|
282
|
-
}
|
|
283
|
-
if (!a || a < Math.abs(c)) {
|
|
284
|
-
a = c;
|
|
285
|
-
s = p / 4;
|
|
286
|
-
} else {
|
|
287
|
-
s = p / (2 * Math.PI) * Math.asin(c / a);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
|
|
291
|
-
|
|
292
|
-
};
|
|
293
|
-
Tween.elasticEaseOut = function (t, b, c, d, a, p) {
|
|
294
|
-
var s;
|
|
295
|
-
if (t === 0) {
|
|
296
|
-
return b;
|
|
297
|
-
}
|
|
298
|
-
if ((t /= d) === 1) {
|
|
299
|
-
return b + c;
|
|
300
|
-
}
|
|
301
|
-
if (!p) {
|
|
302
|
-
p = d * 0.3;
|
|
303
|
-
}
|
|
304
|
-
if (!a || a < Math.abs(c)) {
|
|
305
|
-
a = c;
|
|
306
|
-
s = p / 4;
|
|
307
|
-
} else {
|
|
308
|
-
s = p / (2 * Math.PI) * Math.asin(c / a);
|
|
309
|
-
}
|
|
310
|
-
return (a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b);
|
|
311
|
-
};
|
|
312
|
-
Tween.elasticEaseInOut = function (t, b, c, d, a, p) {
|
|
313
|
-
var s;
|
|
314
|
-
if (t === 0) {
|
|
315
|
-
return b;
|
|
316
|
-
}
|
|
317
|
-
if ((t /= d / 2) === 2) {
|
|
318
|
-
return b + c;
|
|
319
|
-
}
|
|
320
|
-
if (!p) {
|
|
321
|
-
p = d * (0.3 * 1.5);
|
|
322
|
-
}
|
|
323
|
-
if (!a || a < Math.abs(c)) {
|
|
324
|
-
a = c;
|
|
325
|
-
s = p / 4;
|
|
326
|
-
} else {
|
|
327
|
-
s = p / (2 * Math.PI) * Math.asin(c / a);
|
|
328
|
-
}
|
|
329
|
-
if (t < 1) {
|
|
330
|
-
return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
|
|
331
|
-
}
|
|
332
|
-
return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * 0.5 + c + b;
|
|
333
|
-
};
|
|
334
|
-
Tween.bounceEaseOut = function (t, b, c, d) {
|
|
335
|
-
if ((t /= d) < (1 / 2.75)) {
|
|
336
|
-
return c * (7.5625 * t * t) + b;
|
|
337
|
-
} else if (t < (2 / 2.75)) {
|
|
338
|
-
return c * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75) + b;
|
|
339
|
-
} else if (t < (2.5 / 2.75)) {
|
|
340
|
-
return c * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375) + b;
|
|
341
|
-
} else {
|
|
342
|
-
return c * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375) + b;
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
Tween.bounceEaseIn = function (t, b, c, d) {
|
|
346
|
-
return c - Tween.bounceEaseOut(d - t, 0, c, d) + b;
|
|
347
|
-
};
|
|
348
|
-
Tween.bounceEaseInOut = function (t, b, c, d) {
|
|
349
|
-
if (t < d / 2) {
|
|
350
|
-
return Tween.bounceEaseIn(t * 2, 0, c, d) * 0.5 + b;
|
|
351
|
-
} else {
|
|
352
|
-
return Tween.bounceEaseOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
Tween.strongEaseInOut = function (t, b, c, d) {
|
|
356
|
-
return c * (t /= d) * t * t * t * t + b;
|
|
357
|
-
};
|
|
358
|
-
Tween.regularEaseIn = function (t, b, c, d) {
|
|
359
|
-
return c * (t /= d) * t + b;
|
|
360
|
-
};
|
|
361
|
-
Tween.regularEaseOut = function (t, b, c, d) {
|
|
362
|
-
return -c * (t /= d) * (t - 2) + b;
|
|
363
|
-
};
|
|
364
|
-
Tween.regularEaseInOut = function (t, b, c, d) {
|
|
365
|
-
if ((t /= d / 2) < 1) {
|
|
366
|
-
return c / 2 * t * t + b;
|
|
367
|
-
}
|
|
368
|
-
return -c / 2 * ((--t) * (t - 2) - 1) + b;
|
|
369
|
-
};
|
|
370
|
-
Tween.strongEaseIn = function (t, b, c, d) {
|
|
371
|
-
return c * (t /= d) * t * t * t * t + b;
|
|
372
|
-
};
|
|
373
|
-
Tween.strongEaseOut = function (t, b, c, d) {
|
|
374
|
-
return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
|
|
375
|
-
};
|
|
376
|
-
Tween.strongEaseInOut = function (t, b, c, d) {
|
|
377
|
-
if ((t /= d / 2) < 1) {
|
|
378
|
-
return c / 2 * t * t * t * t * t + b;
|
|
379
|
-
}
|
|
380
|
-
return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
|
|
381
|
-
};
|
|
1
|
+
/**********************************************************************
|
|
2
|
+
TERMS OF USE - EASING EQUATIONS
|
|
3
|
+
Open source under the BSD License.
|
|
4
|
+
Copyright (c) 2001 Robert Penner
|
|
5
|
+
JavaScript version copyright (C) 2006 by Philippe Maegerman
|
|
6
|
+
All rights reserved.
|
|
7
|
+
|
|
8
|
+
Redistribution and use in source and binary forms, with or without
|
|
9
|
+
modification, are permitted provided that the following conditions are
|
|
10
|
+
met:
|
|
11
|
+
|
|
12
|
+
* Redistributions of source code must retain the above copyright
|
|
13
|
+
notice, this list of conditions and the following disclaimer.
|
|
14
|
+
* Redistributions in binary form must reproduce the above
|
|
15
|
+
copyright notice, this list of conditions and the following disclaimer
|
|
16
|
+
in the documentation and/or other materials provided with the
|
|
17
|
+
distribution.
|
|
18
|
+
* Neither the name of the author nor the names of contributors may
|
|
19
|
+
be used to endorse or promote products derived from this software
|
|
20
|
+
without specific prior written permission.
|
|
21
|
+
|
|
22
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
23
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
25
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
26
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
27
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
28
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
29
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
30
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
|
+
|
|
34
|
+
*****************************************/
|
|
35
|
+
function Delegate() {}
|
|
36
|
+
Delegate.create = function (o, f) {
|
|
37
|
+
var a = [], i, l = arguments.length;
|
|
38
|
+
for (i = 2; i < l; i++) {
|
|
39
|
+
a[i - 2] = arguments[i];
|
|
40
|
+
}
|
|
41
|
+
return function () {
|
|
42
|
+
var aP = [].concat(arguments, a);
|
|
43
|
+
f.apply(o, aP);
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/*
|
|
48
|
+
object:
|
|
49
|
+
type:Object
|
|
50
|
+
The object you want to modify. It can be any object, a visual object that you want to animate ( document.body.style ) or an anymous object ( new Object() ).
|
|
51
|
+
property:
|
|
52
|
+
type:String
|
|
53
|
+
The property that is updated on the target object, it can be empty ('')
|
|
54
|
+
easing:
|
|
55
|
+
type:Function
|
|
56
|
+
The easing that will be applied to motion.
|
|
57
|
+
start:
|
|
58
|
+
type:Number
|
|
59
|
+
Start value
|
|
60
|
+
end:
|
|
61
|
+
type:Number
|
|
62
|
+
End value
|
|
63
|
+
duration:
|
|
64
|
+
type:Number
|
|
65
|
+
Animation duration in seconds
|
|
66
|
+
suffixe:
|
|
67
|
+
type:String
|
|
68
|
+
A string to append to the updated property ('%','pt','em' ...).
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
var Tween = function (obj, prop, func, begin, finish, duration, suffixe) {
|
|
72
|
+
this.init(obj, prop, func, begin, finish, duration, suffixe);
|
|
73
|
+
};
|
|
74
|
+
var t = Tween.prototype;
|
|
75
|
+
|
|
76
|
+
t.obj = {};
|
|
77
|
+
t.prop = '';
|
|
78
|
+
t.func = function (t, b, c, d) { return c * t / d + b; };
|
|
79
|
+
t.begin = 0;
|
|
80
|
+
t.change = 0;
|
|
81
|
+
t.prevTime = 0;
|
|
82
|
+
t.prevPos = 0;
|
|
83
|
+
t.looping = false;
|
|
84
|
+
t._duration = 0;
|
|
85
|
+
t._time = 0;
|
|
86
|
+
t._pos = 0;
|
|
87
|
+
t._position = 0;
|
|
88
|
+
t._startTime = 0;
|
|
89
|
+
t._finish = 0;
|
|
90
|
+
t.name = '';
|
|
91
|
+
t.suffixe = '';
|
|
92
|
+
t._listeners = [];
|
|
93
|
+
t.setTime = function (t) {
|
|
94
|
+
this.prevTime = this._time;
|
|
95
|
+
if (t > this.getDuration()) {
|
|
96
|
+
if (this.looping) {
|
|
97
|
+
this.rewind(t - this._duration);
|
|
98
|
+
this.update();
|
|
99
|
+
this.broadcastMessage('onMotionLooped', {target: this, type: 'onMotionLooped'});
|
|
100
|
+
} else {
|
|
101
|
+
this._time = this._duration;
|
|
102
|
+
this.update();
|
|
103
|
+
this.stop();
|
|
104
|
+
this.broadcastMessage('onMotionFinished', {target: this, type: 'onMotionFinished'});
|
|
105
|
+
}
|
|
106
|
+
} else if (t < 0) {
|
|
107
|
+
this.rewind();
|
|
108
|
+
this.update();
|
|
109
|
+
} else {
|
|
110
|
+
this._time = t;
|
|
111
|
+
this.update();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
t.getTime = function () {
|
|
115
|
+
return this._time;
|
|
116
|
+
};
|
|
117
|
+
t.setDuration = function (d) {
|
|
118
|
+
this._duration = (d === null || d <= 0) ? 100000 : d;
|
|
119
|
+
};
|
|
120
|
+
t.getDuration = function () {
|
|
121
|
+
return this._duration;
|
|
122
|
+
};
|
|
123
|
+
t.setPosition = function (p) {
|
|
124
|
+
this.prevPos = this._pos;
|
|
125
|
+
var a = this.suffixe !== '' ? this.suffixe : '';
|
|
126
|
+
this.obj[this.prop] = Math.round(p) + a;
|
|
127
|
+
this._pos = p;
|
|
128
|
+
this.broadcastMessage('onMotionChanged', {target: this, type: 'onMotionChanged'});
|
|
129
|
+
};
|
|
130
|
+
t.getPosition = function (t) {
|
|
131
|
+
if (t === undefined) {
|
|
132
|
+
t = this._time;
|
|
133
|
+
}
|
|
134
|
+
return this.func(t, this.begin, this.change, this._duration);
|
|
135
|
+
};
|
|
136
|
+
t.setFinish = function (f) {
|
|
137
|
+
this.change = f - this.begin;
|
|
138
|
+
};
|
|
139
|
+
t.getFinish = function () {
|
|
140
|
+
return this.begin + this.change;
|
|
141
|
+
};
|
|
142
|
+
t.init = function (obj, prop, func, begin, finish, duration, suffixe) {
|
|
143
|
+
if (!arguments.length) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
this._listeners = [];
|
|
147
|
+
this.addListener(this);
|
|
148
|
+
if (suffixe) {
|
|
149
|
+
this.suffixe = suffixe;
|
|
150
|
+
}
|
|
151
|
+
this.obj = obj;
|
|
152
|
+
this.prop = prop;
|
|
153
|
+
this.begin = begin;
|
|
154
|
+
this._pos = begin;
|
|
155
|
+
this.setDuration(duration);
|
|
156
|
+
if (func !== null && func !== '') {
|
|
157
|
+
this.func = func;
|
|
158
|
+
}
|
|
159
|
+
this.setFinish(finish);
|
|
160
|
+
};
|
|
161
|
+
t.start = function () {
|
|
162
|
+
this.rewind();
|
|
163
|
+
this.startEnterFrame();
|
|
164
|
+
this.broadcastMessage('onMotionStarted', {target: this, type: 'onMotionStarted'});
|
|
165
|
+
//alert('in');
|
|
166
|
+
};
|
|
167
|
+
t.rewind = function (t) {
|
|
168
|
+
this.stop();
|
|
169
|
+
this._time = (t === undefined) ? 0 : t;
|
|
170
|
+
this.fixTime();
|
|
171
|
+
this.update();
|
|
172
|
+
};
|
|
173
|
+
t.fforward = function () {
|
|
174
|
+
this._time = this._duration;
|
|
175
|
+
this.fixTime();
|
|
176
|
+
this.update();
|
|
177
|
+
};
|
|
178
|
+
t.update = function () {
|
|
179
|
+
this.setPosition(this.getPosition(this._time));
|
|
180
|
+
};
|
|
181
|
+
t.startEnterFrame = function () {
|
|
182
|
+
this.stopEnterFrame();
|
|
183
|
+
this.isPlaying = true;
|
|
184
|
+
this.onEnterFrame();
|
|
185
|
+
};
|
|
186
|
+
t.onEnterFrame = function () {
|
|
187
|
+
if (this.isPlaying) {
|
|
188
|
+
this.nextFrame();
|
|
189
|
+
// To get real smooth movement you have to set the timeout to 0 instead of 25
|
|
190
|
+
setTimeout(Delegate.create(this, this.onEnterFrame), 25);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
t.nextFrame = function () {
|
|
194
|
+
this.setTime((this.getTimer() - this._startTime) / 1000);
|
|
195
|
+
};
|
|
196
|
+
t.stop = function () {
|
|
197
|
+
this.stopEnterFrame();
|
|
198
|
+
this.broadcastMessage('onMotionStopped', {target: this, type: 'onMotionStopped'});
|
|
199
|
+
};
|
|
200
|
+
t.stopEnterFrame = function () {
|
|
201
|
+
this.isPlaying = false;
|
|
202
|
+
};
|
|
203
|
+
t.playing = function () {
|
|
204
|
+
return this.isPlaying;
|
|
205
|
+
};
|
|
206
|
+
t.continueTo = function (finish, duration) {
|
|
207
|
+
this.begin = this._pos;
|
|
208
|
+
this.setFinish(finish);
|
|
209
|
+
if (this._duration !== undefined) {
|
|
210
|
+
this.setDuration(duration);
|
|
211
|
+
}
|
|
212
|
+
this.start();
|
|
213
|
+
};
|
|
214
|
+
t.resume = function () {
|
|
215
|
+
this.fixTime();
|
|
216
|
+
this.startEnterFrame();
|
|
217
|
+
this.broadcastMessage('onMotionResumed', {target: this, type: 'onMotionResumed'});
|
|
218
|
+
};
|
|
219
|
+
t.yoyo = function () {
|
|
220
|
+
this.continueTo(this.begin, this._time);
|
|
221
|
+
};
|
|
222
|
+
t.addListener = function (o) {
|
|
223
|
+
this.removeListener(o);
|
|
224
|
+
return this._listeners.push(o);
|
|
225
|
+
};
|
|
226
|
+
t.removeListener = function (o) {
|
|
227
|
+
var a = this._listeners,
|
|
228
|
+
i = a.length;
|
|
229
|
+
while (i--) {
|
|
230
|
+
if (a[i] === o) {
|
|
231
|
+
a.splice(i, 1);
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return false;
|
|
236
|
+
};
|
|
237
|
+
t.broadcastMessage = function () {
|
|
238
|
+
var arr = [], i, e, a = this._listeners,
|
|
239
|
+
l = a.length;
|
|
240
|
+
for (i = 0; i < arguments.length; i++) {
|
|
241
|
+
arr.push(arguments[i]);
|
|
242
|
+
}
|
|
243
|
+
e = arr.shift();
|
|
244
|
+
|
|
245
|
+
for (i = 0; i < l; i++) {
|
|
246
|
+
if (a[i][e]) {
|
|
247
|
+
a[i][e].apply(a[i], arr);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
t.fixTime = function () {
|
|
252
|
+
this._startTime = this.getTimer() - this._time * 1000;
|
|
253
|
+
};
|
|
254
|
+
t.getTimer = function () {
|
|
255
|
+
return new Date().getTime() - this._time;
|
|
256
|
+
};
|
|
257
|
+
Tween.backEaseIn = function (t, b, c, d, a, p) {
|
|
258
|
+
var s = 1.70158;
|
|
259
|
+
return c * (t /= d) * t * ((s + 1) * t - s) + b;
|
|
260
|
+
};
|
|
261
|
+
Tween.backEaseOut = function (t, b, c, d, a, p) {
|
|
262
|
+
var s = 1.70158;
|
|
263
|
+
return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
|
|
264
|
+
};
|
|
265
|
+
Tween.backEaseInOut = function (t, b, c, d, a, p) {
|
|
266
|
+
var s = 1.70158;
|
|
267
|
+
if ((t /= d / 2) < 1) {
|
|
268
|
+
return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
|
|
269
|
+
}
|
|
270
|
+
return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
|
|
271
|
+
};
|
|
272
|
+
Tween.elasticEaseIn = function (t, b, c, d, a, p) {
|
|
273
|
+
var s;
|
|
274
|
+
if (t === 0) {
|
|
275
|
+
return b;
|
|
276
|
+
}
|
|
277
|
+
if ((t /= d) === 1) {
|
|
278
|
+
return b + c;
|
|
279
|
+
}
|
|
280
|
+
if (!p) {
|
|
281
|
+
p = d * 0.3;
|
|
282
|
+
}
|
|
283
|
+
if (!a || a < Math.abs(c)) {
|
|
284
|
+
a = c;
|
|
285
|
+
s = p / 4;
|
|
286
|
+
} else {
|
|
287
|
+
s = p / (2 * Math.PI) * Math.asin(c / a);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
|
|
291
|
+
|
|
292
|
+
};
|
|
293
|
+
Tween.elasticEaseOut = function (t, b, c, d, a, p) {
|
|
294
|
+
var s;
|
|
295
|
+
if (t === 0) {
|
|
296
|
+
return b;
|
|
297
|
+
}
|
|
298
|
+
if ((t /= d) === 1) {
|
|
299
|
+
return b + c;
|
|
300
|
+
}
|
|
301
|
+
if (!p) {
|
|
302
|
+
p = d * 0.3;
|
|
303
|
+
}
|
|
304
|
+
if (!a || a < Math.abs(c)) {
|
|
305
|
+
a = c;
|
|
306
|
+
s = p / 4;
|
|
307
|
+
} else {
|
|
308
|
+
s = p / (2 * Math.PI) * Math.asin(c / a);
|
|
309
|
+
}
|
|
310
|
+
return (a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b);
|
|
311
|
+
};
|
|
312
|
+
Tween.elasticEaseInOut = function (t, b, c, d, a, p) {
|
|
313
|
+
var s;
|
|
314
|
+
if (t === 0) {
|
|
315
|
+
return b;
|
|
316
|
+
}
|
|
317
|
+
if ((t /= d / 2) === 2) {
|
|
318
|
+
return b + c;
|
|
319
|
+
}
|
|
320
|
+
if (!p) {
|
|
321
|
+
p = d * (0.3 * 1.5);
|
|
322
|
+
}
|
|
323
|
+
if (!a || a < Math.abs(c)) {
|
|
324
|
+
a = c;
|
|
325
|
+
s = p / 4;
|
|
326
|
+
} else {
|
|
327
|
+
s = p / (2 * Math.PI) * Math.asin(c / a);
|
|
328
|
+
}
|
|
329
|
+
if (t < 1) {
|
|
330
|
+
return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
|
|
331
|
+
}
|
|
332
|
+
return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * 0.5 + c + b;
|
|
333
|
+
};
|
|
334
|
+
Tween.bounceEaseOut = function (t, b, c, d) {
|
|
335
|
+
if ((t /= d) < (1 / 2.75)) {
|
|
336
|
+
return c * (7.5625 * t * t) + b;
|
|
337
|
+
} else if (t < (2 / 2.75)) {
|
|
338
|
+
return c * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75) + b;
|
|
339
|
+
} else if (t < (2.5 / 2.75)) {
|
|
340
|
+
return c * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375) + b;
|
|
341
|
+
} else {
|
|
342
|
+
return c * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375) + b;
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
Tween.bounceEaseIn = function (t, b, c, d) {
|
|
346
|
+
return c - Tween.bounceEaseOut(d - t, 0, c, d) + b;
|
|
347
|
+
};
|
|
348
|
+
Tween.bounceEaseInOut = function (t, b, c, d) {
|
|
349
|
+
if (t < d / 2) {
|
|
350
|
+
return Tween.bounceEaseIn(t * 2, 0, c, d) * 0.5 + b;
|
|
351
|
+
} else {
|
|
352
|
+
return Tween.bounceEaseOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
Tween.strongEaseInOut = function (t, b, c, d) {
|
|
356
|
+
return c * (t /= d) * t * t * t * t + b;
|
|
357
|
+
};
|
|
358
|
+
Tween.regularEaseIn = function (t, b, c, d) {
|
|
359
|
+
return c * (t /= d) * t + b;
|
|
360
|
+
};
|
|
361
|
+
Tween.regularEaseOut = function (t, b, c, d) {
|
|
362
|
+
return -c * (t /= d) * (t - 2) + b;
|
|
363
|
+
};
|
|
364
|
+
Tween.regularEaseInOut = function (t, b, c, d) {
|
|
365
|
+
if ((t /= d / 2) < 1) {
|
|
366
|
+
return c / 2 * t * t + b;
|
|
367
|
+
}
|
|
368
|
+
return -c / 2 * ((--t) * (t - 2) - 1) + b;
|
|
369
|
+
};
|
|
370
|
+
Tween.strongEaseIn = function (t, b, c, d) {
|
|
371
|
+
return c * (t /= d) * t * t * t * t + b;
|
|
372
|
+
};
|
|
373
|
+
Tween.strongEaseOut = function (t, b, c, d) {
|
|
374
|
+
return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
|
|
375
|
+
};
|
|
376
|
+
Tween.strongEaseInOut = function (t, b, c, d) {
|
|
377
|
+
if ((t /= d / 2) < 1) {
|
|
378
|
+
return c / 2 * t * t * t * t * t + b;
|
|
379
|
+
}
|
|
380
|
+
return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
|
|
381
|
+
};
|