Skip to content

Commit

Permalink
Merge pull request #221 from Hunter275/issue-199-map-darkmode
Browse files Browse the repository at this point in the history
Map dark mode
  • Loading branch information
Hunter275 committed Jun 17, 2024
2 parents ce60de9 + 99c240e commit 7742a3e
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 7742a3e

Please sign in to comment.