Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
3.4 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * VERSION: 0.3.1
  3. * DATE: 2018-02-15
  4. * UPDATES AND DOCS AT: http://greensock.com
  5. *
  6. * @license Copyright (c) 2008-2019, GreenSock. All rights reserved.
  7. * This work is subject to the terms at http://greensock.com/standard-license or for
  8. * Club GreenSock members, the software agreement that was issued with your membership.
  9. *
  10. * @author: Jack Doyle, jack@greensock.com
  11. **/
  12. /* eslint-disable */
  13. var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
  14. (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
  15. "use strict";
  16. _gsScope._gsDefine.plugin({
  17. propName: "directionalRotation",
  18. version: "0.3.1",
  19. API: 2,
  20. //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
  21. init: function(target, value, tween, index) {
  22. if (typeof(value) !== "object") {
  23. value = {rotation:value};
  24. }
  25. this.finals = {};
  26. var cap = (value.useRadians === true) ? Math.PI * 2 : 360,
  27. min = 0.000001,
  28. p, v, start, end, dif, split;
  29. for (p in value) {
  30. if (p !== "useRadians") {
  31. end = value[p];
  32. if (typeof(end) === "function") {
  33. end = end(index, target);
  34. }
  35. split = (end + "").split("_");
  36. v = split[0];
  37. start = parseFloat( (typeof(target[p]) !== "function") ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]() );
  38. end = this.finals[p] = (typeof(v) === "string" && v.charAt(1) === "=") ? start + parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : Number(v) || 0;
  39. dif = end - start;
  40. if (split.length) {
  41. v = split.join("_");
  42. if (v.indexOf("short") !== -1) {
  43. dif = dif % cap;
  44. if (dif !== dif % (cap / 2)) {
  45. dif = (dif < 0) ? dif + cap : dif - cap;
  46. }
  47. }
  48. if (v.indexOf("_cw") !== -1 && dif < 0) {
  49. dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap;
  50. } else if (v.indexOf("ccw") !== -1 && dif > 0) {
  51. dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap;
  52. }
  53. }
  54. if (dif > min || dif < -min) {
  55. this._addTween(target, p, start, start + dif, p);
  56. this._overwriteProps.push(p);
  57. }
  58. }
  59. }
  60. return true;
  61. },
  62. //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
  63. set: function(ratio) {
  64. var pt;
  65. if (ratio !== 1) {
  66. this._super.setRatio.call(this, ratio);
  67. } else {
  68. pt = this._firstPT;
  69. while (pt) {
  70. if (pt.f) {
  71. pt.t[pt.p](this.finals[pt.p]);
  72. } else {
  73. pt.t[pt.p] = this.finals[pt.p];
  74. }
  75. pt = pt._next;
  76. }
  77. }
  78. }
  79. })._autoCSS = true;
  80. }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
  81. //export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date)
  82. (function(name) {
  83. "use strict";
  84. var getGlobal = function() {
  85. return (_gsScope.GreenSockGlobals || _gsScope)[name];
  86. };
  87. if (typeof(module) !== "undefined" && module.exports) { //node
  88. require("../TweenLite.js");
  89. module.exports = getGlobal();
  90. } else if (typeof(define) === "function" && define.amd) { //AMD
  91. define(["TweenLite"], getGlobal);
  92. }
  93. }("DirectionalRotationPlugin"));