UNPKG

animex

Version:

Modern animation-on-scroll library with optional GSAP support

120 lines (81 loc) โ€ข 3.22 kB
# ๐ŸŽ‰ AnimeX โ€” Scroll Animation Library [![npm version](https://img.shields.io/npm/v/animex.svg?style=flat-square)](https://www.npmjs.com/package/animex) [![GitHub stars](https://img.shields.io/github/stars/Theusama1183/animex.svg?style=social)](https://github.com/Theusama1183/animex) [![License](https://img.shields.io/npm/l/animex)](https://github.com/Theusama1183/animex/blob/main/LICENSE) [![unpkg](https://img.shields.io/badge/CDN-unpkg-brightgreen)](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.