Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bhallstein/tiny-scrollto
Tiny 0.4kB animated scroll helper
https://github.com/bhallstein/tiny-scrollto
Last synced: about 2 months ago
JSON representation
Tiny 0.4kB animated scroll helper
- Host: GitHub
- URL: https://github.com/bhallstein/tiny-scrollto
- Owner: bhallstein
- Created: 2021-09-29T12:15:02.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-31T12:13:36.000Z (about 1 year ago)
- Last Synced: 2024-11-08T18:53:53.600Z (2 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# tiny-scrollto
Animate DOM scrolling. 0.4kB, zero dependencies.
**Install:**
```js
npm install -S tiny-scrollto
```**Use:**
```js
import {scroll} from 'tiny-scrollto'scroll(500)
scroll('end') // Scroll to end of document
````tiny-scrollto` also exports a `clamp` utility function:
```js
import {clamp} from 'tiny-scrollto'const x = clamp(x, 0, 1) // Clamp x to the range 0-1
```