Wrapper of water-animation-2d for React
npm install react-water-animation-2dshell
npm i water-animation-2d
`
How to use?
For animation you need both "WaterAnimation" and "useWaterAnimationManager"
Example of use:
`jsx
import WaterAnimation, {useWaterAnimationManager} from "react-water-animation-2d";
const Example = () => {
const {control, waterAnimationManager} = useWaterAnimationManager();
return style={{
width: "300px"
}}
>
control={control}
fullWidth
/>
onClick={() => {
// apply force to the middle of water line downward for 200 ms
waterAnimationManager.applyForce(
150, // position of force (in px)
{x: 0, y: 1000}, // force
200 // duration of force (in ms)
)
}}
>
Trigger animation