@drivexstudio/animations 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +125 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 drivex-studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# @drivexstudio/animations
|
|
2
|
+
|
|
3
|
+
Creative text animations and micro-interaction components for React, built on GSAP, Framer Motion, and Lenis.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @drivexstudio/animations
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`react` and `react-dom` (>=18) are peer dependencies — install them in your app if they aren't already.
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
Some components depend on context providers being mounted above them in your app tree. Wrap your root layout once:
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
import {
|
|
19
|
+
LenisProvider,
|
|
20
|
+
PreloaderProvider,
|
|
21
|
+
PageTransitionProvider,
|
|
22
|
+
PageEnterProvider
|
|
23
|
+
} from '@drivexstudio/animations';
|
|
24
|
+
|
|
25
|
+
export default function RootLayout({ children }) {
|
|
26
|
+
return (
|
|
27
|
+
<LenisProvider>
|
|
28
|
+
<PreloaderProvider>
|
|
29
|
+
<PageTransitionProvider>
|
|
30
|
+
<PageEnterProvider>
|
|
31
|
+
{children}
|
|
32
|
+
</PageEnterProvider>
|
|
33
|
+
</PageTransitionProvider>
|
|
34
|
+
</PreloaderProvider>
|
|
35
|
+
</LenisProvider>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
You only need the providers for the features you actually use — e.g. skip `PreloaderProvider` if you don't render `<Preloader />`.
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
### Scramble text on hover
|
|
45
|
+
|
|
46
|
+
```jsx
|
|
47
|
+
import { ScrambleText } from '@drivexstudio/animations';
|
|
48
|
+
|
|
49
|
+
<ScrambleText triggerOnHover duration={0.6}>
|
|
50
|
+
Hover me
|
|
51
|
+
</ScrambleText>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Scroll-triggered headline
|
|
55
|
+
|
|
56
|
+
```jsx
|
|
57
|
+
import { ScrollAnimatedHeadline } from '@drivexstudio/animations';
|
|
58
|
+
|
|
59
|
+
<ScrollAnimatedHeadline
|
|
60
|
+
headline={{ text: 'Built for motion', level: 'h1' }}
|
|
61
|
+
/>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Animated button / link
|
|
65
|
+
|
|
66
|
+
```jsx
|
|
67
|
+
import { AnimatedButton, AnimatedLink } from '@drivexstudio/animations';
|
|
68
|
+
|
|
69
|
+
<AnimatedButton onClick={handleClick}>Get started</AnimatedButton>
|
|
70
|
+
<AnimatedLink href="/work">View work</AnimatedLink>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Scramble multiple elements together
|
|
74
|
+
|
|
75
|
+
```jsx
|
|
76
|
+
import { ScrambleGroup, ScrambleText } from '@drivexstudio/animations';
|
|
77
|
+
|
|
78
|
+
<ScrambleGroup stagger={0.08}>
|
|
79
|
+
<ScrambleText>First line</ScrambleText>
|
|
80
|
+
<ScrambleText>Second line</ScrambleText>
|
|
81
|
+
</ScrambleGroup>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Components
|
|
85
|
+
|
|
86
|
+
| Export | Description |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `ScrambleText` | Character-scramble reveal/hover text effect |
|
|
89
|
+
| `ScrambleGroup` / `useScrambleGroup` | Staggers multiple `ScrambleText` children on scroll or manually |
|
|
90
|
+
| `AnimatedHeadline` | Headline with entrance/scroll animation |
|
|
91
|
+
| `ScrollAnimatedHeadline` | Scroll-triggered wrapper around `AnimatedHeadline` |
|
|
92
|
+
| `AnimatedButton` | Button with built-in micro-interaction |
|
|
93
|
+
| `AnimatedLink` | Link with built-in micro-interaction |
|
|
94
|
+
| `AnimatedProse` / `AnimatedProseContext` / `stagger` | Paragraph-level staggered text reveal |
|
|
95
|
+
| `AnimatedSubtext` | Subtext reveal animation |
|
|
96
|
+
| `AnimatedText` | Generic staggered text animation |
|
|
97
|
+
| `Preloader` | Page preloader, driven by `PreloaderProvider` |
|
|
98
|
+
|
|
99
|
+
## Providers & hooks
|
|
100
|
+
|
|
101
|
+
| Export | Description |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `LenisProvider` / `useLenis` / `scrollToTop` / `getLenis` / `setCssScrollLocked` / `getCssScrollLocked` | Smooth-scroll setup and helpers |
|
|
104
|
+
| `PreloaderProvider` / `usePreloader` | Preloader phase state |
|
|
105
|
+
| `PageTransitionProvider` / `usePageTransitionContext` / `usePageTransition` | Route-transition phase state |
|
|
106
|
+
| `PageEnterProvider` / `usePageEnterContext` / `usePageEnter` | Coordinates staggered "page enter" animations across components |
|
|
107
|
+
| `useIdleGSAP` | Runs a GSAP setup callback during browser idle time |
|
|
108
|
+
| `useAsciiDelay` | Small timing utility |
|
|
109
|
+
| `useDualLayerScramble` | Low-level hook behind `ScrambleText`'s dual-layer effect |
|
|
110
|
+
|
|
111
|
+
## Low-level utilities
|
|
112
|
+
|
|
113
|
+
`gsap`, `useGSAP`, `ScrollTrigger`, `SplitText`, `ScrambleTextPlugin`, `cx`, `cva`, and `easingDefinitionToFunction` are re-exported for consumers who want to build custom animations with the same GSAP plugin setup this package uses internally.
|
|
114
|
+
|
|
115
|
+
## Development
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm install
|
|
119
|
+
npm run build # bundles packages/index.js -> dist/ (ESM + CJS)
|
|
120
|
+
npm run dev # watch mode
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@drivexstudio/animations",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Creative text animations and micro-interaction components for React",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.cjs"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsup",
|
|
21
|
+
"dev": "tsup --watch"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": ">=18",
|
|
25
|
+
"react-dom": ">=18"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@gsap/react": "^2.1.1",
|
|
29
|
+
"@radix-ui/react-slot": "^1.1.0",
|
|
30
|
+
"class-variance-authority": "^0.7.1",
|
|
31
|
+
"framer-motion": "^11.0.0",
|
|
32
|
+
"gsap": "^3.12.5",
|
|
33
|
+
"lenis": "^1.1.13"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"react": "^18.3.1",
|
|
37
|
+
"react-dom": "^18.3.1",
|
|
38
|
+
"tsup": "^8.0.0"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"react",
|
|
42
|
+
"animation",
|
|
43
|
+
"gsap",
|
|
44
|
+
"scroll",
|
|
45
|
+
"lenis",
|
|
46
|
+
"micro-interaction",
|
|
47
|
+
"ui"
|
|
48
|
+
],
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "https://github.com/drivex-studio/components-library"
|
|
53
|
+
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
}
|
|
57
|
+
}
|