aboutsummaryrefslogtreecommitdiff
path: root/picarones-elm/src/Switcher.elm
blob: e1a770975e71f9e7b90154ba006ec67212b992f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module Switcher exposing (..)

import Browser
import Html exposing (Html, button, div, text, br, input, img)
import Html.Attributes exposing (style, class, value, placeholder, src)
import Html.Events exposing (onInput, onClick)
import Html.Lazy exposing (lazy)
import List exposing (foldr)

import Main exposing (..)

main = Browser.document
    { init = init
    , update = update
    , view = view
    , subscriptions = subscriptions
    }


{- VIEW COMPONENTS -}

 -- our body consists of a slide container and a couple controls
body : Model -> Html Msg
body model = div []
        [ div [class "slides"] (slideView model.slide model.max model.prefix)
        , div [class "controls"] 
            [ button [ onClick PrevSlide ] [ text "←" ]
            , text (String.fromInt (model.slide+1))
            , button [ onClick NextSlide ] [ text "→" ]
            ]
        ]


view : Model -> Browser.Document Msg
view model = { title = "Picarones"
             , body = [body model]
             }