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

watnotif

v1.1.0

Published

a pure JS & CSS stackable notifications plugin, with configurable timer, 'keep-on-hover' and 'close' built-in functionalities.

Downloads

32

Readme

WatNotif.js

WatNotif is an elegant pure JS & CSS stackable notifications plugin with configurable timer, keep-on-hover and close built-in functionalities.

See Plugin's website

See demos

COMING SOON List

  • ~~Put at least a few demo/examples~~ [Done!]
  • ~~Add a few more themes~~ [Done!]
  • ~~Make this page prettier~~ [Done!]
  • ~~Add SASS files~~ [Done!]
  • Add note on browser compatibility
  • Create a module for notification center

To get WatNotif, download this repository from Github OR use bower

bower install watnotif

1. Include the stylesheet you want in the HTML head of the page.

Example:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    
    <!-- the Notif stylesheet you choosed -->
    <link rel="stylesheet" type="text/css" href="/dist/css/<style you want>/<file you want>.min.css" />
    
    <!-- your own stylesheets -->
  </head>
  <body>
  <!-- your body -->
  </body>
</html>

Note: There are different stylesheets, based on :

  • horizontal positioning
  • vertical positioning
  • animation & transition

You have to include only one of them depending on how you want to display the notifications on your website.

2. Include the javascript at the end of the body.

Example:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <!-- your meta, styles, favico, and so on -->
  </head>
  <body>
  <!-- your body -->
  
  <!-- the Notif plugin script -->
  <script type="text/javascript" src="/dist/js/watnotif-1.0.min.js"></script>
  </body>
</html>

3. Set the general settings for all of your notifications (duration in milliseconds)

This is optional as there is a default value and the duration is manageable through the .display(duration) method.

If you set the duration value to less than 1 millisecond, it won't be dismissed automatically

**Example: **

document.addEventListener('DOMContentLoaded', function() { // make sure the DOM is fully loaded before starting anything
  Notif.setWrapperOptions({ duration: 4000 });
}, false);

4. Define notifications

**Examples: **

var successNotif = new Notif("Yay, this message notifies you about the success of whatever!", "success");
var errorNotif = new Notif("Oups, this is a notification you usually hope to not display.", "error");
var confirmedNotif = new Notif("Let's just confirm that whatever happened.", "confirmed");
var defaultNotif = new Notif("This message is just meant to say hi; so \"hi!\"", "default");

5. Bind the notifications to something.

<!-- in your HTML body -->
<button id="my-button">Gimme my notif</button>
// In your own javascript
var myNotif = new Notif('Hey, what about this very nice notification, with a <a href="#">link</a> and everything?', "default");
document.getElementById('my-button').addEventListener('click', function(e) {
  myNotif.display(3500);
  /* You could also chain everything if it's a one time notification, such as:
   * new Notif('This is a one time notification, so no need to keep it in a JS variable.', "confirmed").display(4000);
   */
});