-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29f2061
commit dcff6c9
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import wrapper from "@/HOC/wrapper"; | ||
import { animation, defaults } from "@/lib/defaultConfigs"; | ||
|
||
const rule = ` | ||
from { | ||
transform: scale(1); | ||
} | ||
50% { | ||
transform: scale(1.1); | ||
} | ||
to { | ||
transform: scale(1); | ||
} | ||
`; | ||
|
||
|
||
let name: string | undefined; | ||
|
||
function make() { | ||
return name || (name = animation(rule)); | ||
}; | ||
|
||
export default function Pop( | ||
{ | ||
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); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters