Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map dark mode #221

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/pages/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import MapGl from "react-map-gl/maplibre";

export const MapPage = (): JSX.Element => {
const { nodes, waypoints } = useDevice();
const { rasterSources } = useAppStore();
const { rasterSources, darkMode } = useAppStore();
const { default: map } = useMap();

const [zoom, setZoom] = useState(0);
Expand Down Expand Up @@ -128,6 +128,7 @@ export const MapPage = (): JSX.Element => {
attributionControl={false}
renderWorldCopies={false}
maxPitch={0}
style = {{filter: darkMode ? 'brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7)' : ''}}
dragRotate={false}
touchZoomRotate={false}
initialViewState={{
Expand Down Expand Up @@ -160,6 +161,7 @@ export const MapPage = (): JSX.Element => {
key={node.num}
longitude={node.position.longitudeI / 1e7}
latitude={node.position.latitudeI / 1e7}
style = {{filter: darkMode ? 'invert(1)' : ''}}
anchor="bottom"
>
<div
Expand Down