respect starting opacities

pull/2431/head
Rich Harris 6 years ago
parent 67a73cb793
commit cf2b05a917

@ -138,13 +138,14 @@ export function crossfade({ fallback, ...defaults }) {
const style = getComputedStyle(node); const style = getComputedStyle(node);
const transform = style.transform === 'none' ? '' : style.transform; const transform = style.transform === 'none' ? '' : style.transform;
const opacity = +opacity;
return { return {
delay, delay,
duration: is_function(duration) ? duration(d) : duration, duration: is_function(duration) ? duration(d) : duration,
easing, easing,
css: (t, u) => ` css: (t, u) => `
opacity: ${t}; opacity: ${t * opacity};
transform: ${transform} translate(${u * dx}px,${u * dy}px); transform: ${transform} translate(${u * dx}px,${u * dy}px);
` `
}; };

Loading…
Cancel
Save