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

@webhare/dompack-justifiedcontentgrid

v0.1.1

Published

Dompack Justified Content Grid

Downloads

2,739

Readme

What does it do

Popular names for this kind of effect:

  • responsive gallery
  • Google Plus inspired image gallery

Usage

Instructions on usage:

  • use box-sizing: border-box;
  • specify data-width and data-height attributes to prevent relayout of the page / JustifiedMediaGrid
  • DON'T use "fill" as resize method in the GetCachedImage functions, the JustifiedImageGrid must determine which parts can be cut off

Add the required dependency to your package.json:

"dependencies": { "dompack-justifiedcontentgrid": "https://github.com/WebHare/dompack-justifiedcontentgrid" }

Usage of JustifiedImageGrid

Initializing

  import * as grid from "dompack-justifiedcontentgrid";

  // after load event is safe, or use domready and call .refresh after load event
  var grid = new grid.JustifiedImageGrid(gridnode, options);

OR

import { JustifiedContentGrid } from "dompack-justifiedcontentgrid";

OR

import { JustifiedImageGrid } from "dompack-justifiedcontentgrid";

  var grid = new JustifiedImageGrid(gridnode, options);

Updating settings:

(for example upon a resize of the page)

    grid.setOptions(options);
    grid.refresh();

Future plans

  • ability to scale arbitrary content (just transform: scale the nodes)

  • FIXME: handle the case in which we get images which are too small (we currently assume the images fill up our strip height)

  • prevent zoom-in effect by always zooming in a little and cutting of a little if needed ?

  • a server-side implementation? (would require the rows width and height to have a fixed aspect ratio)