-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: Not clear when sats paid to merit holders increases
Solution: Added NumberIncrement for animated numeric updates in MeritsAndSatflow.svelte and enhanced PayNow.svelte to animate intermediate payment states. Fixes #84
- Loading branch information
1 parent
ca583ae
commit fb0d051
Showing
4 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import NumberIncrement from './number-increment.svelte'; | ||
|
||
export default NumberIncrement; |
28 changes: 28 additions & 0 deletions
28
src/lib/components/ui/number-increment/number-increment.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte'; | ||
import { cubicOut } from 'svelte/easing'; | ||
import { tweened } from 'svelte/motion'; | ||
export let targetValue: number; | ||
let currentValue = tweened(0, { duration: 1000, easing: cubicOut }); | ||
// Re-trigger animation whenever targetValue changes | ||
$: if (targetValue !== undefined && targetValue !== null) { | ||
currentValue.set(targetValue); | ||
} | ||
onMount(() => { | ||
currentValue.set(targetValue); | ||
}); | ||
</script> | ||
|
||
<span class="merits">{$currentValue.toFixed(0)}</span> | ||
|
||
<style> | ||
.merits { | ||
transition: | ||
transform 0.5s ease-in-out, | ||
opacity 0.5s ease-in-out; | ||
} | ||
</style> |