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

dcbox

v1.0.0

Published

Simple lightbox module, write on native js (no dependents). Support touch (mobile) devices, full responsive, support keyboard control, multi gallery and zooming image.

Downloads

3

Readme

DcBox.js

Summary

DcBox.js is the easiest way to organize your gallery! Only one JS file necessary for the gallery to work. Demo http://dcversus.github.io/dcbox/

Browser support

  • IE 9+
  • Firefox 3+
  • Chrome 4+
  • Safari 3.1+
  • Opera 10.1+
  • Android 2.1+

Install

Add dcbox.js before the body closing tag and add config (optional). All styles and html markup is included in the JS file (use base64). For init gallery you need to provide a structure: gallery tag with class 'dcbox' in which you link a href to the full-sized image (or youtube link) and preview image\structure inside. For example:

<div class="dcbox">
  <a href="fullimage.jpg"><img src="img/thumb.jpg"></a>
  <a href="http://www.youtube.com/watch?v=M97GLlaWUcM"><img src="img/youtubethumb.jpg"></a>
  <!--...-->
</div>
<!--...-->
<script src="dcbox.js"></script>
</body>

Or you can use one element on gallery like this:

<a class="dcbox" href="fullimage.jpg"><img src="img/thumb.jpg"></a>
<!--...-->
<script src="dcbox.js"></script>
</body>

Configuration

You can also use global settings like this (all settings are optional):

<script>
var dcboxConfig = { //in example default configuration
  controls: true, //display control elements, 
  close: false, //close by clicking in the void 
  boxed: false, //open in a small window
  zoom: true, //allow scaling
  iframe: false, //the defaults links opens IMG tags, if the link is youtube the gallery element opens in an iframe. This option opens all links in an iframe.
  gal: 'dcbox' //class name that is considered as a gallery
};
</script>
<script src="dcbox.js"></script>
</body>

You can also use inline settings: (all setting allowed exept 'gal')

<div class="dcbox" data-dcbox="{boxed: true}">
  <a href="fullimage.jpg"><img src="img/thumb.jpg"></a>
  <!--...-->
</div>
<div class="dcbox" data-dcbox="{controls: false,close: true}">
  <a href="fullimage.jpg"><img src="img/thumb.jpg"></a>
  <!--...-->
</div>
<!--...-->
<script src="dcbox.js"></script>
</body>

Usage

To control the gallery, you can use the keyboard: esc: close gallery, enter: fullscreen\box view, left arrow: prev image, right arrow: next image;

Also you can use gestures and mouse: dblclick: zoom x2 and return zoom x1, left-to-right swipe: prev image, right-to-left swipe: next image, mouse and touch drag (on zoomed image): drags the image;