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

angular-packery

v1.0.4

Published

Angular module for the popular Packery library.

Downloads

21

Readme

angular-packery

Angular module for the popular Packery library.

Continuous Integration Status Dependency Status devDependency Status

Requirements

Optional


Example Usage

Simple

By default, this module listens for an element or attribute call and instantiates with the options described in Packery's API. It looks to a self-created object, div.packery-sizer, to control the grid dimensions.

HTML
<packery ng-init="objects = [{id:'1'},{id:'2'},{id:'3'}]">

  <packery-object>
    <header>
      <h3>Sample object</h3>
    </header>
    <div ng-include="'/resources/partials/some-partial.html'"></div>
  </packery-object>

  <packery-object>
    <div>Mmmm pizza</div>
  </packery-object>

  <packery-object>asdasd</packery-object>

  <packery-object ng-repeat="obj in objects">
     <h3>Dynamic object #{{obj.id}}</h3>
  </packery-object>

  <packery-object>
    <h3>One more</h3>
    <p>...for the road</p>
  </packery-object>

</packery>

CSS

.packery-sizer, .packery-object {
  width: 360px;
  height: 500px;
}

Custom

This module supports almost all of the Packery options in their intended form. As such, custom options can be set via attributes on the main packery element. Please refer to Packery's website for available options.

HTML
<packery row-height=".card.single" column-width=".card.single" handle=".card-header" is-origin-top="false" gutter="20">

  <packery-object class="card single">
    <header class="card-header">
      <h3>Uno</h3>
    </header>
    <div>One</div>
  </packery-object>

  <packery-object class="card double">
    <header class="card-header">
      <h3>Dos</h3>
    </header>
    <div>Two</div>
  </packery-object>

  <packery-object class="card single">
    <header class="card-header">
      <h3>Tres</h3>
    </header>
    <div>Three</div>
  </packery-object>

  <packery-object class="card single">
    <header class="card-header">
      <h3>Fourso</h3>
    </header>
    <div>Four</div>
  </packery-object>

</packery>
CSS
.card.single {
  width: 300px;
  height: 400px;
}

.card.double {
  width: 620px;
  height: 400px;
}

.card-header {
  cursor: move;
}

CSS Classes / Animating

Two CSS classes are applied to the objects to show depth during dragging events, hovered and lifted. The classes are triggered by both mouse events and touch events.

Animation can be applied easily with CSS:

.card {
  -webkit-transition: box-shadow 0.2s;
  -moz-transition: box-shadow 0.2s;
  transition: box-shadow 0.2s;
}

.card.hovered {
  box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

.card.lifted {
  box-shadow: 0 13px 33px rgba(100,100,100,0.30), 0 8px 12px rgba(100,100,100,0.22);
  z-index: 5;
}

Events

packeryInstantiated - Emits Packery obj. Fired when a new Packery container is created.

packeryObjectPacked - Emits element. Fired when an object is packed.


A note on ng-include and draggability

Due to how Angular builds ng-include templates, this module does not support using ng-include on your packery-object or custom handle elements. Doing so will cause draggability issues.

To ensure that your dynamic content packs and drags properly, please ensure that the objects and handles are built outside of any ng-include'd content.

Good:

<packery-object>
  <div ng-include="'template.html'"></div>
</packery-object>

Bad:

<packery-object ng-include="'template.html'"></packery-object>

Good:

<packery handle=".card-header">
  <packery-object class="card">
    <header class="card-header"><h3>Drag handle</h3></header>
    <div ng-include="'template.html'"></div>
  </packery-object>
</packery>

Bad:

<packery-object handle=".handle-in-template">
  <div ng-include="'template.html'"></div>
</packery-object>

License

This repository is open source and distributed under the MIT License:

The MIT License

Copyright (c) 2014 Sungard http://www.sungard.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Packery is a product of Metafizzy LLC and is distributed under a separate license. Please refer to their website for information on Packery's license.