@@ -4,15 +4,16 @@ import Types exposing (..)
4
4
import Html exposing (..)
5
5
import Html.Attributes exposing (..)
6
6
import Html.Events exposing (onInput , onClick , onMouseEnter )
7
+ import List.Extra exposing (getAt )
7
8
8
9
9
10
view : Model -> Html Msg
10
11
view model =
11
12
div [ class " mh5" ]
12
- [ h1 [ class " tc f1 hot-pink ma5 b" ] [ text " Studio Ghibli Horseplay" ]
13
+ [ h1 [ class " tc f1 orange ma5 b" ] [ text " Studio Ghibli Horseplay" ]
13
14
, createFilmListSection model
14
15
, buildGifs model. gifUrls
15
- , filmDescriptionTitleFunction model
16
+ , filmDescription model
16
17
]
17
18
18
19
@@ -34,15 +35,6 @@ buttonStyle =
34
35
class " pointer grow bg-blue h-10 ba b--black br2 ma2"
35
36
36
37
37
-
38
- -- Note, need to turn into createFilmButton
39
- -- createCharacterButton : Character -> String -> Html Msg
40
- -- createCharacterButton characterName characterUrl =
41
- -- -- button [ onClick (SelectCharacter characterName), buttonStyle ]
42
- -- [ img [ src characterUrl, alt <| toString characterName ] []
43
- -- ]
44
-
45
-
46
38
gifStyle : Attribute msg
47
39
gifStyle =
48
40
class " grow ma2 br2 h4 flex align-center"
@@ -58,11 +50,20 @@ buildGifs gifUrls =
58
50
section [ class " bg-pink pa2" ] <| List . map createGif gifUrls
59
51
60
52
61
- filmDescriptionTitleFunction : Model -> Html Msg
62
- filmDescriptionTitleFunction model =
53
+ filmDescription : Model -> Html Msg
54
+ filmDescription model =
63
55
case model. hoveredFilm of
64
56
Nothing ->
65
57
h2 [] [ text " Choose a film, goddamnit" ]
66
58
67
59
Just int ->
68
- h2 [] [ text " wow you choose a film" ]
60
+ let
61
+ description =
62
+ case getAt int model. allFilms of
63
+ Nothing ->
64
+ " you broke it"
65
+
66
+ Just film ->
67
+ film. description
68
+ in
69
+ h2 [] [ text description ]
0 commit comments