Skip to content

Commit c809880

Browse files
committed
Add precision crosshair for temporary site placement
1 parent 7a3f74b commit c809880

4 files changed

Lines changed: 70 additions & 2 deletions

File tree

functions/_lib/buildInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const APP_VERSION = "0.8.0";
2-
export const APP_COMMIT = "3ac8d7f5";
2+
export const APP_COMMIT = "7a3f74b3";
33
export const APP_BUILD_LABEL = `v${APP_VERSION}+${APP_COMMIT}`;

src/components/MapView.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,11 @@ export function MapView({ isMapExpanded, onToggleMapExpanded }: MapViewProps) {
10191019
}, [hasSimulationTerrain, analysisBounds, srtmTiles, overlayDimensions]);
10201020

10211021
const webglAvailable = useMemo(() => supportsWebgl(), []);
1022+
const pendingPrecisionPosition = pendingNewSiteDraft
1023+
? { lat: pendingNewSiteDraft.lat, lon: pendingNewSiteDraft.lon }
1024+
: pendingSiteMove
1025+
? { lat: pendingSiteMove.currentPosition.lat, lon: pendingSiteMove.currentPosition.lon }
1026+
: null;
10221027
const isBackgroundBusy = isTerrainFetching || isTerrainRecommending || isElevationSyncing;
10231028
const backgroundBusyLabel = isTerrainFetching
10241029
? "Fetching terrain data..."
@@ -1458,6 +1463,16 @@ export function MapView({ isMapExpanded, onToggleMapExpanded }: MapViewProps) {
14581463
</Marker>
14591464
) : null}
14601465

1466+
{pendingPrecisionPosition ? (
1467+
<Marker
1468+
anchor="center"
1469+
latitude={pendingPrecisionPosition.lat}
1470+
longitude={pendingPrecisionPosition.lon}
1471+
>
1472+
<div className="site-precision-crosshair" aria-hidden="true" />
1473+
</Marker>
1474+
) : null}
1475+
14611476
{cursorPoint ? (
14621477
<Marker
14631478
anchor="center"

src/index.css

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,59 @@ input {
829829
border-color: #ff9f43;
830830
background: color-mix(in srgb, #ff9f43 16%, var(--surface-2));
831831
box-shadow: 0 0 0 3px color-mix(in srgb, #ff9f43 18%, transparent);
832+
position: relative;
833+
}
834+
835+
.site-pin.is-temporary::after {
836+
content: "";
837+
position: absolute;
838+
left: 50%;
839+
transform: translateX(-50%);
840+
top: calc(100% + 1px);
841+
width: 0;
842+
height: 0;
843+
border-left: 6px solid transparent;
844+
border-right: 6px solid transparent;
845+
border-top: 8px solid #ff9f43;
846+
}
847+
848+
.site-precision-crosshair {
849+
width: 24px;
850+
height: 24px;
851+
position: relative;
852+
pointer-events: none;
853+
}
854+
855+
.site-precision-crosshair::before,
856+
.site-precision-crosshair::after {
857+
content: "";
858+
position: absolute;
859+
left: 50%;
860+
top: 50%;
861+
transform: translate(-50%, -50%);
862+
background: #ff9f43;
863+
box-shadow: 0 0 0 1px color-mix(in srgb, #0c1218 70%, transparent);
864+
}
865+
866+
.site-precision-crosshair::before {
867+
width: 18px;
868+
height: 2px;
869+
}
870+
871+
.site-precision-crosshair::after {
872+
width: 2px;
873+
height: 18px;
874+
}
875+
876+
.site-precision-crosshair > span {
877+
display: none;
878+
}
879+
880+
.site-precision-crosshair {
881+
border: 2px solid color-mix(in srgb, #ff9f43 92%, #fff 8%);
882+
border-radius: 999px;
883+
box-shadow: 0 0 0 2px color-mix(in srgb, #0c1218 64%, transparent);
884+
background: color-mix(in srgb, #ff9f43 16%, transparent);
832885
}
833886

834887
.profile-map-cursor {

src/lib/buildInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const APP_VERSION = "0.8.0";
2-
export const APP_COMMIT = "3ac8d7f5";
2+
export const APP_COMMIT = "7a3f74b3";
33
export const APP_BUILD_LABEL = `v${APP_VERSION}+${APP_COMMIT}`;

0 commit comments

Comments
 (0)