2021-04-17 21:42:28 +00:00
|
|
|
module Shared exposing
|
|
|
|
( Flags
|
|
|
|
, Model
|
|
|
|
, Msg
|
|
|
|
, init
|
|
|
|
, subscriptions
|
|
|
|
, update
|
|
|
|
, view
|
|
|
|
)
|
|
|
|
|
|
|
|
import Browser.Navigation exposing (Key)
|
|
|
|
import Html exposing (..)
|
2021-04-24 19:23:33 +00:00
|
|
|
import Html.Attributes exposing (class, href, src, alt, width, height, style)
|
2021-04-17 21:42:28 +00:00
|
|
|
import Spa.Document exposing (Document)
|
|
|
|
import Spa.Generated.Route as Route
|
|
|
|
import Url exposing (Url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- INIT
|
|
|
|
|
|
|
|
|
|
|
|
type alias Flags =
|
|
|
|
()
|
|
|
|
|
|
|
|
|
|
|
|
type alias Model =
|
|
|
|
{ url : Url
|
|
|
|
, key : Key
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
init : Flags -> Url -> Key -> ( Model, Cmd Msg )
|
|
|
|
init flags url key =
|
|
|
|
( Model url key
|
|
|
|
, Cmd.none
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- UPDATE
|
|
|
|
|
|
|
|
|
|
|
|
type Msg
|
|
|
|
= ReplaceMe
|
|
|
|
|
|
|
|
|
|
|
|
update : Msg -> Model -> ( Model, Cmd Msg )
|
|
|
|
update msg model =
|
|
|
|
case msg of
|
|
|
|
ReplaceMe ->
|
|
|
|
( model, Cmd.none )
|
|
|
|
|
|
|
|
|
|
|
|
subscriptions : Model -> Sub Msg
|
|
|
|
subscriptions model =
|
|
|
|
Sub.none
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- VIEW
|
|
|
|
|
|
|
|
|
|
|
|
view :
|
|
|
|
{ page : Document msg, toMsg : Msg -> msg }
|
|
|
|
-> Model
|
|
|
|
-> Document msg
|
|
|
|
view { page, toMsg } model =
|
|
|
|
{ title = page.title
|
|
|
|
, body =
|
2022-04-08 17:50:58 +00:00
|
|
|
[ div [ class "background" ]
|
2021-04-24 19:23:33 +00:00
|
|
|
[ nav
|
2022-04-08 17:50:58 +00:00
|
|
|
[ class "navbar navbar-expand-lg sticky-top font-weight-bold" ]
|
|
|
|
[ a [ class "navbar-text", href (Route.toString Route.Top) ]
|
2021-04-24 19:23:33 +00:00
|
|
|
[ img
|
2022-04-08 17:50:58 +00:00
|
|
|
[ src "/logo-2.png"
|
2021-04-24 19:23:33 +00:00
|
|
|
, class "d-inline-block align-top mr-2"
|
|
|
|
, alt ""
|
2022-04-08 17:50:58 +00:00
|
|
|
, width 48
|
|
|
|
, height 16 ] []
|
2022-03-24 13:43:29 +00:00
|
|
|
, text "abra recipes"
|
2021-04-24 19:23:33 +00:00
|
|
|
]
|
2021-04-17 21:42:28 +00:00
|
|
|
, ul [ class "navbar-nav" ]
|
2022-04-08 17:50:58 +00:00
|
|
|
[ li [ class "nav-tem" ] [ a [ class "nav-link navbar-text", href (Route.toString Route.About) ] [ text "about" ] ]
|
2021-04-17 21:42:28 +00:00
|
|
|
]
|
|
|
|
]
|
|
|
|
, div [ class "container-fluid" ] page.body
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|