# simple-scroll

> A simple JS animated scroll thingamajiggy

Latest version **0.1.6** (published 2016-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-scroll
pnpm add simple-scroll
yarn add simple-scroll
bun add simple-scroll
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2016-11-29 |
| First published | 2016-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ragnar Aasen Rognstad |
| Maintainers | rognstadragnar |
| Keywords | animated, scroll |

## Links

- npm: https://www.npmjs.com/package/simple-scroll
- Repository: https://github.com/rognstadragnar/simple-scroll
- Homepage: https://github.com/rognstadragnar/simple-scroll#readme
- Issues: https://github.com/rognstadragnar/simple-scroll/issues
- npm.io page: https://npm.io/package/simple-scroll

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 0.1.6 (latest) — 2016-11-29
- 0.1.5 — 2016-11-29
- 0.1.4 — 2016-11-11
- 0.1.3 — 2016-11-10
- 0.1.2 — 2016-11-10
- 0.1.1 — 2016-11-10
- 0.1.0 — 2016-11-10

## README

![alt text](https://raw.githubusercontent.com/rognstadragnar/simple-scroll/master/logo.png)
Simple smooth, animated scroll thingamajiggy written in ES2015.

### Basic usage
```javascript
var simpleScroll = require('simple-scroll');

simpleScroll.element('myId');
```


### Installation
```
npm install simple-scroll
```

### Features
* Scroll to an element with an optional offset
* Scroll to the bottom or the top off the page
* Scroll a set amount of pixels, viewport height, viewport width or percent
* Set up automatic usage for internal links
* Set the scroll duration and the min/max speed

### Example usage
```javascript
var simpleScroll = require('simple-scroll');


//Required element ID as the first parameter,
//optionally an offset as the second parameter animated
//optionally a third parameter for scroll duration
simpleScroll.element('myId', 20, 100);

//the first parameter (amount) is required, the second (duration) is optional
simpleScroll.px(500, 30); //scrolls 500 pixels down in 30 milliseconds
simpleScroll.vh(5); //scrolls 5 viewport height down
simpleScroll.vw(-5); //scrolls 5 viewport width up
simpleScroll.percent(50); //scrolls 50% of the entire page down

//the first parameter (duration) is optional
simpleScroll.toTop(); //scroll to the top
simpleScroll.toBottom(400); //scroll to the bottom in 400 milliseconds
simpleScroll.internalLinks(); //sets up scrolling for internal links


//Set the settings by passing in an object
simpleScroll.setSettings({
    duration: 100,
    minSpeed: 3,
    maxSpeed: 15
})
//These settings are the default settings
```


### Todo
* Scroll timing functions (e.g. ease, linear, cubic-bezier etc)

If it is of interest, please feel free to contribute on [Github](https://github.com/rognstadragnar/simple-scroll "github")

And yes, I am aware that there are better alternatives already out there. This is mostly my own learning.

---
_Source: https://npm.io/package/simple-scroll · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
