From d21f07929d443d07eeefc0f4a19a7049f33fc2b4 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sun, 20 Mar 2022 14:15:00 -0400 Subject: [PATCH 1/3] add chota --- package.json | 2 ++ src/lib/style/index.js | 1 + 2 files changed, 3 insertions(+) diff --git a/package.json b/package.json index 422941b..7835ef8 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,12 @@ "@storybook/addon-svelte-csf": "^1.1.0", "@storybook/svelte": "^6.4.19", "@sveltejs/adapter-node": "^1.0.0-next.0", + "chota": "^0.8.0", "lodash": "^4.17.21", "redux": "^4.1.2", "reselect": "^4.1.5", "rollup-plugin-analyzer": "^4.0.0", + "svelte-chota": "^1.8.6", "svelte-knobby": "^0.3.4", "ts-action": "^11.0.0", "updux": "link:/home/yanick/work/javascript/updux-js/", diff --git a/src/lib/style/index.js b/src/lib/style/index.js index 53d4749..86e7d49 100644 --- a/src/lib/style/index.js +++ b/src/lib/style/index.js @@ -1,4 +1,5 @@ import "../../../static/fonts/faktos.css"; import "../../../static/fonts/dosis/dosis.css"; import "../../../static/global.css"; +import 'chota'; import "./index.css"; From 4f9c70020a3725b5f9fc40603f5f01858590967f Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sat, 19 Mar 2022 19:21:49 -0400 Subject: [PATCH 2/3] replace lodash function --- .../components/ShipEdit/Weaponry/Weapon/Beam/index.svelte | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/components/ShipEdit/Weaponry/Weapon/Beam/index.svelte b/src/lib/components/ShipEdit/Weaponry/Weapon/Beam/index.svelte index 8e031d3..0ba11a7 100644 --- a/src/lib/components/ShipEdit/Weaponry/Weapon/Beam/index.svelte +++ b/src/lib/components/ShipEdit/Weaponry/Weapon/Beam/index.svelte @@ -53,7 +53,6 @@ function setArcs(firstArc) { - console.log(firstArc); if (nbrArcs === "broadside") { arcs = broadside; return; @@ -61,12 +60,10 @@ let first_index = all_arcs.findIndex((arc) => arc === firstArc); if (first_index === -1) first_index = 0; - console.log({arcs, label:"before"}); - arcs = _.range(nbrArcs).map( - (i) => all_arcs[(first_index + i) % all_arcs.length] + arcs = Array.from({length: nbrArcs}).map( + (_dummy,i) => all_arcs[(first_index + i) % all_arcs.length] ); arcsCaches = arcs.join(','); - console.log({arcs, label:"after"}); } $: if (arcs.length !== nbrArcs) setArcs(arcs[0]); From 629bffdc9f806b8c59f3c2df317f2130db5eda47 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Sun, 20 Mar 2022 14:42:59 -0400 Subject: [PATCH 3/3] adjust styles for chota --- .../ShipEdit/Carrier/Squadron.svelte | 3 +++ .../components/ShipEdit/Carrier/index.svelte | 2 +- .../ShipEdit/Propulsion/Drive/index.svelte | 2 +- src/lib/components/ShipEdit/ShipCost.svelte | 5 +++-- .../components/ShipEdit/Structure/Armor.svelte | 2 +- .../ShipEdit/Structure/Armor/Layer.svelte | 2 +- .../components/ShipEdit/Structure/Cargo.svelte | 2 +- .../components/ShipEdit/Structure/Hull.svelte | 2 +- .../ShipEdit/Structure/Screens.svelte | 4 ++-- .../ShipEdit/Weaponry/AddWeapon.svelte | 9 ++++++++- src/lib/style/index.css | 4 ++++ src/routes/index.svelte | 5 +---- static/global.css | 18 ------------------ 13 files changed, 27 insertions(+), 33 deletions(-) diff --git a/src/lib/components/ShipEdit/Carrier/Squadron.svelte b/src/lib/components/ShipEdit/Carrier/Squadron.svelte index 6f46f46..4b17645 100644 --- a/src/lib/components/ShipEdit/Carrier/Squadron.svelte +++ b/src/lib/components/ShipEdit/Carrier/Squadron.svelte @@ -30,4 +30,7 @@ $: dispatch.setSquadronType({type, id}); diff --git a/src/lib/components/ShipEdit/Carrier/index.svelte b/src/lib/components/ShipEdit/Carrier/index.svelte index cb69ac8..53b8907 100644 --- a/src/lib/components/ShipEdit/Carrier/index.svelte +++ b/src/lib/components/ShipEdit/Carrier/index.svelte @@ -1,7 +1,7 @@
- + diff --git a/src/lib/components/ShipEdit/Propulsion/Drive/index.svelte b/src/lib/components/ShipEdit/Propulsion/Drive/index.svelte index a092b2d..75d8eef 100644 --- a/src/lib/components/ShipEdit/Propulsion/Drive/index.svelte +++ b/src/lib/components/ShipEdit/Propulsion/Drive/index.svelte @@ -1,7 +1,7 @@
- + diff --git a/src/lib/components/ShipEdit/ShipCost.svelte b/src/lib/components/ShipEdit/ShipCost.svelte index 969b577..5589309 100644 --- a/src/lib/components/ShipEdit/ShipCost.svelte +++ b/src/lib/components/ShipEdit/ShipCost.svelte @@ -1,6 +1,6 @@
- +
@@ -53,6 +53,7 @@ } input { width: 5em; + display: inline !important; } .mass_symbol:after { content: url("/mass.svg"); @@ -74,7 +75,7 @@ } .mass { - grid-column: 2; + width: 15em; } div.cost { grid-column: 3; diff --git a/src/lib/components/ShipEdit/Structure/Armor.svelte b/src/lib/components/ShipEdit/Structure/Armor.svelte index de581f2..b4a3a45 100644 --- a/src/lib/components/ShipEdit/Structure/Armor.svelte +++ b/src/lib/components/ShipEdit/Structure/Armor.svelte @@ -2,7 +2,7 @@
- +
diff --git a/src/lib/components/ShipEdit/Structure/Armor/Layer.svelte b/src/lib/components/ShipEdit/Structure/Armor/Layer.svelte index b6dab9e..ec80415 100644 --- a/src/lib/components/ShipEdit/Structure/Armor/Layer.svelte +++ b/src/lib/components/ShipEdit/Structure/Armor/Layer.svelte @@ -1,5 +1,5 @@ - + + + diff --git a/src/lib/style/index.css b/src/lib/style/index.css index 2717525..8d3300d 100644 --- a/src/lib/style/index.css +++ b/src/lib/style/index.css @@ -2,3 +2,7 @@ --main-font-family: "Dosis", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } + +input.short { + width: 5em !important; +} diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 591acee..df71d56 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -3,10 +3,7 @@