git.iko.soy/horeca-productions/landing
on master help sign in
.
commitbcc7cc4b95a94249d1c44e974d742cf5c69e842b authoriko <mail@iko.soy> dateSun 6 Apr 2025, 04:04 (2 years ago) parent2437869
10 files changed+60−370
app/ErrorPage.elm+7−13 app/Route/Blog/Slug_.elm−86 app/Route/Greet.elm−107 app/Route/Hello.elm−119 app/Route/Index.elm+36−11 app/Shared.elm+3−26 app/Site.elm+3−1 app/View.elm+3−3 public/logo.svg+6 style.css+2−4
app/ErrorPage.elm+7−13
@@ -1,8 +1,8 @@
11module ErrorPage exposing (ErrorPage(..), Model, Msg, head, init, internalError, notFound, statusCode, update, view)
22
33import Effect exposing (Effect)
4+import Element exposing (..)
45import Head
5−import Html exposing (Html)
66import View exposing (View)
77
88
@@ -52,18 +52,12 @@ internalError =
5252view : ErrorPage -> Model -> View Msg
5353view error model =
5454 { body =
55− [ Html.div []
56− [ Html.p []
57− [ Html.text <|
58− case error of
59− NotFound ->
60− "Page not found. Maybe try another URL?"
61−
62− InternalError string ->
63− "Something went wrong.\n" ++ string
64− ]
65− ]
66− ]
55+ case error of
56+ NotFound ->
57+ text "Page not found. Maybe try another URL?"
58+
59+ InternalError string ->
60+ text ("Something went wrong.\n" ++ string)
6761 , title =
6862 case error of
6963 NotFound ->
app/Route/Blog/Slug_.elmdeleted−86
@@ -1,86 +0,0 @@
1−module Route.Blog.Slug_ exposing (ActionData, Data, Model, Msg, route)
2−
3−import BackendTask exposing (BackendTask)
4−import FatalError exposing (FatalError)
5−import Head
6−import Head.Seo as Seo
7−import Html
8−import Pages.Url
9−import PagesMsg exposing (PagesMsg)
10−import RouteBuilder exposing (App, StatelessRoute)
11−import Shared
12−import View exposing (View)
13−
14−
15−type alias Model =
16− {}
17−
18−
19−type alias Msg =
20− ()
21−
22−
23−type alias RouteParams =
24− { slug : String }
25−
26−
27−route : StatelessRoute RouteParams Data ActionData
28−route =
29− RouteBuilder.preRender
30− { head = head
31− , pages = pages
32− , data = data
33− }
34− |> RouteBuilder.buildNoState { view = view }
35−
36−
37−pages : BackendTask FatalError (List RouteParams)
38−pages =
39− BackendTask.succeed
40− [ { slug = "hello" }
41− ]
42−
43−
44−type alias Data =
45− { something : String
46− }
47−
48−
49−type alias ActionData =
50− {}
51−
52−
53−data : RouteParams -> BackendTask FatalError Data
54−data routeParams =
55− BackendTask.map Data
56− (BackendTask.succeed "Hi")
57−
58−
59−head :
60− App Data ActionData RouteParams
61− -> List Head.Tag
62−head app =
63− Seo.summary
64− { canonicalUrlOverride = Nothing
65− , siteName = "elm-pages"
66− , image =
67− { url = Pages.Url.external "TODO"
68− , alt = "elm-pages logo"
69− , dimensions = Nothing
70− , mimeType = Nothing
71− }
72− , description = "TODO"
73− , locale = Nothing
74− , title = "TODO title" -- metadata.title -- TODO
75− }
76− |> Seo.website
77−
78−
79−view :
80− App Data ActionData RouteParams
81− -> Shared.Model
82− -> View (PagesMsg Msg)
83−view app sharedModel =
84− { title = "Placeholder - Blog.Slug_"
85− , body = [ Html.text "You're on the page Blog.Slug_" ]
86− }
app/Route/Greet.elmdeleted−107
@@ -1,107 +0,0 @@
1−module Route.Greet exposing (ActionData, Data, Model, Msg, route)
2−
3−import BackendTask exposing (BackendTask)
4−import BackendTask.Http
5−import ErrorPage exposing (ErrorPage)
6−import FatalError exposing (FatalError)
7−import Head
8−import Head.Seo as Seo
9−import Html
10−import Json.Decode as Decode
11−import Pages.Url
12−import PagesMsg exposing (PagesMsg)
13−import RouteBuilder exposing (App, StatefulRoute, StatelessRoute)
14−import Server.Request as Request exposing (Request)
15−import Server.Response as Response exposing (Response)
16−import Shared
17−import View exposing (View)
18−
19−
20−type alias Model =
21− {}
22−
23−
24−type alias Msg =
25− ()
26−
27−
28−type alias RouteParams =
29− {}
30−
31−
32−route : StatelessRoute RouteParams Data ActionData
33−route =
34− RouteBuilder.serverRender
35− { head = head
36− , data = data
37− , action = \_ _ -> BackendTask.fail (FatalError.fromString "No action.")
38− }
39− |> RouteBuilder.buildNoState { view = view }
40−
41−
42−type alias Data =
43− { name : Maybe String
44− }
45−
46−
47−type alias ActionData =
48− {}
49−
50−
51−data : RouteParams -> Request -> BackendTask FatalError (Response Data ErrorPage)
52−data routeParams request =
53− case request |> Request.queryParam "name" of
54− Just name ->
55− BackendTask.Http.getJson "http://worldtimeapi.org/api/timezone/America/Los_Angeles"
56− (Decode.field "utc_datetime" Decode.string)
57− |> BackendTask.allowFatal
58− |> BackendTask.map
59− (\dateTimeString ->
60− Response.render
61− { name = Just dateTimeString }
62− )
63−
64− Nothing ->
65− BackendTask.succeed
66− (Response.render
67− { name = Nothing }
68− )
69−
70−
71−head :
72− App Data ActionData RouteParams
73− -> List Head.Tag
74−head app =
75− Seo.summary
76− { canonicalUrlOverride = Nothing
77− , siteName = "elm-pages"
78− , image =
79− { url = Pages.Url.external "TODO"
80− , alt = "elm-pages logo"
81− , dimensions = Nothing
82− , mimeType = Nothing
83− }
84− , description = "TODO"
85− , locale = Nothing
86− , title = "TODO title" -- metadata.title -- TODO
87− }
88− |> Seo.website
89−
90−
91−view :
92− App Data ActionData RouteParams
93− -> Shared.Model
94− -> View (PagesMsg Msg)
95−view app shared =
96− { title = "Greetings"
97− , body =
98− [ Html.div []
99− [ case app.data.name of
100− Just name ->
101− Html.text ("Hello " ++ name)
102−
103− Nothing ->
104− Html.text "Hello, I didn't find your name"
105− ]
106− ]
107− }
app/Route/Hello.elmdeleted−119
@@ -1,119 +0,0 @@
1−module Route.Hello exposing (ActionData, Data, Model, Msg(..), RouteParams, action, data, route)
2−
3−import BackendTask exposing (BackendTask)
4−import BackendTask.Http
5−import Effect exposing (Effect)
6−import ErrorPage exposing (ErrorPage)
7−import FatalError exposing (FatalError)
8−import Head
9−import Html
10−import Json.Decode as Decode
11−import PagesMsg exposing (PagesMsg)
12−import RouteBuilder exposing (App)
13−import Server.Request exposing (Request)
14−import Server.Response
15−import Shared
16−import UrlPath exposing (UrlPath)
17−import View exposing (View)
18−
19−
20−type alias Model =
21− {}
22−
23−
24−type Msg
25− = NoOp
26−
27−
28−type alias RouteParams =
29− {}
30−
31−
32−route =
33− RouteBuilder.serverRender { data = data, action = action, head = head }
34− |> RouteBuilder.buildWithLocalState
35− { view = view
36− , subscriptions = subscriptions
37− , update = update
38− , init = init
39− }
40−
41−
42−init :
43− App Data ActionData RouteParams
44− -> Shared.Model
45− -> ( Model, Effect Msg )
46−init app shared =
47− ( {}, Effect.none )
48−
49−
50−update :
51− App Data ActionData RouteParams
52− -> Shared.Model
53− -> Msg
54− -> Model
55− -> ( Model, Effect Msg )
56−update app shared msg model =
57− case msg of
58− NoOp ->
59− ( model, Effect.none )
60−
61−
62−subscriptions :
63− RouteParams
64− -> UrlPath
65− -> Shared.Model
66− -> Model
67− -> Sub Msg
68−subscriptions routeParams path shared model =
69− Sub.none
70−
71−
72−type alias Data =
73− { stars : Int
74− }
75−
76−
77−type alias ActionData =
78− {}
79−
80−
81−data :
82− RouteParams
83− -> Request
84− -> BackendTask FatalError (Server.Response.Response Data ErrorPage)
85−data routeParams request =
86− BackendTask.Http.getWithOptions
87− { url = "https://api.github.com/repos/dillonkearns/elm-pages"
88− , expect = BackendTask.Http.expectJson (Decode.field "stargazers_count" Decode.int)
89− , headers = []
90− , cacheStrategy = Just BackendTask.Http.IgnoreCache
91− , retries = Nothing
92− , timeoutInMs = Nothing
93− , cachePath = Nothing
94− }
95− |> BackendTask.allowFatal
96− |> BackendTask.map
97− (\stars -> Server.Response.render { stars = stars })
98−
99−
100−head : App Data ActionData RouteParams -> List Head.Tag
101−head app =
102− []
103−
104−
105−view :
106− App Data ActionData RouteParams
107− -> Shared.Model
108− -> Model
109− -> View (PagesMsg Msg)
110−view app shared model =
111− { title = "Hello", body = [ Html.text (String.fromInt app.data.stars) ] }
112−
113−
114−action :
115− RouteParams
116− -> Request
117− -> BackendTask.BackendTask FatalError.FatalError (Server.Response.Response ActionData ErrorPage.ErrorPage)
118−action routeParams request =
119− BackendTask.succeed (Server.Response.render {})
app/Route/Index.elm+36−11
@@ -1,16 +1,18 @@
11module Route.Index exposing (ActionData, Data, Model, Msg, route)
22
33import BackendTask exposing (BackendTask)
4+import Element exposing (..)
5+import Element.Background as Background
6+import Element.Font as Font
47import FatalError exposing (FatalError)
58import Head
69import Head.Seo as Seo
7−import Html
810import Pages.Url
911import PagesMsg exposing (PagesMsg)
10−import UrlPath
1112import Route
1213import RouteBuilder exposing (App, StatelessRoute)
1314import Shared
15+import UrlPath
1416import View exposing (View)
1517
1618
@@ -57,16 +59,16 @@ head :
5759head app =
5860 Seo.summary
5961 { canonicalUrlOverride = Nothing
60− , siteName = "elm-pages"
62+ , siteName = "Horeca Productions"
6163 , image =
6264 { url = [ "images", "icon-png.png" ] |> UrlPath.join |> Pages.Url.fromPath
6365 , alt = "elm-pages logo"
6466 , dimensions = Nothing
6567 , mimeType = Nothing
6668 }
67− , description = "Welcome to elm-pages!"
69+ , description = "Welcome to Horeco Productions!"
6870 , locale = Nothing
69− , title = "elm-pages is running"
71+ , title = "Horeca Productions"
7072 }
7173 |> Seo.website
7274
@@ -78,11 +80,34 @@ view :
7880view app shared =
7981 { title = "elm-pages is running"
8082 , body =
81− [ Html.h1 [] [ Html.text "elm-pages is up and running!" ]
82− , Html.p []
83− [ Html.text <| "The message is: " ++ app.data.message
83+ column [ width fill ]
84+ [ column [ width fill, Background.color (rgb255 53 30 30), spacing 88 ]
85+ [ row [ width fill ]
86+ [ el [ width (px 50) ] none
87+ , row [ centerX, width fill, spaceEvenly ]
88+ [ el headerFont (text "услуги")
89+ , el headerFont (text "студия")
90+ , image [ height (px 50) ] { src = "/public/logo.svg", description = "logo" }
91+ , el headerFont (text "работы")
92+ , el headerFont (text "о нас")
93+ ]
94+ , el [ width (px 50) ] none
95+ ]
96+ ]
8497 ]
85− , Route.Blog__Slug_ { slug = "hello" }
86− |> Route.link [] [ Html.text "My blog post" ]
87− ]
8898 }
99+
100+
101+headerFont : List (Attribute msg)
102+headerFont =
103+ [ raleway, Font.size 24, Font.color (rgb255 170 147 32) ]
104+
105+
106+ubuntu : Attribute msg
107+ubuntu =
108+ Font.family [ Font.typeface "Ubuntu" ]
109+
110+
111+raleway : Attribute msg
112+raleway =
113+ Font.family [ Font.typeface "Raleway" ]
app/Shared.elm+3−26
@@ -2,14 +2,14 @@ module Shared exposing (Data, Model, Msg(..), SharedMsg(..), template)
22
33import BackendTask exposing (BackendTask)
44import Effect exposing (Effect)
5+import Element exposing (layout)
56import FatalError exposing (FatalError)
67import Html exposing (Html)
7−import Html.Events
88import Pages.Flags
99import Pages.PageUrl exposing (PageUrl)
10−import UrlPath exposing (UrlPath)
1110import Route exposing (Route)
1211import SharedTemplate exposing (SharedTemplate)
12+import UrlPath exposing (UrlPath)
1313import View exposing (View)
1414
1515
@@ -92,29 +92,6 @@ view :
9292 -> View msg
9393 -> { body : List (Html msg), title : String }
9494view sharedData page model toMsg pageView =
95− { body =
96− [ Html.nav []
97− [ Html.button
98− [ Html.Events.onClick MenuClicked ]
99− [ Html.text
100− (if model.showMenu then
101− "Close Menu"
102−
103− else
104− "Open Menu"
105− )
106− ]
107− , if model.showMenu then
108− Html.ul []
109− [ Html.li [] [ Html.text "Menu item 1" ]
110− , Html.li [] [ Html.text "Menu item 2" ]
111− ]
112−
113− else
114− Html.text ""
115− ]
116− |> Html.map toMsg
117− , Html.main_ [] pageView.body
118− ]
95+ { body = [ layout [] pageView.body ]
11996 , title = pageView.title
12097 }
app/Site.elm+3−1
@@ -3,6 +3,8 @@ module Site exposing (config)
33import BackendTask exposing (BackendTask)
44import FatalError exposing (FatalError)
55import Head
6+import MimeType
7+import Pages.Url
68import SiteConfig exposing (SiteConfig)
79
810
@@ -16,6 +18,6 @@ config =
1618head : BackendTask FatalError (List Head.Tag)
1719head =
1820 [ Head.metaName "viewport" (Head.raw "width=device-width,initial-scale=1")
19− , Head.sitemapLink "/sitemap.xml"
21+ , Head.icon [] (MimeType.OtherImage "svg") (Pages.Url.external "/public/logo.svg")
2022 ]
2123 |> BackendTask.succeed
app/View.elm+3−3
@@ -6,13 +6,13 @@ module View exposing (View, map)
66
77-}
88
9−import Html exposing (Html)
9+import Element exposing (Element)
1010
1111
1212{-| -}
1313type alias View msg =
1414 { title : String
15− , body : List (Html msg)
15+ , body : Element msg
1616 }
1717
1818
@@ -20,5 +20,5 @@ type alias View msg =
2020map : (msg1 -> msg2) -> View msg1 -> View msg2
2121map fn doc =
2222 { title = doc.title
23− , body = List.map (Html.map fn) doc.body
23+ , body = Element.map fn doc.body
2424 }
public/logo.svgnew file+6
@@ -0,0 +1,6 @@
1+<svg width="114" height="188" viewBox="0 0 114 188" fill="none" xmlns="http://www.w3.org/2000/svg">
2+<path d="M71.4 102.428C67.9013 102.428 64.6213 102.154 61.56 101.608C58.3893 101.061 56.2027 100.514 55 99.9678L57.132 90.7838C58.0067 91.2211 59.8107 91.6585 62.544 92.0958C65.168 92.6425 68.6667 92.9158 73.04 92.9158C77.632 92.9158 81.3493 92.5878 84.192 91.9318C86.9253 91.2758 88.7293 90.7291 89.604 90.2918V15.9998H100.264V96.8518C97.5307 98.0545 93.7587 99.257 88.948 100.46C84.1373 101.772 78.288 102.428 71.4 102.428Z" fill="#AA9320"/>
3+<path d="M71.4 94C67.9013 94 64.6213 94.2733 61.56 94.82C58.3893 95.3667 56.2027 95.9133 55 96.46L57.132 105.644C58.0067 105.207 59.8107 104.769 62.544 104.332C65.168 103.785 68.6667 103.512 73.04 103.512C77.632 103.512 81.3493 103.84 84.192 104.496C86.9253 105.152 88.7293 105.699 89.604 106.136V180.428H100.264V99.576C97.5307 98.3733 93.7587 97.1707 88.948 95.968C84.1373 94.656 78.288 94 71.4 94Z" fill="#AA9320"/>
4+<path d="M42.864 102.428C46.3627 102.428 49.6427 102.154 52.704 101.608C55.8747 101.061 58.0613 100.514 59.264 99.9678L57.132 90.7838C56.2573 91.2211 54.4533 91.6585 51.72 92.0958C49.096 92.6425 45.5973 92.9158 41.224 92.9158C36.632 92.9158 32.9147 92.5878 30.072 91.9318C27.3387 91.2758 25.5347 90.7291 24.66 90.2918V15.9998H14V96.8518C16.7333 98.0545 20.5053 99.257 25.316 100.46C30.1267 101.772 35.976 102.428 42.864 102.428Z" fill="#AA9320"/>
5+<path d="M42.864 94C46.3627 94 49.6427 94.2733 52.704 94.82C55.8747 95.3667 58.0613 95.9133 59.264 96.46L57.132 105.644C56.2573 105.207 54.4533 104.769 51.72 104.332C49.096 103.785 45.5973 103.512 41.224 103.512C36.632 103.512 32.9147 103.84 30.072 104.496C27.3387 105.152 25.5347 105.699 24.66 106.136V180.428H14V99.576C16.7333 98.3733 20.5053 97.1707 25.316 95.968C30.1267 94.656 35.976 94 42.864 94Z" fill="#AA9320"/>
6+</svg>
style.css+2−4
@@ -1,4 +1,2 @@
1−body {
2− font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
3− sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
4−}
1+@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');
2+@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');