tricycle/elm-infinite-gallery/4.0.0

NOTE: the latest version is 4.1.0

Renamed to bellroy/elm-infinite-gallery. It is published under that name, and new versions come out there.

Versions published as tricycle/elm-infinite-gallery still install under that name. 10 versions of 12 come from the new location (see their notes). 2 versions could not be recovered and cannot be installed.

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/bellroy/elm-infinite-gallery exists but has no tag 4.0.0; Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 4.0.0 found (2 same-name repos checked); no cached copy. Use another version.

Details

InfiniteGallery

Configuration

type alias Config =
{ rootClassName : String
, id : String
, transitionSpeedWhenAdvancing : TransitionSpeed
, enableDrag : Bool
, swipeOffset : Int
}

The configuration options of a Gallery. These can be passed in while initializing a new Gallery.

defaultConfig : Config

A convenience function that returns some default configuration options.

Framework

{ width : String
, height : String
}
-> Config
-> List (Html Msg)

Create a new Gallery, with given size, config and slides

update : Msg -> Gallery -> ( Gallery, Cmd Msg )

Update the gallery with given Msg. You would need to wrap and unwrap these Msg's inside your own update function.

Example:

type Msg
    = MsgForGallery Gallery.Msg


update : Msg -> Model -> Model
update msg model =
    case msg of
        MsgForGallery msg ->
            { model | gallery = Gallery.update msg model.gallery }
view : Gallery -> Html Msg

Render your gallery e.g.

Example:

type Msg
    = MsgForGallery Gallery.Msg


view : Model -> Html Msg
view model =
    Html.div []
        [ Gallery.view model.gallery
            |> Html.map MsgForGallery
        ]

Control

goTo : Int -> Gallery -> ( Gallery, Cmd Msg )

Go to a specific slide, animated

setIndex : Int -> Gallery -> ( Gallery, Cmd Msg )

Go to a specific slide, direclty

Retrieve

Retrieve the current displayed Slide index

Definitions

type Msg
= DragStart PosX
| DragAt PosX
| DragEnd
| Next
| Previous
| GoTo Int
| SetIndex Int
| SetTransitionSpeed TransitionSpeed
| Batch (List ( TransitionSpeed, Msg ))
| TransitionEnd

The Gallery's internal Msg's