Skip to content

Commit 3d64c0f

Browse files
committed
wip
1 parent f2eba03 commit 3d64c0f

File tree

7 files changed

+68
-74
lines changed

7 files changed

+68
-74
lines changed

ghcjs/delivery-calculator/src/App/Widgets/Main.hs

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,15 @@ import Miso hiding (at, view)
1717

1818
mainWidget :: Model -> View Action
1919
mainWidget st =
20-
Grid.grid mempty
21-
$ [ div_
22-
[ class_ "container"
23-
]
24-
( Menu.menu st
25-
<> screenWidget st
26-
<> [ -- LayoutGrid.cell [LayoutGrid.span12]
27-
-- . (: mempty)
28-
-- $ div_
29-
-- mempty
30-
-- [ text . inspect $ st ^. #modelFavMap
31-
-- ],
32-
tosWidget
33-
]
34-
)
20+
section_
21+
[ class_ "main-widget"
22+
]
23+
$ [ header_ mempty $ Menu.menu st
3524
]
25+
<> [ main_ [class_ "main-widget-middle"] $ screenWidget st
26+
]
27+
<> [ footer_ mempty tosWidget
28+
]
3629
<> ( if st ^. #modelLoading
3730
then
3831
[ div_
@@ -217,20 +210,19 @@ foldFieldPair :: Rational -> FieldPair DynamicField f -> Rational
217210
foldFieldPair acc =
218211
foldField acc . fieldPairValue
219212

220-
tosWidget :: View Action
213+
tosWidget :: [View Action]
221214
tosWidget =
222-
Grid.cell
223-
[ Miso.text "\169 2024 ",
224-
BrowserLink.browserLink
225-
BrowserLink.Args
226-
{ BrowserLink.argsLink = functoraLink,
227-
BrowserLink.argsLabel = "Functora",
228-
BrowserLink.argsAction = PushUpdate . Instant
229-
},
230-
Miso.text ". All rights reserved. ",
231-
Miso.text "By continuing to use this software, you agree to the ",
232-
a_ [href_ "license.html"] [Miso.text "Terms of Service"],
233-
Miso.text " and ",
234-
a_ [href_ "privacy.html"] [Miso.text "Privacy Policy"],
235-
Miso.text $ ". Version " <> vsn <> "."
236-
]
215+
[ Miso.text "\169 2024 ",
216+
BrowserLink.browserLink
217+
BrowserLink.Args
218+
{ BrowserLink.argsLink = functoraLink,
219+
BrowserLink.argsLabel = "Functora",
220+
BrowserLink.argsAction = PushUpdate . Instant
221+
},
222+
Miso.text ". All rights reserved. ",
223+
Miso.text "By continuing to use this software, you agree to the ",
224+
a_ [href_ "license.html"] [Miso.text "Terms of Service"],
225+
Miso.text " and ",
226+
a_ [href_ "privacy.html"] [Miso.text "Privacy Policy"],
227+
Miso.text $ ". Version " <> vsn <> "."
228+
]

ghcjs/delivery-calculator/src/App/Widgets/Menu.hs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,18 @@ import qualified Text.URI as URI
2121

2222
menu :: Model -> [View Action]
2323
menu st =
24-
[ div_
25-
[class_ "no-print"]
26-
[ button_
27-
[ onClick opened
28-
]
29-
[ text "menu"
30-
],
31-
a_
32-
[ style_ [("cursor", "pointer")],
33-
onClick . PushUpdate . Instant . ImpureUpdate $ do
24+
[ menu_
25+
[ class_ "no-print"
26+
]
27+
[ li_ [onClick opened] [text "menu"],
28+
li_
29+
[ onClick . PushUpdate . Instant . ImpureUpdate $ do
3430
doc <- liftIO newSt
3531
pure $ #modelState .~ doc
3632
]
3733
[ text "Delivery Calculator"
3834
],
39-
button_
35+
li_
4036
[ onClick
4137
. PushUpdate
4238
. Instant
@@ -46,7 +42,7 @@ menu st =
4642
]
4743
[ text "favorite"
4844
],
49-
button_
45+
li_
5046
[ onClick
5147
. PushUpdate
5248
. Instant
@@ -57,7 +53,7 @@ menu st =
5753
]
5854
[ text "print"
5955
],
60-
button_
56+
li_
6157
[ onClick
6258
. PushUpdate
6359
. Instant
@@ -71,7 +67,7 @@ menu st =
7167
]
7268
[ text "download"
7369
],
74-
button_
70+
li_
7571
[ onClick
7672
. PushUpdate
7773
. Instant

ghcjs/delivery-calculator/src/Main.hs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,19 +239,17 @@ viewModel st =
239239
mainWidget st
240240
#else
241241
viewModel st =
242-
div_
243-
mempty
242+
prependViews
244243
[ link_
245244
[ rel_ "stylesheet",
246245
href_ "node_modules/@lowlighter/matcha/dist/matcha.css"
247246
],
248247
link_
249-
[ rel_
250-
"stylesheet",
248+
[ rel_ "stylesheet",
251249
href_ "static/app.css"
252-
],
253-
mainWidget st
250+
]
254251
]
252+
$ mainWidget st
255253
#endif
256254

257255
extendedEvents :: Map Unicode Bool

ghcjs/delivery-calculator/static/app.css

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
html {
2+
width: 100vw;
3+
min-height: 100vh;
4+
}
5+
6+
html, main {
7+
margin: 0;
8+
padding: 0;
9+
}
10+
11+
footer {
12+
padding-bottom: 18px;
13+
}
14+
15+
.main-widget {
216
margin: 0;
317
padding: 0;
418
width: 100vw;
519
min-height: 100vh;
6-
display: flex;
720
overflow-x: hidden;
8-
align-items: center;
9-
justify-content: center;
21+
display: flex;
22+
flex-direction: column;
23+
justify-content: space-between;
1024
}
1125

12-
a {
13-
color: inherit;
26+
.main-widget-middle {
27+
max-width: 550px;
1428
}
1529

1630
textarea {
@@ -19,24 +33,6 @@ textarea {
1933
min-height: 72px;
2034
}
2135

22-
.container {
23-
max-width: 550px;
24-
}
25-
26-
.app-success > span {
27-
color: white;
28-
background-color: #018786 !important;
29-
display: flex;
30-
justify-content: center;
31-
}
32-
33-
.app-failure > span {
34-
color: white;
35-
background-color: #b00020 !important;
36-
display: flex;
37-
justify-content: center;
38-
}
39-
4036
@media print {
4137
body {
4238
color-adjust: exact !important;

ghcjs/miso-functora/src/Functora/Miso/Types.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ module Functora.Miso.Types
4343
uniqueToIdentity,
4444
identityToUnique,
4545
keyed,
46+
prependViews,
4647
TopOrBottom (..),
4748
OnlineOrOffline (..),
4849
StaticOrDynamic (..),
@@ -498,6 +499,11 @@ keyed uid = \case
498499
x ->
499500
x
500501

502+
prependViews :: [View action] -> View action -> View action
503+
prependViews xs = \case
504+
Node a b c d e -> Node a b c d $ xs <> e
505+
x -> x
506+
501507
data TopOrBottom
502508
= Top
503509
| Bottom

pub/vi/nix/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ in
9090
gleam-vim
9191
neoformat
9292
vim-terraform
93+
vim-commentary
9394
#
9495
# Productivity
9596
#

pub/vi/vimrc.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,11 @@ map <M-g> zg
717717
" Suggest
718718
map <M-s> z=
719719
720+
"
721+
" => Comments
722+
"
723+
map <leader>\ gc
724+
720725
"
721726
" => LanguageTool
722727
"

0 commit comments

Comments
 (0)