Ran eslint fix on existing codebase

Had to do some manual fixing of the app.js file due to misplaced
comments
This commit is contained in:
Dan Brown
2023-04-18 22:20:02 +01:00
parent 752ee664c2
commit e711290d8b
106 changed files with 905 additions and 869 deletions

View File

@ -15,7 +15,7 @@ export function fadeIn(element, animTime = 400, onComplete = null) {
cleanupExistingElementAnimation(element);
element.style.display = 'block';
animateStyles(element, {
opacity: ['0', '1']
opacity: ['0', '1'],
}, animTime, () => {
if (onComplete) onComplete();
});
@ -30,7 +30,7 @@ export function fadeIn(element, animTime = 400, onComplete = null) {
export function fadeOut(element, animTime = 400, onComplete = null) {
cleanupExistingElementAnimation(element);
animateStyles(element, {
opacity: ['1', '0']
opacity: ['1', '0'],
}, animTime, () => {
element.style.display = 'none';
if (onComplete) onComplete();
@ -125,12 +125,12 @@ export function transitionHeight(element, animTime = 400) {
*/
function animateStyles(element, styles, animTime = 400, onComplete = null) {
const styleNames = Object.keys(styles);
for (let style of styleNames) {
for (const style of styleNames) {
element.style[style] = styles[style][0];
}
const cleanup = () => {
for (let style of styleNames) {
for (const style of styleNames) {
element.style[style] = null;
}
element.style.transition = null;
@ -141,7 +141,7 @@ function animateStyles(element, styles, animTime = 400, onComplete = null) {
setTimeout(() => {
element.style.transition = `all ease-in-out ${animTime}ms`;
for (let style of styleNames) {
for (const style of styleNames) {
element.style[style] = styles[style][1];
}
@ -159,4 +159,4 @@ function cleanupExistingElementAnimation(element) {
const oldCleanup = animateStylesCleanupMap.get(element);
oldCleanup();
}
}
}