Installed

elm/browser
1.0.2
elm/core
1.0.5
elm/file
1.0.5
elm/html
1.0.0
elm/json
1.1.3

Registry

elm/http
2.0.0
elm/random
1.0.0
elm/time
1.0.0
elm/svg
1.0.1
evancz/elm-playground
1.0.3
elm-explorations/webgl
1.1.3
w0rm/elm-physics
5.1.3
rtfeldman/elm-css
18.0.0
mdgriffith/elm-ui
1.1.8
​x
    [ style "border" (if model.hover then "6px dashed purple" else "6px dashed #ccc")
 
1
-- Image upload with a drag and drop zone.
2
--
3
-- Dependencies:
4
--   elm install elm/file
5
--   elm install elm/json
6
--
7
​
8
import Browser
9
import File exposing (File)
10
import File.Select as Select
11
import Html exposing (..)
12
import Html.Attributes exposing (..)
13
import Html.Events exposing (..)
14
import Json.Decode as D
15
​
16
​
17
​
18
-- MAIN
19
​
20
​
21
main =
22
  Browser.element
23
    { init = init
24
    , view = view
25
    , update = update
26
    , subscriptions = subscriptions
27
    }
28
​
29
​
30
​
31
-- MODEL
32
​
33
​
34
type alias Model =
35
  { hover : Bool
36
  , files : List File
37
  }
38
​
39
​
40
init : () -> (Model, Cmd Msg)
41
init _ =
42
  (Model False [], Cmd.none)
43
​
44
​
45
​
46
-- UPDATE
47
​
48
​
49
type Msg