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

wbox

v3.1.0

Published

Simple themed modal boxes

Downloads

9

Readme

wbox

wbox

Build Status

Installation

Install with npm:

npm install wbox --save

Example

Step one is to setup the wbox in your html. The only requirement for the <div> is the class="wbox" & the dimentions w-*.

Here is an example (the additional attributes we'll get to):

<div id="ElementID" class="wbox wbox-theme-flat" w-height="300px" w-width="400px" w-max-width="100%">
    Your HTML code here 
</div>

Step two is pointing wbox to the div and telling wbox what to do with it.

// All wbox calls will begin like:
var modal = new WBox('ElementID')

// Full example to show the defined wbox.
// Wbox functions are stringed together.
modal.show()

WBox usage

If loading through browser <script> tag: access via new wbox.WBox() or new wbox.IBox()

// JS
const { WBox, IBox } from 'wbox';
// TS
import { WBox, IBox } from 'wbox';

new WBox()

Initialize the wbow, example

var modal = new WBox('ElementID')

Overrides

new WBox(el: string)
new WBox(el: Element)
new WBox(el: string, config: Properties)
new WBox(el: Element, config: Properties)

.show(WBox.Properties)

  • style Object StyleProperties
    • [key: string]: string | any
  • overlay Object OverlayProperties
    • show: boolean default = true
    • backgroundColor?: string

Iniates the display process of the defined element id.

Example

<WBox>.show()

.close()

Closes the wbox.

Example

<WBox>.close()

.resize(WBox.ResizeProperties)

  • options Object
    • height string
    • width string

Note: .show()'s sizing will occur before .resize({options})

Example

<WBox>.resize({
  // Any size format can be passed.
  height: '20%',
  width: '400px'
})

IBox usage

new IBox()

Initialize the ibox, example

var modal = new IBox('ElementID')

Overrides

new IBox(images: string)
new IBox(images: string | Array<string>)
new IBox(images?: string | Array<string>, config?: IBoxProperties)

.image(imageIndex)

  • imageIndex Number

Example

<IBox>.image(2)

Themes

By default the following themes are included:

  • wbox-theme-default
  • wbox-theme-flat
  • wbox-theme-material
  • wbox-theme-simple
  • wbox-theme-x

Pre-configured elements

These are wbox child elements preconfigured to the specified theme.

Example

<div class="wbox">
  <div class="wbox-title">
    Child element
  </div>
</div>

Title

Sets a fixed position title and repositions the wbox-content accordingly.

Example

<div class="wbox-title">
  Place title here
</div>

Content

Dynamically positioned (will consume title section if no title is defined).

Example

<div class="wbox-content">
  Place any content here..
</div>

Building

While developing

This will allow continuous development and auto building to test. Use the test/test.html to manually test your changes.

npm run gulp:live

For production

Build is configured to minify on output for production usage.

npm run gulp:build