(props, duration, ease, delay = 0, complete, update)
| 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); |
no test coverage detected