-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModel.elm
47 lines (37 loc) · 824 Bytes
/
Model.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module Model exposing (ClipState(..), Model, SoundState(..), initial)
import Browser.Navigation exposing (Key)
import Clip exposing (Clip)
import Dict exposing (Dict)
import Video exposing (Video)
type ClipState
= Initial
| Slug String
| Loaded Clip
type SoundState
= Hidden
| Shown
| Enabled
type alias Model =
{ videos : Maybe (Dict String Video)
, clip : ClipState
, count : Int
, width : Int
, height : Int
, key : Key
, sound : SoundState
}
initial : Maybe String -> Key -> Model
initial fragment key =
{ videos = Nothing
, clip =
case fragment of
Nothing ->
Initial
Just slug ->
Slug slug
, count = 0
, width = 0
, height = 0
, key = key
, sound = Shown
}