Thank you for checking out Z-Proximity-Engine!
Please note that this project is currently on hold and is not in a stable state (specifically the scroll-related features in the latest v2 commits).
I am currently focusing my time on learning computer science fundamentals and low-level software engineering. Because of this, this repository will not be actively maintained or updated for a short while.
- You are still free to explore, fork, or use the stable parts of the engine.
- I plan to return to this project and perform a complete refactor once I've completed my current learning phase.
Thank you so much for your understanding, your stars, and the amazing support! ๐
The Physics of Attraction for the Modern Web.
A high-performance React animation library for creating proximity-based interactions, magnetic cursor effects, and scroll-driven animations with GSAP. Perfect alternative to Framer Motion and React Spring for spatial interactions.
โจ Live Demo โข ๐ฆ NPM โข ๐ Documentation โข ๐ฎ Interactive Playground
- โก 120+ FPS: Runs at native refresh rates
- ๐ฆ 10.7KB Core: Minimal bundle impact
- ๐ GSAP Powered: Industry-standard animation engine
- ๐ญ Zero Re-renders: Animations bypass React's render cycle
- ๐ช TypeScript: Full type safety
- ๐จ 30+ Presets: Scale, magnetic, blur, cipher, and more
- ๐ Chainable: Combine unlimited effects with dash syntax
- ๐ฑ Mobile Optimized: Smart performance on touch devices
- ๐ฏ Magnetic dock interfaces (macOS-style)
- โจ Interactive landing pages
- ๐ Scroll-driven storytelling
- ๐ฎ Game-like UI interactions
- ๐ฎ Futuristic dashboard effects
npm install z-proximity-engine gsap @gsap/reactnpm install react@^18.0.0 react-dom@^18.0.0 gsap@^3.15.0 @gsap/react@^2.1.2import { Proximity } from 'z-proximity-engine';
export const HoverCards = () => (
<Proximity preset="scale-blur" reach={2}>
<div className="prox-item">Card 1</div>
<div className="prox-item">Card 2</div>
<div className="prox-item">Card 3</div>
</Proximity>
);import { ProximityText } from 'z-proximity-engine';
export const Hero = () => (
<ProximityText
text="HOVER ME"
preset="scale-opacity-cipher"
splitBy="letter"
reach={1.5}
/>
);export const Features = () => (
<Proximity
mode="scroll"
preset="reveal-opacity"
config={{
scroll: { start: "top 90%", once: true },
stagger: 0.2
}}
>
<div className="prox-item">Feature 1</div>
<div className="prox-item">Feature 2</div>
</Proximity>
);scale | flexScale | x | y | rotate | skew
opacity | blur | reveal | glow | brightness
magnetic | repel | tilt | tiltCard
weight | cipher | letterSpacing | color
preset="scale-blur-magnetic-opacity"<Proximity
nearestPreset="scale-magnetic" // Closest icon grows & pulls
neighborPreset="repel" // Others push away
config={{ reach: 2.5, lockAxis: 'x' }}
>
{icons.map(icon => (
<div key={icon} className="prox-item dock-icon">
{icon}
</div>
))}
</Proximity><ProximityText
text="CLASSIFIED"
preset="cipher-scale"
config={{
cipher: [0, 1], // Scrambled โ Clear
reach: 2
}}
/><Proximity preset="magnetic-scale" reach={1.5}>
<button className="prox-item">Click Me</button>
</Proximity>| Metric | Value |
|---|---|
| Core Bundle Size | 10KB (gzipped) |
| First Contentful Paint | < 1s |
| Time to Interactive | < 1.5s |
| Animation FPS | 120+ |
| Supported Elements | 100+ simultaneous |
| Prop | Type | Default | Description |
|---|---|---|---|
preset |
string |
- | Chain effects with dashes |
reach |
number |
2 |
Influence radius |
falloff |
number |
2.4 |
Curve steepness |
duration |
number |
0.2 |
Animation speed |
ease |
string |
"power1.out" |
GSAP easing |
mode |
"pointer" | "scroll" |
"pointer" |
Trigger type |
- โ Chrome 90+
- โ Firefox 88+
- โ Safari 14+
- โ Edge 90+
- โ Mobile browsers (iOS Safari, Chrome Mobile)
Contributions welcome! Please read our Contributing Guide.
- Fork the repo
- Create your feature branch (
git checkout -b feature/amazing-preset) - Commit your changes (
git commit -m 'Add amazing preset') - Push to the branch (
git push origin feature/amazing-preset) - Open a Pull Request
MIT ยฉ Youssef Zidan
- ๐ Official Website
- ๐ฆ NPM Package
- ๐ฌ GitHub Discussions
- ๐ Issue Tracker
- ๐จโ๐ป Author Portfolio
- ๐ผ LinkedIn
| Feature | ZProximity | Framer Motion | React Spring |
|---|---|---|---|
| Proximity Detection | โ Built-in | โ Manual | โ Manual |
| Bundle Size | 10.7KB | ~50KB | ~15KB |
| GSAP Integration | โ Native | โ No | |
| Scroll Animations | โ Built-in | โ Built-in | |
| TypeScript | โ Full | โ Full | โ Full |
| Learning Curve | โญโญ | โญโญโญโญ | โญโญโญโญโญ |
Made with โก by Youssef Zidan
If this library helped you, please โญ star the repo!
react animation, proximity detection, magnetic cursor, hover effects, scroll animations, gsap react, motion design, interactive ui, spatial interactions, cursor effects, animation library, react gsap, framer motion alternative, react spring alternative, proximity-based animations, distance-based effects