You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
477 B
TypeScript
22 lines
477 B
TypeScript
2 years ago
|
import autoAnimate_ from "@formkit/auto-animate";
|
||
|
import { onMount } from "solid-js";
|
||
|
|
||
|
// https://auto-animate.formkit.com/
|
||
|
|
||
|
export const autoAnimate = (
|
||
|
el: HTMLElement,
|
||
|
config?: () => Parameters<typeof autoAnimate_>[1]
|
||
|
) => {
|
||
|
onMount(function () {
|
||
|
autoAnimate_(el, config != null ? config() : undefined);
|
||
|
});
|
||
|
};
|
||
|
|
||
|
declare module "solid-js" {
|
||
|
namespace JSX {
|
||
|
interface Directives {
|
||
|
autoAnimate: Parameters<typeof autoAnimate_>[1] | boolean;
|
||
|
}
|
||
|
}
|
||
|
}
|