Skip to content

Commit

Permalink
fix: marker opacity feature
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic-maury committed Dec 22, 2024
1 parent 1dd1508 commit 785b16d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/components/Map/MapEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export function MapEvents() {
document
.querySelectorAll('.marker-svg')
.forEach((el) => {
el.setAttribute('style', `opacity: ${markerOpacity}`);
el.className = el.className.replace(/opacity-\d+/, '');
el.classList.add(`opacity-${markerOpacity * 100}`);
});
}, [markerOpacity]);

Expand Down
6 changes: 6 additions & 0 deletions frontend/src/components/Map/MapWrapper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,9 @@
img.selected {
filter: drop-shadow(0 6px 6px #000);
}

@for $i from 0 through 20 {
.opacity-#{$i * 5} {
opacity: #{$i * 0.05};
}
}

0 comments on commit 785b16d

Please sign in to comment.