Skip to content

fysiweb/elm-gallery

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elm-gallery

A simple content and/or image gallery with touch and keyboard navigation.

example live | example code

Example code

type alias Model =
    { gallery : Gallery.State }


init : Model
init =
    { gallery = Gallery.init (List.length someSlides) }


type Msg
    = GalleryMsg Gallery.Msg


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


view : Model -> Html Msg
view model =
    Html.map GalleryMsg <|
        Gallery.view config model.gallery [ Gallery.Arrows ] someSlides


config : Gallery.Config
config =
    Gallery.config
        { id = "image-gallery"
        , transition = 500
        , width = Gallery.vw 60
        , height = Gallery.px 400
        }

Images by

esa

Packages

No packages published

Languages

  • Elm 97.5%
  • Nix 2.5%