animex
Version:
Modern animation-on-scroll library with optional GSAP support
120 lines (81 loc) โข 3.22 kB
Markdown
# ๐ AnimeX โ Scroll Animation Library
[](https://www.npmjs.com/package/animex)
[](https://github.com/Theusama1183/animex)
[](https://github.com/Theusama1183/animex/blob/main/LICENSE)
[](https://unpkg.com/animex/)
> **AnimeX** is a lightweight, plug-and-play scroll animation library for modern websites. Designed for performance and simplicity with support for 100+ stunning animations and optional GSAP integration.
## ๐ Live Demo
๐ [Explore the Animation Gallery ยป](https://animex.beeoceans.com/)
## ๐ Quick Install
### ๐ฆ npm
```bash
npm install animex
```
### ๐ CDN (via unpkg)
```html
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/animex/dist/animex.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/animex/dist/animex.min.js"></script>
```
## โจ Basic Usage
### HTML Markup
```html
<div animex="fade-up" animex-delay="300" animex-duration="1000">
Hello AnimeX!
</div>
```
### JavaScript Init
```js
AnimeX.init({
useGSAP: true,
once: true,
offset: 100,
delay: 100,
debug: true,
});
```
## ๐ง Configuration Options
| Option | Type | Default | Description |
| ---------- | ------- | -------- | ----------------------------------------- |
| `offset` | Number | `120` | Distance from bottom of screen to trigger |
| `duration` | Number | `800` | Animation duration in milliseconds |
| `easing` | String | `'ease'` | CSS easing value |
| `once` | Boolean | `false` | Animate only once |
| `useGSAP` | Boolean | `false` | Use GSAP if available |
| `delay` | Number | `0` | Adds incremental delay (ms) per element |
| `debug` | Boolean | `false` | Highlights target elements on scroll |
## ๐ฌ Animation Types
Over 100 pre-built effects including:
- โ
Fade, Slide, Zoom
- โ
Flip, Rotate, Skew
- โ
Bounce, Pulse, Shake
- โ
GSAP-powered transforms (optional)
View the full animation gallery โ [Demo](https://animex.beeoceans.com/)
`
## ๐ API Reference
### `AnimeX.init(config)` โ Instance
Initializes AnimeX with the given configuration.
#### Parameters:
- `config` (`object`) โ configuration object with the following keys:
- `offset`: Number (scroll trigger offset in pixels)
- `duration`: Number (default animation duration in ms)
- `easing`: String (default CSS easing)
- `once`: Boolean (animate only once)
- `useGSAP`: Boolean (use GSAP if loaded)
- `delay`: Number (incremental delay between elements in ms)
- `debug`: Boolean (adds outline for debug)
### `AnimeX.refresh()`
Forces re-scan of all `[animex]` elements and re-initializes observers.
## ๐ License
[MIT License](LICENSE) ยฉ 2025 [Usama Adeel](https://github.com/Theusama1183)
> Made with โค๏ธ to help developers craft delightful web experiences with zero dependencies.