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

page-scroll-indicator

v3.0.3

Published

Page scroll indicator for the site

Downloads

8

Readme

page-scroll-indicator

The plugin configures the scroll indicator for a page or article. Using this plugin allows your website users to track the number of content remaining on the homepage or in a standalone article.

On the documentation page, you can see the plugin in action, find out browsers support and get more information.

RU DOCUMENTATION:

Plugin documentation in Russian


EN DOCUMENTATION:

Plugin documentation in English


GITHUB:

GITHUB


INSTALL

npm install --save page-scroll-indicator

USAGE

ESM:

import 'page-scroll-indicator';

CommonJS:

require('page-scroll-indicator');

pageScrollIndicator - Plugin entry point. The function takes a single argument as a config file. (Object with settings).

For example:

document.querySelector('.element').pageScrollIndicator({
    zIndex: 100,
    height: 10,
    opacity: 0.5,
    scrollLine: 'bottom',
    backgroundColor: '#6242d2',
    boxShadow: 'white',
    transition: '200ms',
});

element - the target element for which the plugin will act will always be the context of the pageScrollIndicator function call (this). In the example above, it was document.documentElement. If you need to set a scroll indicator for the entire content of the page, you must call it on document.documentElement or document.body. The following example is equivalent to the previous one:

document.body.pageScrollIndicator({
    zIndex: 100,
    height: 8,
    opacity: 1,
    bottom: true,
    scrollLine: 'top',
    backgroundColor: 'pink',
    boxShadow: 'white',
    transition: '200ms',
});

You can use this plugin with jQuery:

$('.element').pageScrollIndicator({
    zIndex: 10,
    height: 7.5,
    opacity: 1,
    scrollLine: 'top',
    backgroundColor: 'blue',
    boxShadow: 'gray',
    transition: '220ms',
});

In the sentences below, the word “element” will refer to the “div” element created by the plugin, which will act as a scroll indicator.

  • zIndex - Element Z offset. Default value - 10000. Type string or number. Any values are allowed, even negative ones. You should be aware that the scroll indicator should take precedence over the stacking context than other elements in the block. Any values from -X to + X are allowed. For example: 10, '10000' или -5000.

  • height - Element height. Default value - 10px. Type string or number. Any value except negative is allowed. Don't make the indicator very high. For example: 15, '7' или 8.5.

  • opacity - Element transparency. Default value - 1. Type string or number. Any value from 0 to 1 is allowed. For example: 1, '0.6' or 0.253.

  • backgroundColor - Element background color. Default value - aqua. Type string. Any correct color value is allowed. For example: 'red', 'green' or #6242d2.

  • boxShadow - Element shadow. Default value - 0 0 5px transparent. Type string. Any correct color value is allowed. For example: 'green', 'green inset' or '#6242d2'. You can only control the color of the shadow. You can specify an inner or outer shadow.

  • transition - Element animation speed. Default value - right 300ms linear. Type string. The following values are allowed: '350ms' or '1s'. You can only control the speed of the animation.

  • bottom - The position of the element on the page. Allowed to be used only to track all content on the website. This means that this value will be ignored if you initialize the plugin for any element other than HTML or BODY. Default value - false. Type boolean. The following values are allowed: true или false.

  • scrollLine - Sets the reference point for the scroll indicator. If "top" is specified, the plugin will wait until the top edge of the element is at the top of the browser window, and only after that the indicator will start its work and finish it, when the bottom edge of the element is at the top of the browser window. If "bottom" is specified, the plugin will not wait until the top edge of the element is at the top of the browser window, it will work as soon as the element appears in the user's field of view, and exits when the bottom edge of the element is in the view of the browser window. The value will have no effect if set on HTML or BODY elements. Default value - bottom. Type string. The following values are allowed: 'top' или 'bottom'.