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

mask

v0.2.2

Published

A dead simple mask for the browser

Downloads

3,972

Readme

Mask.js a dead simple mask

a simple mask for the modern browser.

Install

with browserify and npm:

npm install mask

Example

demo: http://peutetre.github.io/mask/example/

Test Build Status Dependency Status

test runner: http://peutetre.github.io/mask/test/

SauceLabs Status

Build tests and example

npm install
npm run build

open a browser at test/index.html

API

Mask.init(option) => DOMElement

Init the mask and return the created <div>

var Mask = require('mask');

// init the mask
Mask.init({
    // set background color (optional)
    backgroundColor:'rgba(34,25,123,0.5)',
    // set show/hide fade animation duration (optional)
    duration:500
});

Mask.style(option)

style the underlying element

Mask.style({
    zIndex : 200
});

Mask.show() => promise[DOMElement]

Show the mask

Mask.show()
    .then(function (el) {
        // do something...
    }, function (err) {
        console.log(err);
        // occurs when the mask is already displayed
        // or when the mask is in transition.
    });

Mask.hide() => promise[DOMElement]

Hide the mask

Mask.hide()
    .then(function (el) {
        // do something...
    }, function (err) {
        console.log(err);
        // occurs when the mask is already hidden
        // or when the mask is in transition.
    });
});

Mask.onTouch(f)

Set the touchstart/click event handler

function myHandler(evt) {
    console.log("mask touched");
}

Mask.onTouch(myHandler);

ChangeLog

v0.2.0

* upgrade to q 1.0.x
* upgrade to zanimo 1.0.x
* rm qanimationframe dependency

v0.1.7

* Clean npm package by adding a .npmignore
* Remove package.json from example and test folder

v0.1.6

* Fix race condition on Mask show/hide operations.

v0.1.5

* Make Mask working on IE8.
* Add QanimationFrame dep.

v0.1.4

* using opacity & opaque background for not breaking in IE8.

v0.1.3

* add the possibility to override the zIndex.

v0.1.2

* add the possibility to override the transition function.

v0.1.1

* add Mask.style()