Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ba65d935b |
@@ -2,7 +2,7 @@
|
||||
import { page } from "$app/state";
|
||||
import { goto } from "$app/navigation";
|
||||
import { api } from "$lib/api";
|
||||
import { Activity, cmToIn, kgToLb, msToTime } from "@blade-and-brawn/domain";
|
||||
import { Activity, cmToIn, kgToLb } from "@blade-and-brawn/domain";
|
||||
import type { ActivityVerifications } from "@blade-and-brawn/domain";
|
||||
import type { VerificationStatus } from "@blade-and-brawn/api";
|
||||
import { onMount } from "svelte";
|
||||
@@ -59,9 +59,14 @@
|
||||
case Activity.Deadlift:
|
||||
case Activity.BenchPress:
|
||||
return `${Math.round(kgToLb(value))} lb`;
|
||||
case Activity.Run:
|
||||
case Activity.Run: {
|
||||
const totalSeconds = Math.floor(value / 1000);
|
||||
const minutes = Math.floor(totalSeconds / 60);
|
||||
const seconds = totalSeconds % 60;
|
||||
return `${minutes}m ${seconds}s`;
|
||||
}
|
||||
case Activity.ConeDrill:
|
||||
return msToTime(value, true);
|
||||
return `${(value / 1000).toFixed(2)} seconds`;
|
||||
case Activity.BroadJump: {
|
||||
const inches = cmToIn(value);
|
||||
const ft = Math.floor(inches / 12);
|
||||
@@ -257,12 +262,12 @@
|
||||
<div class="w-full flex flex-col gap-4 bg-base-200/60 rounded-lg p-6 mt-4">
|
||||
<div class="flex items-center justify-between flex-wrap gap-2">
|
||||
<h2 class="text-lg font-semibold">{activity}</h2>
|
||||
<span class="text-sm opacity-70"
|
||||
>Claimed: {formatPerformance(
|
||||
activity,
|
||||
v[PERF_COLUMN[activity]],
|
||||
)}</span
|
||||
>
|
||||
<div class="text-right">
|
||||
<div class="text-xs opacity-60">Claimed</div>
|
||||
<div class="text-2xl font-bold">
|
||||
{formatPerformance(activity, v[PERF_COLUMN[activity]])}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if v[URL_COLUMN[activity]]}
|
||||
|
||||
Reference in New Issue
Block a user