Tween moves a value to its target over a fixed duration.
Change target when a todo is completed.
Read current to display the animated value.
<script>
import { Tween } from 'svelte/motion';
const progress = new Tween(0, { duration: 300 });
function completeTodo() {
progress.target = Math.min(progress.target + 25, 100);
}
</script>
<progress max="100" value={progress.current}></progress>
<button onclick={completeTodo}>Complete a todo</button>