A vanilla smooth-scrolling javascript plugin with no dependencies.
Features
- Blazing fast. (Using scrollIntoView)
- Lightweight.
- No dependencies.
Demo
Example page on codepen (temporary), check the pen here.
Install
# Using npmnpm install smoothie-js# Using yarnyarn add smoothie-js
Now include smoothie and you should be good to go.
// es6// commonjsconst smoothie = ;
Alternatively you can include a minified version of smoothie (or the source code, up to you) via direct file or using our CDN link.
Usage
Add data-smoothie
to your anchor tags and the target's id
in the href value as it follows below.
...<!-- Somewhere below -->...
Call smoothie's function anywhere in your code:
// Call me;
Configuring
To configure the plugin pass the desired option(s) as an object like the example below:
// Pass options like this;
Running Tasks
You can run tasks with yarn
or npm
shorthands using the following commands:
# Build task$ yarn build# etc.$ ...
Browser Support
You can check the browsers supported here.
If your browser is not in the list consider using a polyfill.
Roadmap
Todo List
- Make a better example page.
- Add polyfill to non-supported browsers.
- Add options to the plugin.
- Refactor to remove bad code practices.
Legend: Checked boxes mean partial completion, checked and crossed items mean they're fully working.
Contributing
If you feel like smoothie is missed something please do send a message or, alternatively make a pull request or even open an issue using an appropriate label and we will go from there.
License
Code released under the MIT license.