From a829f4d2466ae621b9ebd7e70babcbb0b200fa7e Mon Sep 17 00:00:00 2001 From: Darryl Yeo Date: Sat, 15 Apr 2023 11:48:10 +0900 Subject: [PATCH] : attempt to animate items conditionally --- src/components/EthereumBalances.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/EthereumBalances.svelte b/src/components/EthereumBalances.svelte index dd760354..373ac1ad 100644 --- a/src/components/EthereumBalances.svelte +++ b/src/components/EthereumBalances.svelte @@ -72,6 +72,9 @@ } + $: animate = !showSmallValues && balances.length < 50 + + const tokensAreEqual = (token1, token2) => // token1.name === token2.name && token1.symbol === token2.symbol && @@ -187,8 +190,8 @@ on:click={() => selectedToken = selectedToken?.address === token.address ? undefined : token } - in:scale - animate:flip|local={{duration: filteredBalances.length < 50 ? 500 : 0, delay: 300 * i / filteredBalances.length, easing: quintOut}} + in:scale={{ duration: animate ? 500 : 0 }} + animate:flip|local={{ duration: animate ? 500 : 0, delay: animate ? 300 * i / filteredBalances.length : 0, easing: quintOut }} >