react-morpheus 0.1.7 → 0.1.8

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -182,6 +182,7 @@ var sourceContentFade = {
182
182
  duration: 0.12,
183
183
  ease: "easeOut"
184
184
  };
185
+ var sourceReturnDelay = 0.1;
185
186
  var instantTransition = { duration: 0 };
186
187
  var createSourceContentMotion = (spring) => ({
187
188
  opacity: sourceContentFade,
@@ -271,7 +272,13 @@ function getMorphMotionState({
271
272
  ),
272
273
  expandedLayerSize,
273
274
  sourceGrowthScale: getAxisScale(collapsedLayerSize, expandedLayerSize),
274
- sourceOpacityTransition: { ...sourceContentFade },
275
+ sourceOpacityTransition: {
276
+ ...sourceContentFade,
277
+ // On close, the source layer is still being non-uniformly scaled from
278
+ // the target geometry. Keep it transparent until the spring has brought
279
+ // it close enough to its natural proportions to avoid a stretched flash.
280
+ delay: expanded ? 0 : sourceReturnDelay
281
+ },
275
282
  sourcePosition: expanded ? invertPosition(targetPanelPosition) : sourcePanelPosition,
276
283
  sourceTransition: createSourceContentMotion(activeSpring),
277
284
  targetOpacityTransition: { ...contentFade, delay: expanded ? 0.03 : 0 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-morpheus",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "A React component for morphing one surface into other.",
5
5
  "type": "module",
6
6
  "license": "MIT",