npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

scrolleo

v1.6.3

Published

A new scroll library to make it easy to integrate smoooooth scroll

Downloads

33

Readme

Scrolleo

A new and easy way to have a smooth scroll in your website

Installation

npm install scrolleo

Usage

A basic smooth scroll with default settings

First you need to import it inside your node project

import { Scrolleo } from 'scrolleo';

Javascript

const scrolleo = new Scrolleo({
	container: 'your-element',
});
scrolleo.init();

Typescript

const scrolleo = new Scrolleo({
	container: 'your-element',
});
scrolleo.init();

Instance options

| Option | Type | Default | Description | | ------------------ | --------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | containe | string | | The Scroll container query selector string | | ease | string | cubic-bezier(0.19,0.57,0.51,0.99) | An easing method for the scroll 'animation' WARNING: Will remove other transition from the element | | direction | string | vertical | The scroll direction vertical or horizontal only | | smoothness | number | 0.25 | The smoothness of the scroll, the higher the number the smoother the scroll | | draggable | boolean | false | If we can drag to scroll | | dragSpeed | number | 1 | The drag speed. Eg. A drag speed of 2 would mean that for every pixel dragged, the element get scrolled 2 pixels | | throttle | boolean | true | If the scroll is throttled so the user can't scroll for a specfic delay (great for Apple Magic Mouse and infinite wheel) | | throttleDelay | number | 100 | The delay in milliseconds for which the user can't scroll | | scrollPercentage | number | 20 | The percentage of the window that gets scrolled each time | | offsetBottom | number | 0 | The percentage of the window to remove at the end of the scroll | | elementsToScroll | Array<HTMLElements> | null | The elements to scroll, if null will be the direct children of the container. | | globalScroll | boolean | false | If the scroll listener is set globally, so to the whole window (default: false) |

Instance methods

| Method | Description | Arguments | | ----------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | init() | Initialize the scroll | | | destroy() | Destroy all the scroll events | | | scroll() | Scroll a specific percentage of the window | percentage The amount you want to scroll, must be a number | | scrollTo() | Scroll to a specified element | element The element to scroll to, must be an HTMLElement options The options to the scroll : align If the element to scroll to should be at the end or at the start of the window (relative to the scroll direction), must be either start or endmargin The percentage of the window to let between the screen border and the element, must be a number | | isInit() | Check wheter Scrolleo was initialized or not | | | getMaxScroll() | Return the calculated max scroll | | | getScrollContainer() | Returns the scroll container | | | getScrolledElements() | Returns the elements that will be scrolled | | | getCurrentScroll() | Returns the current scroll for each scrolled elements | |