Coder Social home page Coder Social logo

spartacusroot / angular2-image-gallery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benjaminbrandmeier/angular2-image-gallery

0.0 2.0 0.0 317 KB

Image Gallery built with Angular 2, node.js and GraphicsMagick

Home Page: http://oidamo.de/angular2-image-gallery/

TypeScript 50.67% JavaScript 24.53% Shell 2.16% CSS 8.18% HTML 14.47%

angular2-image-gallery's Introduction

Angular 2 Image Gallery

Build Status npm version npm downloads

A responsive image gallery designed for high resolution images.

The project consists of a gallery, a viewer and a script for image preparation.

Before using the gallery, you have to process all of your images that will be part of your gallery with the node.js script. The processed images will be stored to your applications assets. During runtime everything runs client-side and there is no separate server-side communication involved. The viewer takes care that an optimal image quality is served based on the device resolution.

Demo

http://oidamo.de/angular2-image-gallery/

How to use the gallery in your project

Pre-requirements

Install node (>= 4.2.2) and graphicsmagick: http://www.graphicsmagick.org/README.html#installation

Embed in your project

1. Install angular2-image-gallery

npm install angular2-image-gallery --save

2. Import angular2-image-gallery in your Angular 2 module

imports: [
  BrowserModule,
  FormsModule,
  HttpModule,
  Angular2ImageGalleryModule <-----
],

3. Import scripts (when using angular-cli add these lines in polyfills.ts)

import 'web-animations-js/web-animations.min';
import 'hammerjs/hammer';

4. Import styles (when using angular-cli add this line in styles.css)

@import '~@angular/material/core/theming/prebuilt/deeppurple-amber.css';
@import '~https://fonts.googleapis.com/icon?family=Material+Icons';

5. Run convert script

node node_modules/angular2-image-gallery/convert.js <path/to/your/images>

Add a flag to define the order of the images inside the gallery

-n sort by file name (default)

-d sort chronologically by the original creation time (e.g. for coverages of a wedding)

-c sort by primary image color

6. Embed gallery in your template

<gallery 
    [flexBorderSize]="3" 
    [flexImageSize]="7" 
    (viewerChange)="yourNotificationFunction($event)">
</gallery>

All parameters are optional. You may play around on the demo site to find out what parameters suit your needs.

The viewerChange event notifies you when the viewer component gets opened or closed.

That's it, start your application and have a look!

Currently used tools

  • Angular 2.3.1
  • NodeJS 7.3.0
  • Angular-CLI 1.0.0-beta.24
  • graphicsmagick

Troubleshooting

If the conversion process fails, make sure you have enough swap space provided.

If you experience any other issues, please raise an issue on GitHub.

angular2-image-gallery's People

Contributors

markuseckstein avatar

Watchers

James Cloos avatar Giuseppe Remolino avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.