From 0268359eefbee645145c9506f0a0a9afd6f38918 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 20 May 2024 13:21:07 +0200 Subject: [PATCH] Add Total Liftable Weight Output --- src/lib/constants.ts | 4 ++++ src/routes/+page.svelte | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 5daa671..3d35a9d 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -127,6 +127,10 @@ export const localization = new Map([ ["en-GB", "Liftable Weight"], ["de-DE", "Liftkapazität"] ])], + ["liftableCargoWeight", new Map([ + ["en-GB", "Liftable Cargo Weight"], + ["de-DE", "Fracht Liftkapazität"] + ])], ["thrust", new Map([ ["en-GB", "Thrust"], ["de-DE", "Schub"] diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index dac1fa1..c03c4b7 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -86,11 +86,9 @@ return volume; }) - let maxWeight = $derived.by(() => { - let weight = totalThrust / (gravity * 9.81); - weight -= totalVolume * weightPerVolume; - return weight; - }) + let maxWeight = derived.by(totalThrust / (gravity * 9.81)) + + let maxCargoWeight = $derived.by(maxWeight -= totalVolume * weightPerVolume) function weightConversion(weight: number): string { if (weight > 1000) { @@ -217,6 +215,7 @@ {/each} +

{localized("liftableCargoWeight")}: {weightConversion(maxCargoWeight)}

{localized("liftableWeight")}: {weightConversion(maxWeight)}