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

@mikepol/ng-photo-grid

v1.0.3

Published

Angular photo grid

Downloads

18

Readme

ng-photo-grid

Photo grid like facebook in angular js with no dependencies. Work well when images have variety in dimension, scale images but respect ratio and improve display images in cells.

Examples page

angular facebook photo grid with default config

angular facebook photo grid with 2 bigs image first

angular facebook photo grid with square config

This module can be used with these options:

| Option | Description | Value | Default | |----------------|---------------------------------------------------------------------------------------------------------------------------------------------|----------|----------------| | urlKey | object attribute present for image url ex:{url: "/example.jpg"} => urlKey: "url" | string | "original_url" | | sortByKey | object attribute present for order of object in array ex:[{nth: 1}, {nth: 2}] => sortByKey: "nth" | string | "nth" | | onClicked | image click event handler, argument is clicked image | function | none | | onBuilded | callback when grid was built completed | function | none | | onDOMReady | callback when DOM generated completely from array images object | fucntion | none | | margin | space between each image on grid | number | 2 | | maxLength | maximum objects in array grid choose to build | number | 5 | | isSquare | options to build grid has the height equals to width ex: used to display grid of grids without break layout | boolean | false | | buildOnLoading | option to trigger build grid, grid be built while images loading if it's true. Otherwise, grid will be built only one when all image loaded | boolean | true |

####Note:

  This directive used to built the grid of images 
  (let's look at the demo source code to see how the array of images look like), 
  so you should prepare the array of images object first 
  then following this guide below.

####1. Inject module to your angular app definition:

angular.module("ngApp", ["ngPhotoGrid"])

####2. On your controller, you should define the options and events handler if needed like this:

  $scope.gridOptions = {
    urlKey      :     "original_url",
    sortKey     :     "nth",
    onClicked   :     function(image) {
                        alert(JSON.stringify(image))
                      },
    onBuilded   :     function() {
                        console.log ("built completed!")
                        $scope.isBuildingGrid = false;
                      },
    margin      :     2,
    maxLength   :     7
  }

####3. Use directive in template like this:

<div ng-photo-grid="" images="images" grid-options="gridOptions"></div>

####4. Open browser then see the magic, you can refresh (F5) browser again to see others style of grid was built (if your images were random order and have different dimension)

####Updated: 08-11-2015

  • Fixed display grid when has 2 images
  • Added css border to grid cell. Include style in border.css if you want grid cell is bordered.

####Others Contribution are welcome so if you find any issue, please post issues or email me at: jerryc.nguyen92[at]gmail.com

Thanks lorempixel.com for better images in demo pages.

##MIT License