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

pushbar.js

v1.0.0

Published

Tiny javascript plugin for creating sliding drawers in web apps

Downloads

126

Readme

☕️ Buy Me A Cofee

Pushbar.js

Pushbar.js is a tiny javascript plugin for creating sliding drawers in web apps It is fully customizable and dependency free.You can use it as sidebar menus or option drawers.

NEW! [ IMPORTANT: USES HAS SLIGNT CHANGE, SEE BELOW ]

  1. It's now even smaller and more effitient
  2. Code is now beautified
  3. Added to NPM
  4. Added to CDN

Demo

Pushbar. animated

Installation

  1. Add the pushbar.css file to the head of your html.
  2. Add the pushbar.js file to the head of your html or right before the closing body tag.
  3. Add this code after the pushbar.js script tag to initialize the plugin.
<script type="text/javascript">
  const pushbar = new Pushbar({
        blur:true,
        overlay:true,
      });
</script>
	

Example HTML

  //CHANGE: Older version of pushbar used class="pushbar from_left"
  <div data-pushbar-id="mypushbar1" data-pushbar-direction="left">
      Push bar content 1
      <button data-pushbar-close>Close</button>
  </div>

  //CHANGE: Older version of pushbar used class="pushbar from_bottom"
  <div data-pushbar-id="mypushbar2" data-pushbar-direction="bottom">
      Push bar content 2
      <button data-pushbar-close>Close</button>
  </div>
------------------------------------------------------
  <div class="pushbar_main_content">
      Main content of the page

      <button data-pushbar-target="mypushbar1">
      Open my pushbar 1
      </button>

      <button data-pushbar-target="mypushbar2">
      Open my pushbar 2
      </button>
  </div>

Direction attributes [NEW]

You can use 4 directional attributes in pushbar elements

  1. data-pushbar-direction="left" So that the pushbar opens from left
  2. data-pushbar-direction="right" So that the pushbar opens from right
  3. data-pushbar-direction="top" So that the pushbar opens from top
  4. data-pushbar-direction="bottom" So that the pushbar opens from bottom

Options

  1. blur : set it to true for blur effect on the main content (Default:false)
  2. overlay : set it to true for dark overlay effect on the main content (Default:true)

API

Open and close pushbar with api

<script type="text/javascript">
  const pushbar =   new Pushbar({
        blur:true,
        overlay:true,
      });

  //open a pushbar
  pushbar.open('mypushbar1');	
  //close all pushbars
  pushbar.close();	
</script>

Events

  • 'pushbar_opening': when a pushbar is opening, it will emit 'pushbar_opening' event with an object { element, id }, Where element will be the current pushbar element and the id is the current pushbar id.
  • 'pushbar_closing': when a pushbar is closing, it will emit 'pushbar_closing' event with an object { element, id }, Where element will be the current pushbar element and the id is the current pushbar id.

License

MIT License

Copyright (c) 2018 Biraj Ghosh <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Oncebot