Show "Local" instead of mileage for events within 30 miles of St. Louis
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -201,6 +201,13 @@ function distanceFromStLouis(ev) {
|
|||||||
return milesBetween(lat, lon, ST_LOUIS.lat, ST_LOUIS.lon);
|
return milesBetween(lat, lon, ST_LOUIS.lat, ST_LOUIS.lon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const LOCAL_RADIUS_MILES = 30;
|
||||||
|
|
||||||
|
function distanceLabel(distance) {
|
||||||
|
if (distance === null) return "";
|
||||||
|
return distance < LOCAL_RADIUS_MILES ? "Local" : `${Math.round(distance)} mi from STL`;
|
||||||
|
}
|
||||||
|
|
||||||
// BCP's only reliable format signal is the teamEvent flag. There's no
|
// BCP's only reliable format signal is the teamEvent flag. There's no
|
||||||
// dedicated "team size" field — the closest candidate (totalPlayers /
|
// dedicated "team size" field — the closest candidate (totalPlayers /
|
||||||
// totalTeamPlayers) reflects live registration progress, not the event's
|
// totalTeamPlayers) reflects live registration progress, not the event's
|
||||||
@@ -296,7 +303,7 @@ function eventCard(ev, circuits) {
|
|||||||
<div class="card-body py-4 flex-row items-center justify-between gap-4 flex-wrap">
|
<div class="card-body py-4 flex-row items-center justify-between gap-4 flex-wrap">
|
||||||
<div class="min-w-0">
|
<div class="min-w-0">
|
||||||
<div class="font-semibold truncate">${esc(ev.name)}</div>
|
<div class="font-semibold truncate">${esc(ev.name)}</div>
|
||||||
<div class="text-sm opacity-60 mt-1">${esc(locationOf(ev))}${distance !== null ? ` · ${Math.round(distance)} mi from STL` : ""}</div>
|
<div class="text-sm opacity-60 mt-1">${esc(locationOf(ev))}${distance !== null ? ` · ${distanceLabel(distance)}` : ""}</div>
|
||||||
<div class="flex gap-2 mt-2 flex-wrap">${format}${scopeBadge}${circuitBadges}${system}${capacity}</div>
|
<div class="flex gap-2 mt-2 flex-wrap">${format}${scopeBadge}${circuitBadges}${system}${capacity}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-right shrink-0">
|
<div class="text-right shrink-0">
|
||||||
|
|||||||
Reference in New Issue
Block a user