fix(game): make map dark mode too
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 33s
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 33s
This commit is contained in:
parent
e17a6b70ec
commit
4fee40921e
1 changed files with 2 additions and 1 deletions
|
@ -46,7 +46,8 @@
|
|||
mapPromise.then((mapData) => {
|
||||
map = L.map("map").setView(center, zoom);
|
||||
|
||||
L.tileLayer(`https://basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png`, {
|
||||
const mapMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
||||
L.tileLayer(`https://basemaps.cartocdn.com/${mapMode}_nolabels/{z}/{x}/{y}{r}.png`, {
|
||||
attribution:
|
||||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>',
|
||||
maxZoom: 20,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue