diff --git a/README.md b/README.md index 0101597..ffe90e2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ -# dashboard-starter +# Determine Paper Cost -This is starter repo for frontend project. With stack of Svelte, Tailwind, TypeScript, Charts.js, Fontawesome ## Tech Stack @@ -14,16 +13,11 @@ This is starter repo for frontend project. With stack of Svelte, Tailwind, TypeS Tools ```bash --> Posthog (For track) --> Chart.js (For chart) --> Tippy.js (For tooltip) --> @inlang/sdk-js (For language support) --> svelte-fa (fontawesome icons) ``` ## After Cloning this project -If you're seeing this, you've probably already done this step. Congrats! +You will need to install dependency! ```bash # install all dependency diff --git a/src/lib/elements/Button.svelte b/src/lib/elements/Button.svelte new file mode 100644 index 0000000..6c8230f --- /dev/null +++ b/src/lib/elements/Button.svelte @@ -0,0 +1,13 @@ + + + diff --git a/src/lib/elements/Input.svelte b/src/lib/elements/Input.svelte index 74ba4ee..05ec5b5 100644 --- a/src/lib/elements/Input.svelte +++ b/src/lib/elements/Input.svelte @@ -1,19 +1,30 @@ ($focusedInputStore = inputRef)} /> diff --git a/src/lib/stores/index.ts b/src/lib/stores/index.ts index 2777f75..92c0287 100644 --- a/src/lib/stores/index.ts +++ b/src/lib/stores/index.ts @@ -1,6 +1,6 @@ import type { Paper } from '$lib/utils/services' import { persisted } from 'svelte-persisted-store' -import type { Writable } from 'svelte/store' +import { writable, type Writable } from 'svelte/store' export type PaperHistory = { id: string @@ -13,3 +13,4 @@ function getPaperStore(): Writable<{ history: PaperHistory[] }> { } export const paperHistoryStore = getPaperStore() +export const focusedInputStore: Writable = writable(null) diff --git a/src/lib/utils/services.ts b/src/lib/utils/services.ts index cb1f4d8..6a1eaa2 100644 --- a/src/lib/utils/services.ts +++ b/src/lib/utils/services.ts @@ -1,6 +1,6 @@ export type Paper = { id: string - height: string + length: string width: string thickness: string rate: string diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 57052eb..3bfb320 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,5 +1,4 @@ @@ -84,36 +135,39 @@
-

Paper Cost

+

Paper Cost

-
+
{#each paperCount as paper, i} -
-
-

- Paper {i + 1} -

- +
+
-
-
{#each fields as field} - + handleKeyDown(event)} + /> {/each} -
-

- = {perPaperResult.get(paper.id)?.toFixed(2) || 'total'} -

-
+
+
+

+ = {perPaperResult.get(paper.id)?.toFixed(2) || 'total'} +

{/each} @@ -121,24 +175,14 @@
- -
- {#if finalPrice} - - {/if} -
-
- + disabled={paperCount.length == MAX_PAPER} + text="Add paper" + /> {#if finalPrice} +
+ +
+ {#if finalPrice} + {/if}
diff --git a/src/routes/history/+page.svelte b/src/routes/history/+page.svelte index b244c42..d11e5e4 100644 --- a/src/routes/history/+page.svelte +++ b/src/routes/history/+page.svelte @@ -1,7 +1,6 @@
diff --git a/static/logo.jpeg b/static/logo.jpeg new file mode 100644 index 0000000..76611a2 Binary files /dev/null and b/static/logo.jpeg differ diff --git a/static/manifest.json b/static/manifest.json index 37bf32b..9beae54 100644 --- a/static/manifest.json +++ b/static/manifest.json @@ -4,15 +4,15 @@ "start_url": "/", "icons": [ { - "src": "logo.png", - "type": "image/png", + "src": "logo.jpeg", + "type": "image/jpeg", "sizes": "512x512", "purpose": "any maskable" } ], - "background_color": "#3367D6", + "background_color": "#000", "display": "standalone", "scope": "/", - "theme_color": "#3367D6", + "theme_color": "#000", "description": "Paper Cost Calculator" }