From 63b6c18833e71adb9c3e2c17e33658264c9b6f68 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Mon, 17 May 2021 10:07:01 -0400 Subject: [PATCH] add svench --- .gitignore | 1 + .prettierrc | 6 -- CHANGELOG.md | 1 + package.json | 12 ++- public/global.css | 5 + src/components/App.svelte | 137 ++++++++++++++------------- src/components/Output/Json.svench | 13 +++ src/components/Ribbon.svelte | 4 + src/components/Section/index.svelte | 15 ++- src/components/ShipItem/index.svelte | 78 ++++++++++----- 10 files changed, 167 insertions(+), 105 deletions(-) delete mode 100644 .prettierrc create mode 100644 src/components/Output/Json.svench create mode 100644 src/components/Ribbon.svelte diff --git a/.gitignore b/.gitignore index 4a36c83..7e3be73 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ node_modules .svelte-kit/ .vercel_build_output/ package-lock.json +.svench diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index ff2677e..0000000 --- a/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "useTabs": true, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100 -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 861c64d..c50aa46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ ## Next +* Add svench. * Switch to Sveltekit. diff --git a/package.json b/package.json index b909719..b52b73d 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,15 @@ }, "devDependencies": { "@sveltejs/kit": "^1.0.0-next.107", + "@sveltejs/vite-plugin-svelte": "^1.0.0-next.10", "eslint": "^7.22.0", "eslint-config-prettier": "^8.1.0", "eslint-plugin-svelte3": "^3.2.0", "prettier": "~2.2.1", "prettier-plugin-svelte": "^2.2.0", "svelte": "^3.34.0", - "vite": "^2.2.3" + "svench": "^0.2.0-14", + "vite": "^2.3.2" }, "type": "module", "dependencies": { @@ -29,5 +31,13 @@ "reselect": "^4.0.0", "ts-action": "^11.0.0", "updux": "link:/home/yanick/work/javascript/updux/" + }, + "prettier": { + "svelteSortOrder": "options-markup-scripts-styles", + "svelteStrictMode": false, + "svelteAllowShorthand": true, + "plugins": [ + "prettier-plugin-svelte" + ] } } diff --git a/public/global.css b/public/global.css index 92df750..f3f5cd6 100644 --- a/public/global.css +++ b/public/global.css @@ -24,6 +24,10 @@ h1 { font-size: var(--font-scale-14); } +h2 { + font-size: var(--font-scale-12); +} + html, body { position: relative; @@ -107,3 +111,4 @@ input:focus, select:focus { input.short { width:5em; } + diff --git a/src/components/App.svelte b/src/components/App.svelte index 9d3ed91..c22b6a4 100644 --- a/src/components/App.svelte +++ b/src/components/App.svelte @@ -1,90 +1,93 @@ +
- {#if show_notes} - + {/if} -{#if output === 'json'} - set_output(null)}/> - {:else if output === 'print' } - +{#if output === "json"} + set_output(null)} /> +{:else if output === "print"} + {:else} +
+ -
+ - + - +
+ - + -
- + - + {#each weapons as weapon (weapon.id)} + + {/each} +
- - - {#each weapons as weapon (weapon.id)} - - {/each} - -
- - - - -
+ +
- {/if} + @@ -159,7 +162,6 @@ flex: 1; } - :global(main > *) { grid-column: 1; } @@ -174,7 +176,8 @@ text-align: right; } - .notes { + .about { margin-right: 2em; } + diff --git a/src/components/Output/Json.svench b/src/components/Output/Json.svench new file mode 100644 index 0000000..c30e407 --- /dev/null +++ b/src/components/Output/Json.svench @@ -0,0 +1,13 @@ + + + + + + diff --git a/src/components/Ribbon.svelte b/src/components/Ribbon.svelte new file mode 100644 index 0000000..1dd6abf --- /dev/null +++ b/src/components/Ribbon.svelte @@ -0,0 +1,4 @@ + + + diff --git a/src/components/Section/index.svelte b/src/components/Section/index.svelte index 934edf2..19f58d5 100644 --- a/src/components/Section/index.svelte +++ b/src/components/Section/index.svelte @@ -1,12 +1,13 @@
-

{label}

-
+

{label}

+
+ + diff --git a/src/components/ShipItem/index.svelte b/src/components/ShipItem/index.svelte index 53c2fdb..1808be6 100644 --- a/src/components/ShipItem/index.svelte +++ b/src/components/ShipItem/index.svelte @@ -1,10 +1,10 @@ -
+
-
{ mass }
-
{ cost }
+
{mass}
+
{cost}