about summary refs log tree commit diff
path: root/website/sandbox/chord-drill-sergeant/src/Tempo.elm
blob: de4fa32795f911677fc57341406b66047e97e9ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Tempo exposing (render)

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)

type alias Props msg =
  { tempo : Int
  , handleIncrease : msg
  , handleDecrease : msg
  , handleInput : String -> msg
  }

render : Props msg -> Html msg
render {tempo, handleIncrease, handleDecrease, handleInput} =
  div [] [ p [] [ text ((String.fromInt tempo) ++ " BPM") ]
         , button [ onClick handleDecrease ] [ text "Slower" ]
         , input [ onInput handleInput
                 , placeholder "Set tempo..."
                 ] []
         , button [ onClick handleIncrease ] [ text "Faster" ]
         ]