0.0.1 • Published 5 years ago

@silicic/scroll-gallery-ng v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
5 years ago

@silicic/scroll-gallery-ng

A scroll-able gallery component.

npm.io

Demo

Installation

Install with npm:

npm install @silicic/scroll-gallery-ng

Usage

Import ScrollGalleryModule:

@NgModule({
  imports: [ScrollGalleryModule]
})
export class AppModule {}

And wrap si-gallery-item with si-scroll-gallery like this:

<si-scroll-gallery
  [activatedItemPosition]="'center'"
  [bounceRate]="400"
  [gap]="120"
  [scaleRate]="1.1"
>
  <si-gallery-item>
    A
  </si-gallery-item>
  <si-gallery-item>
    B
  </si-gallery-item>
  <si-gallery-item>
    C
  </si-gallery-item>
</si-scroll-gallery>

API

si-scroll-gallery

PropertyDescriptionTypeDefault Value
[gap]Gap between two si-gallery-itemnumber120
[scaleRate]Scale ratio of activated si-gallery-itemnumber1.2
[activatedItemPosition]Left offset of the activated item to the left bordernumber | 'center'1.2
[bounceRate]Bouncing flexibility of the component when it's scrolled to the first or lastnumber100
(activatedChanged)The currently activated item changed.Subject<void>-
(draggingStarted)Subject<void>-
(dragging)Subject<PointerVector>-
(draggingEnd)Subject<PointerVector>-

License

MIT