diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..c5f276e --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,17 @@ +# yaml-language-server: $schema=https://taskfile.dev/schema.json + +version: '3' + +vars: + GREETING: Hello, world! + +tasks: + default: + desc: Print a greeting message + cmds: + - echo "{{.GREETING}}" + silent: true + + start: + cmds: + - cd pwa && npm start diff --git a/pwa/index.html b/pwa/index.html index a502938..667d7a1 100644 --- a/pwa/index.html +++ b/pwa/index.html @@ -2,7 +2,10 @@ - + Tag Notes diff --git a/pwa/src/App.module.css b/pwa/src/App.module.css index 0ef0d63..f35e797 100644 --- a/pwa/src/App.module.css +++ b/pwa/src/App.module.css @@ -7,5 +7,6 @@ .content { flex: 1; overflow-y: auto; + overscroll-behavior: contain; padding-bottom: calc(56px + env(safe-area-inset-bottom)); } diff --git a/pwa/src/components/NavBar.module.css b/pwa/src/components/NavBar.module.css index 96835ea..c3da888 100644 --- a/pwa/src/components/NavBar.module.css +++ b/pwa/src/components/NavBar.module.css @@ -8,6 +8,8 @@ padding: 0.75rem 1rem; background: #fff; border-bottom: 1px solid #e5e5ea; + transform: translateZ(0); + will-change: transform; } .side { diff --git a/pwa/src/index.css b/pwa/src/index.css index cef460c..4da9560 100644 --- a/pwa/src/index.css +++ b/pwa/src/index.css @@ -8,8 +8,16 @@ body, height: 100%; } +html { + overscroll-behavior: none; + touch-action: pan-x pan-y; +} + body { margin: 0; + overflow: hidden; + position: fixed; + inset: 0; font-family: -apple-system, BlinkMacSystemFont, @@ -19,4 +27,5 @@ body { Arial, sans-serif; -webkit-font-smoothing: antialiased; + -webkit-text-size-adjust: 100%; } diff --git a/pwa/src/routes/Food.module.css b/pwa/src/routes/Food.module.css index 6789bc2..7c730d9 100644 --- a/pwa/src/routes/Food.module.css +++ b/pwa/src/routes/Food.module.css @@ -2,9 +2,15 @@ display: flex; flex-direction: column; height: 100%; + overflow-y: auto; + overscroll-behavior: contain; +} + +.body { + display: flex; + flex-direction: column; padding: 1rem; gap: 1rem; - overflow-y: auto; } .stats { diff --git a/pwa/src/routes/Food.tsx b/pwa/src/routes/Food.tsx index 86ffdd7..87ddd4f 100644 --- a/pwa/src/routes/Food.tsx +++ b/pwa/src/routes/Food.tsx @@ -117,135 +117,137 @@ function Food() { return (
-
-
-
-
{remainingProtein()}g
-
protein left
+
+
+
+
+
{remainingProtein()}g
+
protein left
+
+
+
{remainingCalories()}
+
calories left
+
-
-
{remainingCalories()}
-
calories left
+
+ + {Math.round(totals().protein)}g / {targets().protein}g protein + + + {Math.round(totals().calories)} / {targets().calories} cal + + {Math.round(totals().carbs)}g carbs
-
- - {Math.round(totals().protein)}g / {targets().protein}g protein - - - {Math.round(totals().calories)} / {targets().calories} cal - - {Math.round(totals().carbs)}g carbs -
-
-
void handleSubmit(event)}> - updateField('name', event.currentTarget.value)} - /> -
- updateField('protein', event.currentTarget.value)} - /> - updateField('calories', event.currentTarget.value)} - /> + void handleSubmit(event)}> updateField('carbs', event.currentTarget.value)} + type="text" + class={styles.nameInput} + placeholder="Food name" + value={form().name} + onInput={(event) => updateField('name', event.currentTarget.value)} /> -
-
- updateField('quantity', event.currentTarget.value)} - /> - - - - -
-
- - 0}> -
-
Recent foods
-
- + + + +
+ + + 0}> +
+
Recent foods
+
+ + {(entry) => ( + + )} + +
+
+
+ + 0} + fallback={
No food logged today
} + > +
+ {(entry) => ( - +
+ + +
)}
-
-
- - 0} - fallback={
No food logged today
} - > -
- - {(entry) => ( -
- - -
- )} -
-
-
+ +
); }