Compare commits
2
Commits
6ef2a190cd
...
8de957b59b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8de957b59b | ||
|
|
206fee797c |
@@ -275,7 +275,13 @@ export function adjustedStat(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function thresholdMod(stat1: number, stat2?: number): number {
|
export function thresholdMod(stat1: number | null | undefined, stat2?: number | null): number {
|
||||||
|
if (stat1 == null) {
|
||||||
|
if (stat2 == null) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return thresholdMod(stat2);
|
||||||
|
}
|
||||||
if (stat2 != null) {
|
if (stat2 != null) {
|
||||||
return 0.5 * (thresholdMod(stat1) + thresholdMod(stat2));
|
return 0.5 * (thresholdMod(stat1) + thresholdMod(stat2));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,6 +255,10 @@
|
|||||||
<option value={per}>{per > 0 ? `Uphill +${per}` : per < 0 ? `Downhill ${per}` : 'Flat'}</option>
|
<option value={per}>{per > 0 ? `Uphill +${per}` : per < 0 ? `Downhill ${per}` : 'Flat'}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
|
<div class="col-span-full mx-2 mb-4 flex gap-4">
|
||||||
|
<label for="threshMod" class="my-auto flex-1">Track Threshold Mod</label>
|
||||||
|
<input type="number" id="threshMod" bind:value={threshMod} min="1.0" max="1.2" step="0.025" class="my-auto flex-1" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-auto flex w-full max-w-4xl flex-col rounded-md text-center shadow-md ring md:col-span-6">
|
<div class="mb-auto flex w-full max-w-4xl flex-col rounded-md text-center shadow-md ring md:col-span-6">
|
||||||
@@ -366,7 +370,7 @@
|
|||||||
</table>
|
</table>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
<div class="mx-auto mt-8 grid max-w-4xl grid-cols-1 gap-8 md:grid-cols-2">
|
<div class="mx-auto mt-8 grid max-w-4xl grid-cols-1 gap-8 md:grid-cols-2">
|
||||||
{@render seggsTable(slope < 0 && allowDAM ? 'Fastest Speed (Downhill)' : 'Fastest Speed', seggs[1])}
|
{@render seggsTable('Fastest Speed', seggs[1])}
|
||||||
{@render seggsTable('Slowest Speed', seggs[0])}
|
{@render seggsTable('Slowest Speed', seggs[0])}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user