mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
568 B
29 lines
568 B
6 years ago
|
<script>
|
||
|
import { tweened } from 'svelte/motion';
|
||
|
import { cubicOut } from 'svelte/easing';
|
||
|
|
||
|
const progress = tweened(0, {
|
||
|
duration: 400,
|
||
|
easing: cubicOut
|
||
|
});
|
||
|
</script>
|
||
|
|
||
1 year ago
|
<progress value={$progress} />
|
||
6 years ago
|
|
||
1 year ago
|
<button on:click={() => progress.set(0)}> 0% </button>
|
||
6 years ago
|
|
||
1 year ago
|
<button on:click={() => progress.set(0.25)}> 25% </button>
|
||
6 years ago
|
|
||
1 year ago
|
<button on:click={() => progress.set(0.5)}> 50% </button>
|
||
6 years ago
|
|
||
1 year ago
|
<button on:click={() => progress.set(0.75)}> 75% </button>
|
||
6 years ago
|
|
||
1 year ago
|
<button on:click={() => progress.set(1)}> 100% </button>
|
||
4 years ago
|
|
||
|
<style>
|
||
|
progress {
|
||
|
display: block;
|
||
|
width: 100%;
|
||
|
}
|
||
1 year ago
|
</style>
|