MCPcopy Create free account
hub / github.com/alienkitty/space.js / tween

Method tween

src/utils/Interface.js:332–370  ·  view source on GitHub ↗
(props, duration, ease, delay = 0, complete, update)

Source from the content-addressed store, hash-verified

330 }
331
332 tween(props, duration, ease, delay = 0, complete, update) {
333 if (!this.element) {
334 return;
335 }
336
337 if (typeof delay !== 'number') {
338 update = complete;
339 complete = delay;
340 delay = 0;
341 }
342
343 const style = getComputedStyle(this.element);
344
345 for (const key in props) {
346 let val;
347
348 if (this.style[key] !== undefined) {
349 val = this.style[key];
350 } else if (~Transforms.indexOf(key) || ~Filters.indexOf(key) || ~Numeric.indexOf(key)) {
351 val = ~Lacuna1.indexOf(key) ? 1 : 0;
352 } else if (typeof style[key] === 'string') {
353 val = parseFloat(style[key]);
354 }
355
356 if (!isNaN(val)) {
357 this.style[key] = val;
358 }
359 }
360
361 const promise = tween(this.style, props, duration, ease, delay, complete, () => {
362 this.css(this.style);
363
364 if (update) {
365 update();
366 }
367 });
368
369 return promise;
370 }
371
372 clearTween() {
373 clearTween(this.style);

Callers 15

animateInMethod · 0.45
animateOutMethod · 0.45
enableMethod · 0.45
disableMethod · 0.45
ListSelectClass · 0.45
ListToggleClass · 0.45
PanelLinkClass · 0.45
activateMethod · 0.45
deactivateMethod · 0.45
openMethod · 0.45
closeMethod · 0.45
openMethod · 0.45

Calls 2

cssMethod · 0.95
tweenFunction · 0.90

Tested by

no test coverage detected