@penner/responsive-easing 0.0.2 → 0.0.4
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/README.md +11 -8
- package/package.json +28 -14
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> Context-aware easing functions for smooth, perceptually coherent motion across responsive UIs.
|
|
4
4
|
|
|
5
|
-
[!
|
|
5
|
+
> [!WARNING] > **🚧 Work in Progress** - This package is currently under active development. The API shown in this README is aspirational and not yet implemented. Please check back later for the actual release!
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@penner/responsive-easing)
|
|
6
8
|
|
|
7
9
|
Responsive Easing adapts motion curves to real-world context—distance, time, and velocity—so animations feel smooth and natural across screen sizes, layouts, and motion segments.
|
|
8
10
|
|
|
@@ -13,6 +15,7 @@ Responsive Easing adapts motion curves to real-world context—distance, time, a
|
|
|
13
15
|
Most easing functions assume a fixed range of motion from 0 to 1. But UI elements don’t always move the same distance or take the same time.
|
|
14
16
|
|
|
15
17
|
This leads to:
|
|
18
|
+
|
|
16
19
|
- Motion that feels too fast on large screens
|
|
17
20
|
- Overshoots that don’t scale properly
|
|
18
21
|
- Janky joins between motion segments
|
|
@@ -25,13 +28,13 @@ This leads to:
|
|
|
25
28
|
## 🚀 Install
|
|
26
29
|
|
|
27
30
|
```bash
|
|
28
|
-
npm install responsive-easing
|
|
31
|
+
npm install @penner/responsive-easing
|
|
29
32
|
```
|
|
30
33
|
|
|
31
34
|
Or with Yarn:
|
|
32
35
|
|
|
33
36
|
```bash
|
|
34
|
-
yarn add responsive-easing
|
|
37
|
+
yarn add @penner/@penner/responsive-easing
|
|
35
38
|
```
|
|
36
39
|
|
|
37
40
|
---
|
|
@@ -39,11 +42,11 @@ yarn add responsive-easing
|
|
|
39
42
|
## 🧪 Basic Usage
|
|
40
43
|
|
|
41
44
|
```ts
|
|
42
|
-
import { createResponsiveEasing } from 'responsive-easing';
|
|
45
|
+
import { createResponsiveEasing } from '@penner/responsive-easing';
|
|
43
46
|
|
|
44
47
|
const easing = createResponsiveEasing({
|
|
45
|
-
distance: 400,
|
|
46
|
-
duration: 600,
|
|
48
|
+
distance: 400, // in pixels
|
|
49
|
+
duration: 600, // in milliseconds
|
|
47
50
|
overshoot: true,
|
|
48
51
|
});
|
|
49
52
|
|
|
@@ -53,7 +56,7 @@ const y = easing(0.5); // evaluates easing at halfway point
|
|
|
53
56
|
Or generate a CSS timing string:
|
|
54
57
|
|
|
55
58
|
```ts
|
|
56
|
-
import { easingToCssLinear } from 'responsive-easing';
|
|
59
|
+
import { easingToCssLinear } from '@penner/responsive-easing';
|
|
57
60
|
|
|
58
61
|
const linearString = easingToCssLinear(easing);
|
|
59
62
|
// → linear(0 0, 0.2 0.1, 0.5 0.7, 1 1)
|
|
@@ -100,7 +103,7 @@ Responsive Easing treats motion as a first-class design element—one that shoul
|
|
|
100
103
|
|
|
101
104
|
Have an idea? Find a bug? Want to shape the future of motion?
|
|
102
105
|
|
|
103
|
-
[Open an issue](https://github.com/
|
|
106
|
+
[Open an issue](https://github.com/robertpenner/responsive-easing/issues) or [start a discussion](https://github.com/robertpenner/responsive-easing/discussions).
|
|
104
107
|
|
|
105
108
|
---
|
|
106
109
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@penner/responsive-easing",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Responsive Easing is a library that dynamically generates easing functions for motion design that intelligently responds to varying conditions.",
|
|
5
5
|
"author": "Robert Penner <robert@robertpenner.com> (https://robertpenner.com)",
|
|
6
6
|
"homepage": "https://github.com/robertpenner/responsive-easing",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"types": "dist/index.d.ts",
|
|
25
25
|
"type": "module",
|
|
26
26
|
"files": [
|
|
27
|
-
"
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
28
29
|
],
|
|
29
30
|
"scripts": {
|
|
30
31
|
"dev": "tsc && vite build --watch",
|
|
@@ -35,26 +36,20 @@
|
|
|
35
36
|
"lint:styles": "stylelint ./**/*.{css,scss}",
|
|
36
37
|
"format:scripts": "prettier ./src --write",
|
|
37
38
|
"format:styles": "stylelint ./**/*.{css,scss} --fix",
|
|
39
|
+
"format:all": "prettier . --write",
|
|
40
|
+
"lint-staged": "lint-staged",
|
|
38
41
|
"test": "vitest run",
|
|
39
42
|
"test:watch": "vitest",
|
|
40
43
|
"storybook": "storybook dev -p 6006",
|
|
41
44
|
"build-storybook": "storybook build -o storybook-static/storybook",
|
|
42
|
-
"deploy-storybook": "gh-pages -d storybook-static/storybook"
|
|
45
|
+
"deploy-storybook": "gh-pages -d storybook-static/storybook",
|
|
46
|
+
"prepare": "husky"
|
|
43
47
|
},
|
|
44
|
-
"
|
|
48
|
+
"devDependencies": {
|
|
45
49
|
"@chakra-ui/react": "^3.20.0",
|
|
50
|
+
"@chromatic-com/storybook": "^4.0.0",
|
|
46
51
|
"@emotion/react": "^11.14.0",
|
|
47
52
|
"@emotion/styled": "^11.14.0",
|
|
48
|
-
"chart.js": "^4.4.9",
|
|
49
|
-
"framer-motion": "^12.16.0",
|
|
50
|
-
"next-themes": "^0.4.6",
|
|
51
|
-
"react": "^18.3.1",
|
|
52
|
-
"react-chartjs-2": "^5.3.0",
|
|
53
|
-
"react-dom": "^18.3.1",
|
|
54
|
-
"react-icons": "^5.5.0"
|
|
55
|
-
},
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"@chromatic-com/storybook": "^4.0.0",
|
|
58
53
|
"@storybook/addon-a11y": "^9.0.5",
|
|
59
54
|
"@storybook/addon-docs": "^9.0.5",
|
|
60
55
|
"@storybook/addon-onboarding": "^9.0.5",
|
|
@@ -68,19 +63,29 @@
|
|
|
68
63
|
"@vitejs/plugin-react": "^4.3.3",
|
|
69
64
|
"@vitest/browser": "^3.2.2",
|
|
70
65
|
"@vitest/coverage-v8": "^3.2.2",
|
|
66
|
+
"chart.js": "^4.4.9",
|
|
71
67
|
"dts-bundle-generator": "^9.5.1",
|
|
72
68
|
"eslint": "^9.13.0",
|
|
73
69
|
"eslint-config-prettier": "^9.1.0",
|
|
74
70
|
"eslint-plugin-prettier": "^5.2.1",
|
|
75
71
|
"eslint-plugin-storybook": "^9.0.5",
|
|
72
|
+
"framer-motion": "^12.16.0",
|
|
76
73
|
"gh-pages": "^6.3.0",
|
|
74
|
+
"husky": "^9.1.7",
|
|
75
|
+
"lint-staged": "^16.1.2",
|
|
76
|
+
"next-themes": "^0.4.6",
|
|
77
77
|
"playwright": "^1.52.0",
|
|
78
78
|
"prettier": "^3.3.3",
|
|
79
|
+
"react": "^18.3.1",
|
|
80
|
+
"react-chartjs-2": "^5.3.0",
|
|
81
|
+
"react-dom": "^18.3.1",
|
|
82
|
+
"react-icons": "^5.5.0",
|
|
79
83
|
"storybook": "^9.0.5",
|
|
80
84
|
"stylelint": "^16.10.0",
|
|
81
85
|
"stylelint-config-recommended": "^14.0.1",
|
|
82
86
|
"stylelint-config-sass-guidelines": "^12.1.0",
|
|
83
87
|
"tslib": "^2.8.0",
|
|
88
|
+
"tsx": "^4.20.3",
|
|
84
89
|
"typescript": "^5.6.3",
|
|
85
90
|
"vite": "^5.4.10",
|
|
86
91
|
"vite-plugin-dts": "^4.3.0",
|
|
@@ -91,5 +96,14 @@
|
|
|
91
96
|
"extends": [
|
|
92
97
|
"plugin:storybook/recommended"
|
|
93
98
|
]
|
|
99
|
+
},
|
|
100
|
+
"lint-staged": {
|
|
101
|
+
"*.{js,jsx,ts,tsx}": [
|
|
102
|
+
"prettier --write",
|
|
103
|
+
"eslint --fix"
|
|
104
|
+
],
|
|
105
|
+
"*.{css,scss,md,json}": [
|
|
106
|
+
"prettier --write"
|
|
107
|
+
]
|
|
94
108
|
}
|
|
95
109
|
}
|