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