tricycle/elm-infinite-gallery/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.

Rerouted (cache, verified). The original is gone. This copy comes from a Lamdera package cache made before it went. The Lamdera package server serves a copy recovered from a Lamdera package cache from 2021-02-13.

What we checked: Rebuilt from the unpacked sources in a Lamdera package cache (5 copies agree), which Elm only writes after the published SHA-1 checked out; elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip is our own, so its SHA-1 is not the published one.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/tricycle/elm-infinite-gallery/zipball/4.1.0/

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.

= TransitionSpeed Int

A number of milliseconds to spend transitioning between indices.

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