Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/filipchalupa/eased-scroll
https://github.com/filipchalupa/eased-scroll
Last synced: about 14 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/filipchalupa/eased-scroll
- Owner: FilipChalupa
- Created: 2020-09-04T13:05:55.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-13T12:53:29.000Z (over 2 years ago)
- Last Synced: 2024-10-31T17:52:25.107Z (7 days ago)
- Language: HTML
- Homepage: https://filipchalupa.cz/eased-scroll/demo.html
- Size: 563 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Eased scroll [![npm](https://img.shields.io/npm/v/eased-scroll.svg)](https://www.npmjs.com/package/eased-scroll) [![Dependencies](https://img.shields.io/david/FilipChalupa/eased-scroll.svg)](https://www.npmjs.com/package/eased-scroll?activeTab=dependencies) ![npm type definitions](https://img.shields.io/npm/types/eased-scroll.svg)
Listen to eased window scroll. [Demo](https://filipchalupa.cz/eased-scroll/demo.html).
![UI example](https://raw.githubusercontent.com/FilipChalupa/eased-scroll/main/screencast.gif)
## Installation
```bash
npm install eased-scroll
```## How to use
### JavaScript:
```javascript
import { easedScroll } from 'eased-scroll'easedScroll(200).addListener((value) => {
console.log('Actual value', window.scrollY)
console.log('Smooth value', value)
})
```For more advanced cases you can use methods `removeListener` and `getValue` too.