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

ion-gallery

v0.3.2

Published

Ionic gallery directive

Downloads

296

Readme

ion-gallery

Ionic gallery with slider

Demo availabe in Ionic View with id 150745FE

$ bower install --save ion-gallery

Features

  • Define number of collums to present (1 to array length)
  • Pinch and double tap do zoom on picture

Usage

With CommonJs or Webpack, just require('ion-gallery') and require('ion-gallery/dist/ion-gallery.css').

Add ion-gallery as dependency to your project

angular
 .module('starter', ['ionic','ion-gallery'])

Add gallery directive with array of photos:

<ion-gallery ion-gallery-items="items"></ion-gallery>

Data source example

$scope.items = [
  {
    src:'http://www.wired.com/images_blogs/rawfile/2013/11/offset_WaterHouseMarineImages_62652-2-660x440.jpg',
    sub: 'This is a <b>subtitle</b>'
  },
  {
    src:'http://www.gettyimages.co.uk/CMS/StaticContent/1391099215267_hero2.jpg',
    sub: '' /* Not showed */
  },
  {
    src:'http://www.hdwallpapersimages.com/wp-content/uploads/2014/01/Winter-Tiger-Wild-Cat-Images.jpg',
    thumb:'http://www.gettyimages.co.uk/CMS/StaticContent/1391099215267_hero2.jpg'
  }
]

Thumbnail property is also optional. If no thumbnail, the source content will be used

Subtitle property is optional. If no property present, nothing is showed (Same for empty string). Supports html tags.

UI will reflect changes on the content object passed to the directive. Example of adding and removing pictures can be seen in the ionic view app.

Config

  • Via provider:

Default values in example.

app.config(function(ionGalleryConfigProvider) {
  ionGalleryConfigProvider.setGalleryConfig({
                          action_label: 'Close',
                          template_gallery: 'gallery.html',
                          template_slider: 'slider.html',
                          toggle: false,
                          row_size: 3,
                          fixed_row_size: true
  });
});
Default values
action_label - 'Close' (String)
template_gallery - 'gallery.html' (String)
template_slider - 'slider.html' (String)
toggle - false (Boolean)
row_size - 3 (Int)
fixed_row_size - true (boolean). If true, thumbnails in gallery will always be sized as if there are "row_size" number of images in a row (even if there aren't). If set to false, the row_size will be dynamic until it reaches the set row_size (Ex: if only 1 image it will be rendered in the entire row, if 2 images, both will be rendered in the entire row)
zoom_events - true (Boolean)
  • Via markup:

Markup overrides provider definitions

  • ion-gallery-row: Defines size of the row. Default to 3 images per row

        <ion-gallery ion-gallery-items="items" ion-gallery-row="5"></ion-gallery>
  • ion-gallery-toggle: Sets one tap action on slideshow to hide/show subtitles and "Done" button. Default: true

        <ion-gallery ion-gallery-items="items" ion-gallery-toggle="false"></ion-gallery>
  • ion-item-action: Overrides the default action when a gallery item is tapped. Default: opens the slider modal

        <ion-gallery ion-gallery-items="items" ion-item-action="itemAction(item)"></ion-gallery>
  • ion-zoom-events: Enable/Disable all zoom events in slider (pinchToZoom, tap and double tap). Default: true

        <ion-gallery ion-gallery-items="items" ion-zoom-events="true"></ion-gallery>