Skip to content

Commit

Permalink
feat(animations) : flash animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mutesa-Cedric committed Sep 26, 2023
1 parent e9a04e2 commit 70fc6ae
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/animations/simple/Flash.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import wrapper from '@/HOC/wrapper';

Check failure on line 1 in src/animations/simple/Flash.ts

View workflow job for this annotation

GitHub Actions / lint

Extra semicolon
import { animation, defaults } from '@/lib/defaultConfigs';

Check failure on line 2 in src/animations/simple/Flash.ts

View workflow job for this annotation

GitHub Actions / lint

Extra semicolon

const rule = `
from, 50%, to {
opacity: 1;
}
25%, 75% {
opacity: 0;
}
`;

Check failure on line 12 in src/animations/simple/Flash.ts

View workflow job for this annotation

GitHub Actions / lint

Extra semicolon

let name: string | undefined;

Check failure on line 14 in src/animations/simple/Flash.ts

View workflow job for this annotation

GitHub Actions / lint

Extra semicolon

function make() {
return name || (name = animation(rule));

Check failure on line 17 in src/animations/simple/Flash.ts

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 2 spaces but found 4
}

export default function Flash(
{
children,
_out,
timeout,
duration = defaults.duration,
delay = defaults.delay,
count = defaults.count,
forever, ...props
} = defaults
) {
const effect = { make, duration: timeout === undefined ? duration : timeout, delay, forever, count, style: { animationFillMode: 'both', } };
// @ts-expect-error(some props are not allowed, this will be fixed later)
return wrapper(props, effect, false, children, true);
};

1 change: 1 addition & 0 deletions src/animations/simple/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export * from "./Jump";
export * from "./HeadShake";
export * from "./Jello";
export * from "./RubberBand";
export * from "./Flash";

0 comments on commit 70fc6ae

Please sign in to comment.