Web UI for ARGUS server
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.

380 lines
11 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * VERSION: 1.16.0
  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("easing.Back", ["easing.Ease"], function(Ease) {
  17. var w = (_gsScope.GreenSockGlobals || _gsScope),
  18. gs = w.com.greensock,
  19. _2PI = Math.PI * 2,
  20. _HALF_PI = Math.PI / 2,
  21. _class = gs._class,
  22. _create = function(n, f) {
  23. var C = _class("easing." + n, function(){}, true),
  24. p = C.prototype = new Ease();
  25. p.constructor = C;
  26. p.getRatio = f;
  27. return C;
  28. },
  29. _easeReg = Ease.register || function(){}, //put an empty function in place just as a safety measure in case someone loads an OLD version of TweenLite.js where Ease.register doesn't exist.
  30. _wrap = function(name, EaseOut, EaseIn, EaseInOut, aliases) {
  31. var C = _class("easing."+name, {
  32. easeOut:new EaseOut(),
  33. easeIn:new EaseIn(),
  34. easeInOut:new EaseInOut()
  35. }, true);
  36. _easeReg(C, name);
  37. return C;
  38. },
  39. EasePoint = function(time, value, next) {
  40. this.t = time;
  41. this.v = value;
  42. if (next) {
  43. this.next = next;
  44. next.prev = this;
  45. this.c = next.v - value;
  46. this.gap = next.t - time;
  47. }
  48. },
  49. //Back
  50. _createBack = function(n, f) {
  51. var C = _class("easing." + n, function(overshoot) {
  52. this._p1 = (overshoot || overshoot === 0) ? overshoot : 1.70158;
  53. this._p2 = this._p1 * 1.525;
  54. }, true),
  55. p = C.prototype = new Ease();
  56. p.constructor = C;
  57. p.getRatio = f;
  58. p.config = function(overshoot) {
  59. return new C(overshoot);
  60. };
  61. return C;
  62. },
  63. Back = _wrap("Back",
  64. _createBack("BackOut", function(p) {
  65. return ((p = p - 1) * p * ((this._p1 + 1) * p + this._p1) + 1);
  66. }),
  67. _createBack("BackIn", function(p) {
  68. return p * p * ((this._p1 + 1) * p - this._p1);
  69. }),
  70. _createBack("BackInOut", function(p) {
  71. return ((p *= 2) < 1) ? 0.5 * p * p * ((this._p2 + 1) * p - this._p2) : 0.5 * ((p -= 2) * p * ((this._p2 + 1) * p + this._p2) + 2);
  72. })
  73. ),
  74. //SlowMo
  75. SlowMo = _class("easing.SlowMo", function(linearRatio, power, yoyoMode) {
  76. power = (power || power === 0) ? power : 0.7;
  77. if (linearRatio == null) {
  78. linearRatio = 0.7;
  79. } else if (linearRatio > 1) {
  80. linearRatio = 1;
  81. }
  82. this._p = (linearRatio !== 1) ? power : 0;
  83. this._p1 = (1 - linearRatio) / 2;
  84. this._p2 = linearRatio;
  85. this._p3 = this._p1 + this._p2;
  86. this._calcEnd = (yoyoMode === true);
  87. }, true),
  88. p = SlowMo.prototype = new Ease(),
  89. SteppedEase, ExpoScaleEase, RoughEase, _createElastic;
  90. p.constructor = SlowMo;
  91. p.getRatio = function(p) {
  92. var r = p + (0.5 - p) * this._p;
  93. if (p < this._p1) {
  94. return this._calcEnd ? 1 - ((p = 1 - (p / this._p1)) * p) : r - ((p = 1 - (p / this._p1)) * p * p * p * r);
  95. } else if (p > this._p3) {
  96. return this._calcEnd ? (p === 1 ? 0 : 1 - (p = (p - this._p3) / this._p1) * p) : r + ((p - r) * (p = (p - this._p3) / this._p1) * p * p * p); //added p === 1 ? 0 to avoid floating point rounding errors from affecting the final value, like 1 - 0.7 = 0.30000000000000004 instead of 0.3
  97. }
  98. return this._calcEnd ? 1 : r;
  99. };
  100. SlowMo.ease = new SlowMo(0.7, 0.7);
  101. p.config = SlowMo.config = function(linearRatio, power, yoyoMode) {
  102. return new SlowMo(linearRatio, power, yoyoMode);
  103. };
  104. //SteppedEase
  105. SteppedEase = _class("easing.SteppedEase", function(steps, immediateStart) {
  106. steps = steps || 1;
  107. this._p1 = 1 / steps;
  108. this._p2 = steps + (immediateStart ? 0 : 1);
  109. this._p3 = immediateStart ? 1 : 0;
  110. }, true);
  111. p = SteppedEase.prototype = new Ease();
  112. p.constructor = SteppedEase;
  113. p.getRatio = function(p) {
  114. if (p < 0) {
  115. p = 0;
  116. } else if (p >= 1) {
  117. p = 0.999999999;
  118. }
  119. return (((this._p2 * p) | 0) + this._p3) * this._p1;
  120. };
  121. p.config = SteppedEase.config = function(steps, immediateStart) {
  122. return new SteppedEase(steps, immediateStart);
  123. };
  124. //ExpoScaleEase
  125. ExpoScaleEase = _class("easing.ExpoScaleEase", function(start, end, ease) {
  126. this._p1 = Math.log(end / start);
  127. this._p2 = end - start;
  128. this._p3 = start;
  129. this._ease = ease;
  130. }, true);
  131. p = ExpoScaleEase.prototype = new Ease();
  132. p.constructor = ExpoScaleEase;
  133. p.getRatio = function(p) {
  134. if (this._ease) {
  135. p = this._ease.getRatio(p);
  136. }
  137. return (this._p3 * Math.exp(this._p1 * p) - this._p3) / this._p2;
  138. };
  139. p.config = ExpoScaleEase.config = function(start, end, ease) {
  140. return new ExpoScaleEase(start, end, ease);
  141. };
  142. //RoughEase
  143. RoughEase = _class("easing.RoughEase", function(vars) {
  144. vars = vars || {};
  145. var taper = vars.taper || "none",
  146. a = [],
  147. cnt = 0,
  148. points = (vars.points || 20) | 0,
  149. i = points,
  150. randomize = (vars.randomize !== false),
  151. clamp = (vars.clamp === true),
  152. template = (vars.template instanceof Ease) ? vars.template : null,
  153. strength = (typeof(vars.strength) === "number") ? vars.strength * 0.4 : 0.4,
  154. x, y, bump, invX, obj, pnt;
  155. while (--i > -1) {
  156. x = randomize ? Math.random() : (1 / points) * i;
  157. y = template ? template.getRatio(x) : x;
  158. if (taper === "none") {
  159. bump = strength;
  160. } else if (taper === "out") {
  161. invX = 1 - x;
  162. bump = invX * invX * strength;
  163. } else if (taper === "in") {
  164. bump = x * x * strength;
  165. } else if (x < 0.5) { //"both" (start)
  166. invX = x * 2;
  167. bump = invX * invX * 0.5 * strength;
  168. } else { //"both" (end)
  169. invX = (1 - x) * 2;
  170. bump = invX * invX * 0.5 * strength;
  171. }
  172. if (randomize) {
  173. y += (Math.random() * bump) - (bump * 0.5);
  174. } else if (i % 2) {
  175. y += bump * 0.5;
  176. } else {
  177. y -= bump * 0.5;
  178. }
  179. if (clamp) {
  180. if (y > 1) {
  181. y = 1;
  182. } else if (y < 0) {
  183. y = 0;
  184. }
  185. }
  186. a[cnt++] = {x:x, y:y};
  187. }
  188. a.sort(function(a, b) {
  189. return a.x - b.x;
  190. });
  191. pnt = new EasePoint(1, 1, null);
  192. i = points;
  193. while (--i > -1) {
  194. obj = a[i];
  195. pnt = new EasePoint(obj.x, obj.y, pnt);
  196. }
  197. this._prev = new EasePoint(0, 0, (pnt.t !== 0) ? pnt : pnt.next);
  198. }, true);
  199. p = RoughEase.prototype = new Ease();
  200. p.constructor = RoughEase;
  201. p.getRatio = function(p) {
  202. var pnt = this._prev;
  203. if (p > pnt.t) {
  204. while (pnt.next && p >= pnt.t) {
  205. pnt = pnt.next;
  206. }
  207. pnt = pnt.prev;
  208. } else {
  209. while (pnt.prev && p <= pnt.t) {
  210. pnt = pnt.prev;
  211. }
  212. }
  213. this._prev = pnt;
  214. return (pnt.v + ((p - pnt.t) / pnt.gap) * pnt.c);
  215. };
  216. p.config = function(vars) {
  217. return new RoughEase(vars);
  218. };
  219. RoughEase.ease = new RoughEase();
  220. //Bounce
  221. _wrap("Bounce",
  222. _create("BounceOut", function(p) {
  223. if (p < 1 / 2.75) {
  224. return 7.5625 * p * p;
  225. } else if (p < 2 / 2.75) {
  226. return 7.5625 * (p -= 1.5 / 2.75) * p + 0.75;
  227. } else if (p < 2.5 / 2.75) {
  228. return 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375;
  229. }
  230. return 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375;
  231. }),
  232. _create("BounceIn", function(p) {
  233. if ((p = 1 - p) < 1 / 2.75) {
  234. return 1 - (7.5625 * p * p);
  235. } else if (p < 2 / 2.75) {
  236. return 1 - (7.5625 * (p -= 1.5 / 2.75) * p + 0.75);
  237. } else if (p < 2.5 / 2.75) {
  238. return 1 - (7.5625 * (p -= 2.25 / 2.75) * p + 0.9375);
  239. }
  240. return 1 - (7.5625 * (p -= 2.625 / 2.75) * p + 0.984375);
  241. }),
  242. _create("BounceInOut", function(p) {
  243. var invert = (p < 0.5);
  244. if (invert) {
  245. p = 1 - (p * 2);
  246. } else {
  247. p = (p * 2) - 1;
  248. }
  249. if (p < 1 / 2.75) {
  250. p = 7.5625 * p * p;
  251. } else if (p < 2 / 2.75) {
  252. p = 7.5625 * (p -= 1.5 / 2.75) * p + 0.75;
  253. } else if (p < 2.5 / 2.75) {
  254. p = 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375;
  255. } else {
  256. p = 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375;
  257. }
  258. return invert ? (1 - p) * 0.5 : p * 0.5 + 0.5;
  259. })
  260. );
  261. //CIRC
  262. _wrap("Circ",
  263. _create("CircOut", function(p) {
  264. return Math.sqrt(1 - (p = p - 1) * p);
  265. }),
  266. _create("CircIn", function(p) {
  267. return -(Math.sqrt(1 - (p * p)) - 1);
  268. }),
  269. _create("CircInOut", function(p) {
  270. return ((p*=2) < 1) ? -0.5 * (Math.sqrt(1 - p * p) - 1) : 0.5 * (Math.sqrt(1 - (p -= 2) * p) + 1);
  271. })
  272. );
  273. //Elastic
  274. _createElastic = function(n, f, def) {
  275. var C = _class("easing." + n, function(amplitude, period) {
  276. this._p1 = (amplitude >= 1) ? amplitude : 1; //note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1.
  277. this._p2 = (period || def) / (amplitude < 1 ? amplitude : 1);
  278. this._p3 = this._p2 / _2PI * (Math.asin(1 / this._p1) || 0);
  279. this._p2 = _2PI / this._p2; //precalculate to optimize
  280. }, true),
  281. p = C.prototype = new Ease();
  282. p.constructor = C;
  283. p.getRatio = f;
  284. p.config = function(amplitude, period) {
  285. return new C(amplitude, period);
  286. };
  287. return C;
  288. };
  289. _wrap("Elastic",
  290. _createElastic("ElasticOut", function(p) {
  291. return this._p1 * Math.pow(2, -10 * p) * Math.sin( (p - this._p3) * this._p2 ) + 1;
  292. }, 0.3),
  293. _createElastic("ElasticIn", function(p) {
  294. return -(this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2 ));
  295. }, 0.3),
  296. _createElastic("ElasticInOut", function(p) {
  297. return ((p *= 2) < 1) ? -0.5 * (this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2)) : this._p1 * Math.pow(2, -10 *(p -= 1)) * Math.sin( (p - this._p3) * this._p2 ) * 0.5 + 1;
  298. }, 0.45)
  299. );
  300. //Expo
  301. _wrap("Expo",
  302. _create("ExpoOut", function(p) {
  303. return 1 - Math.pow(2, -10 * p);
  304. }),
  305. _create("ExpoIn", function(p) {
  306. return Math.pow(2, 10 * (p - 1)) - 0.001;
  307. }),
  308. _create("ExpoInOut", function(p) {
  309. return ((p *= 2) < 1) ? 0.5 * Math.pow(2, 10 * (p - 1)) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
  310. })
  311. );
  312. //Sine
  313. _wrap("Sine",
  314. _create("SineOut", function(p) {
  315. return Math.sin(p * _HALF_PI);
  316. }),
  317. _create("SineIn", function(p) {
  318. return -Math.cos(p * _HALF_PI) + 1;
  319. }),
  320. _create("SineInOut", function(p) {
  321. return -0.5 * (Math.cos(Math.PI * p) - 1);
  322. })
  323. );
  324. _class("easing.EaseLookup", {
  325. find:function(s) {
  326. return Ease.map[s];
  327. }
  328. }, true);
  329. //register the non-standard eases
  330. _easeReg(w.SlowMo, "SlowMo", "ease,");
  331. _easeReg(RoughEase, "RoughEase", "ease,");
  332. _easeReg(SteppedEase, "SteppedEase", "ease,");
  333. return Back;
  334. }, true);
  335. }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
  336. //export to AMD/RequireJS and CommonJS/Node (precursor to full modular build system coming at a later date)
  337. (function() {
  338. "use strict";
  339. var getGlobal = function() {
  340. return (_gsScope.GreenSockGlobals || _gsScope);
  341. };
  342. if (typeof(module) !== "undefined" && module.exports) { //node
  343. require("../TweenLite.js");
  344. module.exports = getGlobal();
  345. } else if (typeof(define) === "function" && define.amd) { //AMD
  346. define(["TweenLite"], getGlobal);
  347. }
  348. }());