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. See image previews!
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
import Task
16
​
17
​
18
​
19
-- MAIN
20
​
21
​
22
main =
23
  Browser.element
24
    { init = init
25
    , view = view
26
    , update = update
27
    , subscriptions = subscriptions
28
    }
29
​
30
​
31
​
32
-- MODEL
33
​
34
​
35
type alias Model =
36
  { hover : Bool
37
  , previews : List String
38
  }
39
​
40
​
41
init : () -> (Model, Cmd Msg)
42
init _ =
43
  (Model False [], Cmd.none)
44
​
45
​
46
​
47
-- UPDATE
48
​
49
​