lerper

This is a simple custom smooth scroll plugin.

Usage no npm install needed!

<script type="module">
  import lerper from 'https://cdn.skypack.dev/lerper';
</script>

README

About Lerper.

This is a simple custom smooth scroll plugin.

Installation:

Using NPM:-

npm i --save-dev lerper

Using CDN:-

UNPKG: https://unpkg.com/browse/lerper@1.0.0/dist/lerper.min.js

jsDelivr: https://cdn.jsdelivr.net/npm/lerper@1.0.0/dist/lerper.min.js

Usage:

Starter HTML:

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> Document </title>
</head>
<body>

    <main>
        <div data-scroll>
            .... Your Code Here ....
        </div>
    </main>
    
    <script src="app.js"></script>
</body>
</html>

Starter JS:

import lerper from 'lerper';

const scroll = new lerper({
    lerp: 0.1,
    bar: true
})

Options:

  • lerp: 0.1 (default value is set to 0.1, for the best effect, the range is 0.05 ~ 0.1).
  • bar: true (default is set to true, it takes boolean value to hide the native scrollbar from the browser).