JSPM

@marlospomin/smoothie

1.0.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q27705F
  • License MIT

A vanilla smooth-scrolling javascript plugin with no dependencies.

Package Exports

  • @marlospomin/smoothie

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@marlospomin/smoothie) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Smoothie Build Status

A vanilla smooth-scrolling JavaScript plugin with no dependencies.

Features

Demo

Example page on CodePen.

Install

# Using npm
npm install @marlospomin/smoothie

# Using yarn
yarn add @marlospomin/smoothie

Now include smoothie in your project and you should be good to go.

// es6
import smoothie from '@marlospomin/smoothie'

// commonjs
const smoothie = require('@marlospomin/smoothie')

Usage

Add data-smoothie to your anchor tags and the target's id in the href value as it follows below.

<a data-smoothie href="#example">...</a>

<!-- Somewhere below -->

<section id="example">
  ...
</section>

Call smoothie anywhere in your code:

// Call me
smoothie()

Configuring

To configure the plugin just pass the desired option(s) as an object like the example below:

// Pass options like this
smoothie({
  behavior: 'auto'
})

Running Tasks

You can run tasks with the yarn command like the example below:

# Build task
yarn build

# Lint task
yarn lint

Browser Support

You can check the browser support here.

If your desired browser is not in the list consider using this polyfill.

Contributing

Contributing is really easy, just make a pull request or open an issue and we will go from there.

License

Code released under the MIT license.