Merge branch 'master' into gh-2194

pull/2432/head
Rich Harris 6 years ago
commit 3ef12fc159

@ -1,6 +1,6 @@
{ {
"name": "svelte", "name": "svelte",
"version": "3.0.0-beta.25", "version": "3.0.0-beta.26",
"description": "The magical disappearing UI framework", "description": "The magical disappearing UI framework",
"module": "index.mjs", "module": "index.mjs",
"main": "index", "main": "index",

@ -122,8 +122,8 @@ export function draw(node, {
} }
export function crossfade({ fallback, ...defaults }) { export function crossfade({ fallback, ...defaults }) {
let to_receive = new Map(); const to_receive = new Map();
let to_send = new Map(); const to_send = new Map();
function crossfade(from, node, params) { function crossfade(from, node, params) {
const { const {
@ -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