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

ember-cli-photoswipe

v1.2.0

Published

Ember-cli adaptation of the popular photoswipe js library

Downloads

44

Readme

Ember-cli-photoswipe Build Status

Ember-cli Addon adaptation of the popular photo gallery library PhotoSwipe.

Usage

{{#photo-swipe items=model as |img|}}
  <img class="thumb" src={{img.src}} alt={{img.title}}>
{{/photo-swipe}}

By wrapping your gallery in the component, the addon will take care of instantiating PhotoSwipe for you and for calculating the thumbnail bounds so you get the nice zoom in/out animations right out of the box. Easy, right?

See tests/dummy/app/templates/application.hbs as an example of this.

The items property is required and an array of objects should be passed to it. PhotoSwipe expects these items to have the following structure:

[
  {
    src: 'http://placekitten.com/g/600/400',
    w: 600,
    h: 400,
    title: 'whooa',
    msrc: '(optional) larger image'
  }
]

If you want to instantiate a PhotoSwipe gallery from an action instead of a thumbnail, you can also do the following:

{{photo-swipe gallery=myGallery options=psOpts items=items}}

And then you can initialize it through an action in your controller like this:

actions: {
  initGallery: function() {
    this.get('myGallery').init();
  }
}

Any property bound to gallery will become the actual gallery object. This is used to instantiate PhotoSwipe and to interact with the live instance.

Any PhotoSwipe options can be passed to the options property of the component. For now the history module is disabled since it breaks ember routing.

More functionality is on the way, this is a work in progress. You can find PhotoSwipe documentation here.

More Options

You can pass the following extra options to the options property in the PhotoSwipe component to hide PhotoSwipe buttons (default to false):

  1. hideClose
  2. hideShare
  3. hideToggleFullScreen
  4. hideZoomInOut

Contributing

If you have ideas or feature needs that could be implemented, just submit an issue or pull request.

Installation

Ember-cli >= 0.1.5

As easy as running ember install:addon ember-cli-photoswipe, which will also run the generator.

Ember-cli < 0.1.5

For versions under 0.1.5 you need to run npm install ember-cli-photoswipe --save-dev.

Running

To run the dummy app:

  • git clone https://github.com/DanyHunter/ember-cli-photoswipe.git
  • ember server
  • Visit your app at http://localhost:4200.

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.