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

@internetguru/scrolltopable

v0.4.0

Published

Scrolltopable is a JavaScript module that provides ultimate scroll-to-top functionality. No dependencies and frameworks, pure JavaScript!

Downloads

42

Readme

GitHub Workflow Status GitHub npm GitHub file size in bytes

Scrolltopable

Scrolltopable is a JavaScript module that provides ultimate scroll-to-top functionality. No dependencies and frameworks, pure JavaScript!

See our demo.

Simple Usage

<head>
  <!-- include basic css -->
  <link rel="stylesheet" type="text/css" href="https://unpkg.com/@internetguru/scrolltopable@latest/basic.css"/>
  <!-- include scrolltopable -->
  <script type="module" src="https://unpkg.com/@internetguru/scrolltopable@latest/index.min.js"></script>
  <!-- initialization with modifying default options -->
  <script type="module">
    import { Scrolltopable } from './index.min.js'
    Scrolltopable.init({
      text: '⌃',
      hideTop: 0,
    })
  </script>
</head>

Note: you can install package locally by running npm i @internetguru/scrolltopable --save.

Options

|Configuration name|Default value|Description| |------------------|-------------|-----------| |Config.text | ^ | Text or HTML to be inserted into main element | |Config.title | Top | Button title | |Config.hideTop | 500 | Position in px from the top of the page where button will be hidden | |Config.showBottom | 500 | Position in from the bottom of the page where button will be shown | |Config.deltaUpShow | 200 | Scroll up delta in px which show button | |Config.deltaDownHide | 200 | Scroll down delta in px which hide button | |Config.activeTimeout | 0 | For how long time in ms button should have activeClass and be visible after click on button | |Config.scrollActionTimeout | 200 | For how long should be processing scroll delayed after stop scrolling | |Config.ns | js-scrolltopable | Button id and prefix for classes | |Config.extraClass | noprint | Button extra class(es) | |Config.visibleClass | ${Config.ns}--visible | Class for visible button | |Config.activeClass | ${Config.ns}--active | Class for active button (activeTimeout > 0) |

Maintainers

Contributing

Pull requests are welcome, don't hesitate to contribute.

Donation

If you find this program useful, please send a donation to its developers to support their work. If you use this program at your workplace, please suggest that the company make a donation. We appreciate contributions of any size. Donations enable us to spend more time working on this package, and help cover our infrastructure expenses.

If you’d like to make a donation of any value, please send it to the following PayPal address:

PayPal Donation

Since we aren’t a tax-exempt organization, we can’t offer you a tax deduction. But for all donations over 50 USD, we’d be happy to recognize your contribution on this README file for the next release.

We are also happy to consider making particular improvements or changes, or giving specific technical assistance, in return for a substantial donation over 100 USD. If you would like to discuss this possibility, write us at [email protected].

Another possibility is to pay a software maintenance fee. Again, write us about this at [email protected] to discuss how much you want to pay and how much maintenance we can offer in return.

Thanks for your support!

License

MIT License