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

faded

v0.1.1

Published

Standalone Javascript Plugin for creating visually hinted scroll views.

Downloads

16

Readme

FADED

A standalone JavaScript plug-in for visually hinted lists. Yep, zero dependencies.

Demo

Have a look. :cloud: DEMO :flashlight:

Installation

Add ./dist/fog.min.js to your project.

Usage

Built with a UMD (Universal Module Definition) pattern.

Plain JavaScript

Insert script into your HTML.

<script type="text/javascript" src="./path/to/fog.min.js"></script>

Fog constructor is then attached to browser window global.

window.Fog("list_to_fog");

CommonJS

var Fog = require("./path/to/fog.min.js");

RequireJS

define('module/id/string', ["./path/to/fog.min.js"],
function(Fog){
  // Fog Usage
});

API

Fog(element[, opts])

element

Type: <String>|<HTMLElement>

Description: Reference to HTML DOM node

Restriction:

  • Only ONE HTMLElement node reference permitted
  • NO tree traversal (looks for element with all specified class's)

Ex:

// HTMLElement ID
Fog("#listID");

// HTMLElement class
Fog(".list_class_name.active");

// HTMLElement reference
var node = document.getElementById("listID");
Fog(node);

opts

Type: <Object>

Description: The selected element children style configuration

Ex:

var opts = {};
Fog("listID", opts);

opts.range

Type: <Number>

Default: 0.6

Ex:

var opts = {
  range: 0.6
};
Fog("listID", opts);

opts.style

Type: <AllStyle>

Default: {opacity: {min: 0.1, max: 1}}

Ex:

var opts = {
  color: {
    min: "rgba(12, 66, 144, 0.2)",
    max: "#FFF"
  }
};
Fog("listID", opts);

Type Definition

@typedef <Object> AllStyle
@prop <Style> 

@typedef <Object> Style
@property <Number|String> max
@property <Number|String> min

// Data Structure
{
  CSS_Property: {
    min: <Number|Color>,
    max: <Number|Color>
  }
}

AllStyle

Type: <Object>

Description: <AllStyle> is a collection <Style> definitions where each KEY represents a valid CSS property to modify on the <element>'s children.

Restriction:

  • KEY MUST reference a valid CSS style property
  • KEY REQUIRED as camelcase or hyphen separated words ('backgroundColor', 'border-color')

Ex:

var opts = {
  style: {
    color: {/*<Style>*/},
    backgroundColor: {/*<Style>*/},
    'border-radius': {/*<Style>*/}
  }
};

Style

Type: <Object>

Description: Configures the corresponding CSS property (KEY) to which it's assigned.

Restriction:

  • One or more declared properties
  • Single simple data type property - ONLY <Number|String>
  • (min,max) value should be selected CSS appropriate

Note: Use <String> to specify a color value. Accepts (hex, rgb, rgba).

Ex:

var opts = {
  style: {
    opacity: {
      min: 0.1,
    },
    color: {
      min: 'rgba(0,0,0,0.3)',
      max: 'black'
    },
    backgroundColor: {
      min: '#222',
      max: 'rgb(255,255,255)'
    }
  }
};

Style.min

Type: Number|String

Description: Edge styling for selected list.

Style.max

Type: <Number>|<String>

Description: Center styling for selected list

Contribution