short-term fixes
This commit is contained in:
@@ -9,6 +9,5 @@
|
|||||||
"@parcel/compressor-gzip",
|
"@parcel/compressor-gzip",
|
||||||
"@parcel/compressor-brotli"
|
"@parcel/compressor-brotli"
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
"reporters": ["...", "parcel-reporter-static-files-copy"]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,10 +34,8 @@
|
|||||||
128,
|
128,
|
||||||
256,
|
256,
|
||||||
512
|
512
|
||||||
]
|
],
|
||||||
|
"genFavicons": true
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"staticFiles": {
|
|
||||||
"staticPath": "src/static"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -4,48 +4,44 @@ import Browser as B
|
|||||||
import Html as H exposing (Html)
|
import Html as H exposing (Html)
|
||||||
import Html.Attributes as HA
|
import Html.Attributes as HA
|
||||||
import Html.Events as HE
|
import Html.Events as HE
|
||||||
import Loading
|
import List exposing (isEmpty)
|
||||||
|
|
||||||
|
|
||||||
main : Program () Model Msg
|
main : Program () Model Msg
|
||||||
main =
|
main =
|
||||||
B.sandbox { init = init, update = update, view = view }
|
B.element
|
||||||
|
{ init = init
|
||||||
|
, update = update
|
||||||
|
, view = view
|
||||||
|
, subscriptions = subscriptions
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
type Model
|
type Model
|
||||||
= LoadingMdl Loading.Model
|
= EmptyMdl
|
||||||
| EmptyMdl
|
|
||||||
|
|
||||||
|
|
||||||
type Msg
|
type Msg
|
||||||
= LoadingMsg Loading.Msg
|
= Msg
|
||||||
|
|
||||||
|
|
||||||
init : Model
|
init : flags -> (Model, Cmd msg)
|
||||||
init =
|
init _ =
|
||||||
LoadingMdl Loading.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 : Model -> Html Msg
|
||||||
view mdl =
|
view mdl =
|
||||||
case mdl of
|
case mdl of
|
||||||
LoadingMdl m ->
|
|
||||||
H.map LoadingMsg <| Loading.view m
|
|
||||||
|
|
||||||
EmptyMdl ->
|
EmptyMdl ->
|
||||||
H.div [] []
|
H.div [] [ H.text "Test" ]
|
||||||
|
|
||||||
|
subscriptions : Model -> Sub msg
|
||||||
update : Msg -> Model -> Model
|
subscriptions mdl = Sub.none
|
||||||
update msg_ mdl_ =
|
|
||||||
case ( msg_, mdl_ ) of
|
|
||||||
( LoadingMsg msg, LoadingMdl mdl ) ->
|
|
||||||
case msg of
|
|
||||||
Loading.Done ->
|
|
||||||
EmptyMdl
|
|
||||||
|
|
||||||
_ ->
|
|
||||||
LoadingMdl <| Loading.update msg mdl
|
|
||||||
|
|
||||||
( _, EmptyMdl ) ->
|
|
||||||
EmptyMdl
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 39 KiB |
@@ -3,8 +3,8 @@ import { precacheAndRoute, matchPrecache } from 'workbox-precaching';
|
|||||||
import { setCatchHandler } from 'workbox-routing';
|
import { setCatchHandler } from 'workbox-routing';
|
||||||
|
|
||||||
|
|
||||||
const manifestVersionPair = manifest.map ( x => {
|
// const manifestVersionPair = manifest.map ( x => {
|
||||||
return { url : x , revision : version };
|
// return { url : x , revision : version };
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
precacheAndRoute(manifestVersionPair);
|
// precacheAndRoute(manifestVersionPair);
|
||||||
|
|||||||
Reference in New Issue
Block a user