πAnimate.css
Read before using: We support the most popular animate.css animations, and you can also use any other third-party animation library. However, we have integrated animate.css in a very different way. If you are using our script on the Browser side <script>, you can directly use the animate.css CDN link. But if you are using require() or import, then we have separated all the animations into different classes (by default pulled from the animate folder under node modules of breww). This way, you can make your project much more lightweight by importing only the animations you need.
How to use:
To use animate.css, you need to add the class animate__animated
and the attribute anim-type="
THEANIMATIONNAME
"
to your element.
Currently, we need to use animation methods inside onScroll or other available hooks, and the most recommended one is onScroll. This also applies to third-party libraries that execute brew animation.
Name | Type | Description |
---|---|---|
method | (It requires three parameters: section, sections and animationOptions.) | |
method | (It requires three parameters: section, sections and animationOptions.) |
Learn More about:
πpageTwoWay Vs OneWayRequire or Import
To use require or import, you need to do something like this. These two are mandatory to import as they are the default CSS initializers.
To use a specific animation from animate.css, you can import it like this. For example, if you want to use the headShake and rubberBand animations, you can do this:
You can find more animations from animate.css here https://animate.style/ .
<script> Browser side
For browser script, you need to add this link tag to import the animate.css CDN:
But do not use this approach for import or require() if you want your application to be lightweight.
Last updated