prikhi/bootstrap-gallery/1.0.1

BootstrapGallery

This module is used to render images as gallery thumbnails & lightboxes.

Configuration

type alias Config a =
{ thumbnailUrl : a -> Maybe String
, imageUrl : a -> String
}

Configuration for pulling the thumbnail & image URLs out of an arbitrary image type.

Data

type alias Model a =
{ data : Maybe (SubModel a)
, style : State
, foregroundImageStyle : State
, backgroundImageStyle : State
}

The internal state of the Gallery.

initial : Model a

A blank gallery with no associated images.

Rendering

thumbnails : Config a -> List a -> Html (Msg a)

Render thumbnails in a column grid using the given list of images.

openOnClick : (Msg a -> msg) -> a -> Attribute msg

Open the modal when the element is clicked & select the given item.

Updating

type Msg a

Messages the modal may raise.

update : Config a -> Msg a -> Model a -> List a -> Model a

Update the Gallery model.

subscriptions : Model a -> Sub (Msg a)

Subscribe to the animation updates.

open : Config a -> Model a -> List a -> a -> Model a

Open the modal & select the given item.

close : Config a -> Model a -> List a -> Model a

Close the modal.