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

ng-carousel

v0.2.0

Published

Three-dimensional HTML5 carousel implemented in Angular.js.

Downloads

49

Readme

ngRoundabout

Travis   npm   License MIT

ngRoundabout Screenshot

ngRoundabout is a HTML5 carousel using the wonderful preserve-3d transformation. With this module you can easily create your own 3D carousel by specifying the markup for the partial – which are used for each dimension.


Getting Started

Using ngRoundabout is very simple – first you need to pass an array via the ng-model to the directive. Therefore you need an array of something – in our case pictures taken randomly from Imgur:

$http.get('imgur.json').then(function then(response) {
    $scope.pictures = response.data;
});

We can then setup our directive, passing in the pictures into the ng-model:

<carousel ng-model="pictures"></carousel>

ngRoundabout will then compute how many dimensions it will render based on the array. It's worth noting that if you want multiple items per dimension then simply pass an array of an array.

The next step is to render each dimension – which requires you supplying the path to your partial which renders the markup for the dimension. By default ngRoundabout will attempt to load your partial from partials/carousel.html, but you can modify this — and other options — by modifying the FIGURE_PARTIAL_PATH option.

In order to modify the ngRoundabout options, you need to import the carouselOptions object into your controller – from there you can modify the options.

Lastly from within your partial you need to specify what to output – where the model is each and every item from your array:

<a target="_blank" href="{{model}}">
    <div style="background-image: url({{model}})"></div>
</a>

Voila! Any additional styles should be done via your stylesheet.

Options

Import carouselOptions into your controller, and then you will have access to the following options:

  • DIMENSION_WIDTH: Width of each dimension;
  • DIMENSION_HEIGHT: Height of each dimension;
  • DIMENSION_SPACING: Margin between the dimensions;
  • PERSPECTIVE: Perspective for the carousel;
  • BACKFACE_VISIBILITY: Whether the backface is visible;
  • MAINTAIN_ASPECT_RATIO: See maintain aspect ratio;
  • FIGURE_PARTIAL_PATH: Path to your dimension partial;

ngRoundabout Screenshot

Maintain Aspect Ratio

By default ngRoundabout will not maintain the width — or aspect ratio — of the carousel when items are added and/or removed. By defining MAINTAIN_ASPECT_RATIO as true, ngRoundabout will maintain the width.

Otherwise if the value is false then the carousel will gradually contract as items are removed, and expand as items are added – which can make it difficult to constrain the carousel in a container of a predefined size.