Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joshnuss/svelte-animation-store


https://github.com/joshnuss/svelte-animation-store

animation svelte

Last synced: 24 days ago
JSON representation

Awesome Lists containing this project

README

        

Svelte Animation Store
---------------

A store that is based on Svelte's [tweened store](https://svelte.dev/docs#tweened), with some additional functionality:

- `pause()`: freeze the store at the current value.
- `reset()`: resets the store's value back to the last set point.
- `continue()`: play on from a paused state.
- `reverse()`: play in reverse.
- `replay()`: go back to start, and play to last set point.
- `accelerate(speed)`: adjust the speed of the animation.

Functionality inherited from `writable()`:

- `set(value)`: works the same as a `writable` store.
- `update(callback)`: works the same as a `writable` store.
- `subscribe(callback)`: works the same as a `writable` store.

## [Demo](https://svelte.dev/repl/9751df15d22245f691a1cf3a30c3b7b4?version=3.35.0)

## License

MIT