Small bugfix

This commit is contained in:
Dominic Ferrando
2025-10-15 13:43:08 -04:00
parent 02cc87d6ba
commit 44de0d9f64
3 changed files with 14 additions and 18 deletions
-4
View File
@@ -1,6 +1,2 @@
deploy-secrets: deploy-secrets:
fly secrets import < .env fly secrets import < .env
sync-products:
curl -X POST https://blade-and-brawn.fly.dev/products/sync
+13 -8
View File
@@ -9,6 +9,7 @@
Attribute, Attribute,
Gender, Gender,
lbToKg, lbToKg,
range,
type ActivityPerformance, type ActivityPerformance,
type Player, type Player,
} from "$lib/services/calculator/util"; } from "$lib/services/calculator/util";
@@ -47,13 +48,15 @@
localStorage.setItem("calculations", JSON.stringify(calculations)); localStorage.setItem("calculations", JSON.stringify(calculations));
}); });
$inspect(calculations[0]);
const createCalculation = function (name: string) { const createCalculation = function (name: string) {
return { return {
player: { player: {
name: name, name: name,
metrics: { metrics: {
age: 18, age: 18,
weight: 180, weight: lbToKg(180),
gender: Gender.Male, gender: Gender.Male,
}, },
}, },
@@ -240,14 +243,16 @@
<label class="form-control"> <label class="form-control">
<span class="label mb-1 text-xs">Weight</span> <span class="label mb-1 text-xs">Weight</span>
<input <select
class="input input-bordered input-sm w-full" class="select select-bordered select-sm w-full"
type="number"
min="1"
max="500"
step="1"
bind:value={calculation.player.metrics.weight} bind:value={calculation.player.metrics.weight}
/> >
{#each range(400) as weight}
<option value={String(lbToKg(weight))}
>{weight}</option
>
{/each}
</select>
</label> </label>
</div> </div>
</fieldset> </fieldset>
+1 -6
View File
@@ -53,14 +53,9 @@ export type ActivityStandards = Record<Activity, {
}>; }>;
export class LevelCalculator { export class LevelCalculator {
cfg: Required<LevelCalculatorConfig>;
standards: Standards; standards: Standards;
public constructor(standards: Standards, cfg: LevelCalculatorConfig = {}) { public constructor(standards: Standards) {
this.cfg = {
expandIters: cfg.expandIters ?? 5,
compressTo: cfg.compressTo ?? 100
}
this.standards = standards; this.standards = standards;
} }