@@ -171,17 +171,25 @@ noSearchResultsView = Element.el
171171We'll try and find you something.
172172Just come back later.""")
173173
174−subtleLink : String -> String -> Element Msg
175−subtleLink text href =
174+subtleLinkView : String -> String -> Element Msg
175+subtleLinkView text href =
176176 Element.el
177177 [ Font.size 15
178178 , pointer
179179 , mouseOver
180− [ Font.color (rgb 0.7 0.7 0.7)
180+ [ Font.color (rgb 0.1 0.7 0.7)
181181 ]
182182 ]
183183 (Element.html (Html.a [ Html.Attributes.href href ] [ Html.text text ]))
184184
185+aboutView : Element Msg
186+aboutView = row [ centerX, padding 10, spacing 10]
187+ [ subtleLinkView "[About]" "https://vagos.github.io/seax"
188+ , subtleLinkView "[Code]" "https://github.com/ilyakooo0/seax"
189+ ]
190+
191+
192+
185193
186194view : Model -> Element Msg
187195view model =
@@ -190,6 +198,7 @@ view model =
190198 column [ centerX, centerY, padding 8, spacing 16 ]
191199 [ logoView [ centerX, width (px 510), height (px 161) ]
192200 , searchView model
201+ , aboutView
193202 ]
194203
195204 Just _ ->
@@ -307,17 +316,34 @@ view model =
307316 )
308317 ))
309318 , Element.html (Html.hr [Html.Attributes.style "width" "95%"] [])
310− , row [ centerX, padding 10, spacing 10]
311− [ subtleLink "[About]" "https://vagos.github.io/seax"
312− , subtleLink "[Code]" "https://github.com/ilyakooo0/seax"
319+ , aboutView
313320 ]
314− ]
321+
322+
323+onEnter : msg -> Element.Attribute msg
324+onEnter msg =
325+ Element.htmlAttribute
326+ (Html.Events.on "keyup"
327+ (JD.field "key" JD.string
328+ |> JD.andThen
329+ (\key ->
330+ if key == "Enter" then
331+ JD.succeed msg
332+
333+ else
334+ JD.fail "Not the enter key"
335+ )
336+ )
337+ )
315338
316339
317340searchView : { a | search : String } -> Element Msg
318341searchView model =
319342 row [ spacing 8 ]
320− [ Input.text [ Html.Attributes.class "shadow" |> htmlAttribute, width (px 400)]
343+ [ Input.text
344+ [ Html.Attributes.class "shadow" |> htmlAttribute, width (px 400)
345+ , onEnter (Search model.search)
346+ ]
321347 { onChange = UpdateSearch
322348 , placeholder = Nothing
323349 , text = model.search