short-term fixes

This commit is contained in:
2021-11-02 09:04:30 +01:00
parent 5750b4c8f6
commit dd3754f4d5
6 changed files with 30 additions and 78 deletions

View File

@@ -9,6 +9,5 @@
"@parcel/compressor-gzip",
"@parcel/compressor-brotli"
]
},
"reporters": ["...", "parcel-reporter-static-files-copy"]
}
}

View File

@@ -34,10 +34,8 @@
128,
256,
512
]
}
},
"staticFiles": {
"staticPath": "src/static"
],
"genFavicons": true
}
}
}

View File

@@ -1,41 +0,0 @@
module Loading exposing (..)
import Html as H exposing (Html)
import Html.Attributes as HA
import Html.Events as HE
type alias Model =
Int
type Msg
= Dec
| Inc
| Done
init =
0
view mdl =
H.div []
[ H.button [ HE.onClick Dec ] [ H.text "-" ]
, H.button [ HE.onClick Inc ] [ H.text "+" ]
, H.text <| String.fromInt mdl
, H.button [ HE.onClick Done ] [ H.text "done" ]
]
update : Msg -> Model -> Model
update msg mdl =
case msg of
Dec ->
mdl - 1
Inc ->
mdl + 1
_ ->
mdl

View File

@@ -4,48 +4,44 @@ import Browser as B
import Html as H exposing (Html)
import Html.Attributes as HA
import Html.Events as HE
import Loading
import List exposing (isEmpty)
main : Program () Model Msg
main =
B.sandbox { init = init, update = update, view = view }
B.element
{ init = init
, update = update
, view = view
, subscriptions = subscriptions
}
type Model
= LoadingMdl Loading.Model
| EmptyMdl
= EmptyMdl
type Msg
= LoadingMsg Loading.Msg
= Msg
init : Model
init =
LoadingMdl Loading.init
init : flags -> (Model, Cmd msg)
init _ =
(EmptyMdl, Cmd.none)
update : Msg -> Model -> (Model, Cmd msg)
update msg mdl =
case ( msg, mdl ) of
( _, EmptyMdl ) ->
(EmptyMdl, Cmd.none)
view : Model -> Html Msg
view mdl =
case mdl of
LoadingMdl m ->
H.map LoadingMsg <| Loading.view m
EmptyMdl ->
H.div [] []
H.div [] [ H.text "Test" ]
update : Msg -> Model -> Model
update msg_ mdl_ =
case ( msg_, mdl_ ) of
( LoadingMsg msg, LoadingMdl mdl ) ->
case msg of
Loading.Done ->
EmptyMdl
_ ->
LoadingMdl <| Loading.update msg mdl
( _, EmptyMdl ) ->
EmptyMdl
subscriptions : Model -> Sub msg
subscriptions mdl = Sub.none

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -3,8 +3,8 @@ import { precacheAndRoute, matchPrecache } from 'workbox-precaching';
import { setCatchHandler } from 'workbox-routing';
const manifestVersionPair = manifest.map ( x => {
return { url : x , revision : version };
});
precacheAndRoute(manifestVersionPair);
// const manifestVersionPair = manifest.map ( x => {
// return { url : x , revision : version };
// });
//
// precacheAndRoute(manifestVersionPair);