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

sidey

v1.0.4

Published

Quickly and easily add an offcanvas sidebar to any page

Downloads

16

Readme

What is it?

sidey is a jQuery plugin which allows you to quickly and easily add an offcanvas sidebar or menu to any page. sidey only requires small adjustments to your HTML markup and a two very small Javascript and CSS files (700 bytes and 2KB). sidey plays nice with Bootstrap and other frameworks.

What does it look like?

Demo

Stop. Where can I get it?

The Javascript and CSS can be downloaded here

Setup

Include the Javascript and CSS files in your <head> tag. Note: the links below are for the development CDN.

<link rel="stylesheet" href="https://rawgit.com/mrvautin/sidey/master/dist/sidey.min.css">
<script type="text/javascript" src="https://rawgit.com/mrvautin/sidey/master/dist/sidey.min.js"></script>

Setup the instance of sidey. This sets up all sidey-left and sidebar-right elements into sidey sidebars and adds listeners on the toggles. (see index.html for an example).

<script>
$(document).ready(function(){
    $.sidey();
});
</script>

Create the toggle for the sidebar / menu. Be sure to include the data-element with the unique sidebar element you want to toggle and add the sidey-toggle class.

**Note: The data-element will use CSS selectors - eg: . for class and # for element ID.

<a href="#" class="btn btn-primary sidey-toggle" data-element=".sidebarLeft"><i class="fa fa-bars" aria-hidden="true"></i></a>

Create your sidebar / menu (can have multiple) with either the sidey-left or sidey-right class to tell sidey the direction. Be sure to have your sidebar element outside of your main content element. We want the content to be pushed out the way for the sidebar to appear. See index.html for a working example.

<div class="sidebarLeft sidey-left">
    <h1>Left menu</h1>
    <ul class="list-group">
        <li class="list-group-item"><a href="#">Cras justo odio</a></li>
        <li class="list-group-item"><a href="#">Dapibus ac facilisis in</a></li>
        <li class="list-group-item"><a href="#">Morbi leo risus</a></li>
        <li class="list-group-item"><a href="#">Porta ac consectetur ac</a></li>
        <li class="list-group-item"><a href="#">Vestibulum at eros</a></li>
    </ul>
</div>

Add the sidey-content class to your content which you want to push to allow sidey menu to be visible

<body class="sidey-content">

or

<div class="container-fluid sidey-content">

Options

sidey is meant to be simple and there is deliberately not many options.

The only option is whether to blur/darken the background when the sidey menu is open. By default this is true/on. To remove simply setup sidey with the backgroundBlur option set to false:

$.sidey({backgroundBlur: false});