You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate physics based css-keyframe animations for the css-in-js solution of your choice or plain css.
8
+
#### Generate physics based css keyframe animation objects or strings for the css-in-js solution of your choice.
9
+
##### Works with simple numeric css properties (with units or without), combined properties such as padding and rgb hex colors. Eliminates duplicate values and unused keyframes to optimize animation size.
10
+
11
+
#### *~3kb gzipped.*
9
12
10
13
<table>
11
14
<tr>
@@ -94,27 +97,20 @@ This method creates spring-based keyframes. Called with `startProp` and `targetP
94
97
reflecting the starting and ending properties of the animation, it returns an object with the
95
98
interpolated animation values.
96
99
97
-
The following properties in both the `startProp` and `endProp` objects are ignored when
98
-
calculating the animation:
99
-
100
-
- properties that do not exist in both arguments
101
-
- properties that have non-numeric values
102
-
- properties with units that differ between both arguments
103
-
104
100
#### Arguments
105
101
106
102
-`startProps` (_Object_): The start properties for the animation.<br>
Redundant values and empty keyframes are removed to optimize the size of the resulting css. There is simply no point in having a `margin-left` value of`'250px'`in every keyframe ranging from 88% to 100%.
142
+
145
143
### `toString(keyframes, formatter)`
146
144
147
145
This method takes the return value of`spring` and converts it to a css string.
@@ -192,7 +190,7 @@ This would net you the following css:
192
190
193
191
There's a lot of ideas floating in my head that could make working with **css-spring** easier. Some of these are:
194
192
195
-
- allowing the interpolation of array values like margins, paddings or translates ([#1](/../../issues/1))
196
-
- color interpolation ([#3](/../../issues/3))
193
+
- adding a plugin system to use things such as autoprefixer or cssnano minification ([#8](/../../issues/8))
194
+
- a commandline to generate spring keyframe animations for usage in your css files ([#4](/../../issues/4))
197
195
198
196
Feel free to contribute with your own issues and ideas, your thoughts on the ones listed above, example documentation for usage with other css-in-js frameworks or pull requests for features/improvements you'd like to see.
0 commit comments