Skip to content

Commit

Permalink
Rewrite README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
saketi0906 committed Sep 14, 2019
1 parent fcba23b commit 9e26c89
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
node_modules
node_modules
playground
1 change: 0 additions & 1 deletion dist/plain-scroll.min.esm.js

This file was deleted.

30 changes: 22 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
Simple and minimal size scroll library.
Simple and lightweight size scroll library.

# Installing
~~~
npm install plainScroll
~~~

# Usage
PlainScroll is easy to usage. Insert the following code into your project.
PlainScroll is simple to usage. Insert the following code into your project.
~~~
import PlainScroll from 'plainScroll';
~~~
Next, create a instance. You can set options at the same time. Each default parameter has a trigger of 'plainScroll' as class name to start scrolling, duration of 1000 milliseconds as time at animation, easing of 'easeOut' as animation effect, you can set either for 'linear', 'easeIn', 'easeOut', 'easeInOut'.
Next, create a instance.
~~~
new PlainScroll();
// or set option
new PlainScroll({
trigger: 'plainScroll',
trigger: '.plain-scroll',
duration: 1000,
easing: 'easeOut'
onScrollStart: () => console.log('start'),
onScrollEnd: () => console.log('end')
});
~~~
Finally, attach the trigger name to anchor tag,
prepare the element you want to scroll.
~~~
<a href="#moveto" class="plainScroll">
<div id="moveto"></div>
<a href="#to" class="plain-scroll">
<div id="to"></div>
~~~

# Option
You can set options at the same time you create an instance.
## trigger
Class name for starting scrolling, set to anchor tag.
Default set is '.plain-scroll'.
## duration
It is time to scroll to the destination. Default set is 1000 milliseconds.
## easing
Add inertia to the scroll. You can set either for 'linear', 'easeIn', 'easeOut', 'easeInOut'. Default set is 'easeOut'.
## callback
You can run any function at start and end of scroll.

# Support Borwser
Support for stable version in the modern browsers and Internet Explorer 11.
- Chrome
- Firefox
- Safari
- Internet Explorer 11
- Edge
- Internet Explorer 11

# License
MIT @darumock
4 changes: 0 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ export default () => {
file: 'dist/plain-scroll.min.js',
name: 'PlainScroll',
format: 'umd'
},
{
file: 'dist/plain-scroll.min.esm.js',
format: 'esm'
}
],
plugins: [
Expand Down

0 comments on commit 9e26c89

Please sign in to comment.