()
| 522 | * Run all "before" animation hooks. |
| 523 | */ |
| 524 | const beforeAnimation = () => { |
| 525 | // Runs all before read callbacks |
| 526 | _beforeAddReadFunctions.forEach((callback) => callback()); |
| 527 | |
| 528 | // Runs all before write callbacks |
| 529 | _beforeAddWriteFunctions.forEach((callback) => callback()); |
| 530 | |
| 531 | // Updates styles and classes before animation runs |
| 532 | const addClasses = beforeAddClasses; |
| 533 | const removeClasses = beforeRemoveClasses; |
| 534 | const styles = beforeStylesValue; |
| 535 | |
| 536 | elements.forEach((el) => { |
| 537 | const elementClassList = el.classList; |
| 538 | |
| 539 | addClasses.forEach((c) => elementClassList.add(c)); |
| 540 | removeClasses.forEach((c) => elementClassList.remove(c)); |
| 541 | |
| 542 | for (const property in styles) { |
| 543 | // eslint-disable-next-line no-prototype-builtins |
| 544 | if (styles.hasOwnProperty(property)) { |
| 545 | setStyleProperty(el, property, styles[property]); |
| 546 | } |
| 547 | } |
| 548 | }); |
| 549 | }; |
| 550 | |
| 551 | /** |
| 552 | * Run all "after" animation hooks. |
no test coverage detected