From 738f546d1538619b39905696224dd7c32b6d7f58 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sat, 13 Apr 2019 15:38:52 -0400 Subject: [PATCH] fix opacities --- transition.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/transition.mjs b/transition.mjs index 2421b1cd72..d8dd5ca345 100644 --- a/transition.mjs +++ b/transition.mjs @@ -25,15 +25,15 @@ export function fly(node, { const target_opacity = +style.opacity; const transform = style.transform === 'none' ? '' : style.transform; - const od = target_opacity - opacity; + const od = target_opacity * (1 - opacity); return { delay, duration, easing, - css: t => ` + css: (t, u) => ` transform: ${transform} translate(${(1 - t) * x}px, ${(1 - t) * y}px); - opacity: ${1 - (od * u)}` + opacity: ${target_opacity - (od * u)}` }; } @@ -81,7 +81,7 @@ export function scale(node, { const transform = style.transform === 'none' ? '' : style.transform; const sd = 1 - start; - const od = target_opacity - opacity; + const od = target_opacity * (1 - opacity); return { delay, @@ -89,7 +89,7 @@ export function scale(node, { easing, css: (t, u) => ` transform: ${transform} scale(${1 - (sd * u)}); - opacity: ${1 - (od * u)} + opacity: ${target_opacity - (od * u)} ` }; }