mistpe commited on
Commit
b448df7
·
verified ·
1 Parent(s): 80169f5

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +17 -9
index.html CHANGED
@@ -34,7 +34,8 @@
34
  }
35
 
36
  .leaflet-tile-container img {
37
- opacity: 0.3 !important;
 
38
  }
39
 
40
  .map .mask {
@@ -42,7 +43,7 @@
42
  height: 100%;
43
  background-image: url("./cloud.png");
44
  mix-blend-mode: lighten;
45
- animation: 5s linear 0s magic forwards;
46
  position: absolute;
47
  top: 0;
48
  left: 0;
@@ -335,17 +336,24 @@
335
  icon: createUserIcon(username)
336
  }).addTo(map);
337
  map.setView([latitude, longitude], 16);
 
338
  } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  userMarker.setLatLng([latitude, longitude]);
340
  }
341
 
342
- if (lastPosition) {
343
- const angle = getAngle(lastPosition, newPosition);
344
- placeFootprint(newPosition, angle);
345
- }
346
-
347
- lastPosition = newPosition;
348
-
349
  socket.emit('update_location', {
350
  username: username,
351
  location: newPosition
 
34
  }
35
 
36
  .leaflet-tile-container img {
37
+ opacity: 0.6 !important;
38
+ filter: grayscale(100%) brightness(0) invert(1) !important;
39
  }
40
 
41
  .map .mask {
 
43
  height: 100%;
44
  background-image: url("./cloud.png");
45
  mix-blend-mode: lighten;
46
+ animation: 4s linear 0s magic forwards;
47
  position: absolute;
48
  top: 0;
49
  left: 0;
 
336
  icon: createUserIcon(username)
337
  }).addTo(map);
338
  map.setView([latitude, longitude], 16);
339
+ lastPosition = newPosition;
340
  } else {
341
+ if (lastPosition) {
342
+ const distance = map.distance(
343
+ [lastPosition.lat, lastPosition.lng],
344
+ [latitude, longitude]
345
+ );
346
+
347
+ // Only create footprints if moved more than 2 meters
348
+ if (distance > 2) {
349
+ const angle = getAngle(lastPosition, newPosition);
350
+ placeFootprint(newPosition, angle);
351
+ lastPosition = newPosition;
352
+ }
353
+ }
354
  userMarker.setLatLng([latitude, longitude]);
355
  }
356
 
 
 
 
 
 
 
 
357
  socket.emit('update_location', {
358
  username: username,
359
  location: newPosition