# @bornfight/b-scroll-to

> Bornfight Studio frontend micro lib for smooth scrolling

Latest version **1.0.4** (published 2024-08-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bornfight/b-scroll-to
pnpm add @bornfight/b-scroll-to
yarn add @bornfight/b-scroll-to
bun add @bornfight/b-scroll-to
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2024-08-30 |
| First published | 2020-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.16.1 |
| Dependencies | 1 |
| Unpacked size | 9.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | BORNFIGHT STUDIO® |
| Maintainers | ibrcko, degordian-dev, mario.loncarek, tjezidzic, jurajuki, maroje |
| Keywords | smooth, scroll, scroll-to |

## Links

- npm: https://www.npmjs.com/package/@bornfight/b-scroll-to
- Repository: https://github.com/bornfight-studio/b-scroll-to
- Homepage: https://github.com/bornfight-studio/b-scroll-to#readme
- Issues: https://github.com/bornfight-studio/b-scroll-to/issues
- npm.io page: https://npm.io/package/@bornfight/b-scroll-to

## Dependencies (1)

- [gsap](https://npm.io/package/gsap.md) ^3.2.6

## Recent versions

- 1.0.4 (latest) — 2024-08-30
- 1.0.3 — 2024-08-30
- 1.0.2 — 2020-07-01
- 1.0.1 — 2020-06-01
- 1.0.0 — 2020-05-29

## README

<a href="https://www.bornfight.studio/">
<img width="84px" src="https://www.bornfight.com/wp-content/themes/bf/static/ui/BF-sign-dark.svg?" title="Bornfight" alt="Bornfight">
</a>

# b-scroll-to [[all b- libs](https://github.com/bornfight-studio/b-lib-archive/)]
> Bornfight Studio frontend micro lib for smooth scrolling

![GitHub package.json version](https://img.shields.io/github/package-json/v/bornfight-studio/b-scroll-to?style=flat-square)
![GitHub package.json dynamic](https://img.shields.io/github/package-json/keywords/bornfight-studio/b-scroll-to?style=flat-square)
![GitHub issues](https://img.shields.io/github/issues/bornfight-studio/b-scroll-to?style=flat-square)
![GitHub](https://img.shields.io/github/license/bornfight-studio/b-scroll-to?style=flat-square)


## 📦 Getting Started

Dependency: `gsap`

- install `b-scroll-to` trough __npm__ or pull ti from git

```
npm i @bornfight/b-scroll-to
```

- include b-scroll-to to your __JS__ after running __npm install__

## 🔨️ Usage 
###### JS
``` JS
import ScrollTo from "@bornfight/b-scroll-to";

new ScrollTo();
```

##### HTML markup

```HTML
<a href="" data-scroll-to="#target" data-offset="100">
    Scroll to target
</a>
```

##### Basic usage tips
- `data-scroll-to` can be id or class of target element
- `data-offset` is type number with value in pixels
     
## 💎 Customization

```JS
new ScrollTo({
    ease: 'expo.out',
    duration: 5
});
```

## ✅ Properties

Option | Type | Default | Example | Description
------ | ---- | ------- | ------- | -----------
ease | string | "power3.inOut" | "expo.out" | Scroll ease can be modified (gsap eases) 
duration | number | 1 | 10 | Duration of the scroll in seconds 
   
### 📦 Contribute

#### Gulp based system 
 - [Gulp](https://gulpjs.com/) 4 used
 - [browsersync](https://browsersync.io/) for live reload
 
```bash
npm run dev - dev environent with browsersync
```

## License

MIT © [Bornfight Studio](https://www.bornfight.studio/)

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