@bornfight/b-scroll-to

    1.0.2 • Public • Published
    Bornfight

    b-scroll-to [all b- libs]

    Bornfight frontend micro lib for smooth scrolling

    GitHub package.json version GitHub package.json dynamic GitHub issues GitHub

    📦 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
    import ScrollTo from "@bornfight/b-scroll-to";
     
    new ScrollTo();
    HTML markup
    <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

    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

    npm run dev - dev environent with browsersync

    License

    MIT © Bornfight

    Install

    npm i @bornfight/b-scroll-to

    DownloadsWeekly Downloads

    4

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    9.92 kB

    Total Files

    9

    Last publish

    Collaborators

    • antonio.preucil
    • ilesar
    • maroje
    • degordian-dev
    • mario.loncarek
    • tjezidzic
    • shockwavee
    • jurajuki
    • ddrempe