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

image-slider-ng

v1.3.1

Published

Angular Image slider with lightbox in angular 6.

Downloads

31

Readme

Angular Image Slider with Lightbox

An Angular responsive image slider with lightbox popup. Also support youtube and mp4 video urls.

Features!

  • Responsive
  • captures swipes from phones and tablets
  • Compatible with Angular Universal
  • Image lightbox popup
  • captures keyboard next/previous arrow key event for lightbox image move
  • Support Images, Youtube and MP4 video url's

Demo: https://sanjayv.github.io/ng-image-slider/

Installation

npm install ng-image-slider

Setup :

Import module in your app.module.ts:

import { NgImageSliderModule } from 'ng-image-slider';
...

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        NgImageSliderModule,
        ...
    ],
    providers: [],
    bootstrap: [AppComponent]
})

export class AppModule {
}

Add component in your template file.

<ng-image-slider [images]="imageObject" #nav></ng-image-slider>

ImageObject format

imageObject: Array<object> = [{
        image: 'assets/img/slider/1.jpg',
        thumbImage: 'assets/img/slider/1_min.jpeg'
    }, {
        image: 'assets/img/slider/2.jpg',
        thumbImage: 'assets/img/slider/2_min.jpeg',
		title: 'Image with title' //Optional: You can use this key if you want to show title
    }
];

Image, Youtube and MP4 url's object format

imageObject: Array<object> = [{
       video: 'https://youtu.be/6pxRHBw-k8M' // Youtube url
   },
   {
   	video: 'assets/video/movie.mp4', // MP4 Video url
   	title: 'Video with title' //Optional: You can use this key if you want to show Video with title
   },
   {
   	video: 'assets/video/movie2.mp4',
   	posterImage: 'assets/img/slider/2_min.jpeg', //Optional: You can use this key if you want to show video poster image in slider
   	title: 'Video with title and poster image.'
   },
   {
   	image: 'assets/img/slider/1.jpg',
       thumbImage: 'assets/img/slider/1_min.jpeg'
   }
   ...
];

API Reference (optional) :

| Name | Type | Data Type | Description | Default | |------|------|-----------|-------------|---------| | infinite | @Input | boolean | Infinite sliding images if value is true. | false | | imagePopup | @Input | boolean | Enable image lightBox popup option on slider image click. | true | | animationSpeed | @Input | number | By this user can set slider animation speed. Minimum value is 0.1 second and Maximum value is 5 second. | 1 | | slideImage | @Input | number | Set how many images will move on left/right arrow click. | 1 | | imageSize | @Input | object | Set slider images width and height. Pass object like {width: 400, height: 300} | {width: 205, height: 200} | | autoSlide | @Input | number | Auto slide images according provided time. Option will work only if infinite option is true. Minimum value is 1 second and Maximum value is 5 second. | 0 | | showArrow | @Input | boolean | Hide/Show slider arrow buttons | true | | imageClick | @Output | n/a | Executes when click event on slider image. Return image index. | n/a | | arrowClick | @Output | n/a | Executes when click on slider left/right arrow. | n/a | | lightboxArrowClick | @Output | n/a | Executes when click on lightbox next/previous arrow. | n/a |

Add custom navigation button

import { NgImageSliderComponent } from 'ng-image-slider';

@Component({
    selector: 'sample',
        template:`
        <ng-image-slider [images]="imageObject" #nav>
        </ng-image-slider>
        <button (click)="prevImageClick()">Prev</button>
        <button (click)="nextImageClick()">Next</button>
        `
})
class Sample {
    @ViewChild('nav') slider: NgImageSliderComponent;
    imageObject = [{...}]
  
    prevImageClick() {
        this.slider.prev();
    }
    
    nextImageClick() {
        this.slider.next();
    }
}

License

As Angular itself, this module is released under the permissive MIT license.

Your contributions and suggestions are always welcome :)