-
Notifications
You must be signed in to change notification settings - Fork 0
/
Board1.elm
32 lines (27 loc) · 806 Bytes
/
Board1.elm
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
import Html exposing (div)
import Html.App exposing (beginnerProgram)
import List exposing (map)
import Svg exposing (svg)
import Svg.Events exposing (onClick)
import Svg.Attributes exposing (width, height, r, cx, cy, fill)
main =
beginnerProgram
{ model = Nothing
, view = view
, update = \msg _ -> msg
}
svgCircle (xCenter, yCenter) =
Svg.circle [ r "15"
, fill "red"
, cy (toString xCenter)
, cx (toString yCenter)
, onClick (Just (xCenter, yCenter) )
] []
view model =
div []
[ Html.text (toString model)
, div []
[ svg [ width "100" , height "100" ]
(map svgCircle [ (30, 30) , (70, 30) , (50, 60) ])
]
]