Skip to content

Commit

Permalink
Merge pull request #115 from SpeciesFileGroup/development
Browse files Browse the repository at this point in the history
Add custom opacity for shapes and markers
  • Loading branch information
José Luis Pereira authored and GitHub committed Aug 8, 2023
2 parents 7a8506f + 3f672c8 commit 7c5dc3f
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 10 deletions.
9 changes: 7 additions & 2 deletions src/assets/css/leaflet.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
:root {
--map-tiles-filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
--map-tiles-filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg)
saturate(0.3) brightness(0.7);
}

/* @media (prefers-color-scheme: dark) {
Expand All @@ -8,10 +9,14 @@
}
} */

.map-point-marker {
opacity: var(--color-map-marker-opacity);
}

.dark {
color-scheme: dark;

.map-tiles {
filter:var(--map-tiles-filter, none);
filter: var(--map-tiles-filter, none);
}
}
3 changes: 3 additions & 0 deletions src/assets/css/vars.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

--color-scrollbar-thumb: 156, 163, 175;
--color-scrollbar-track: 229, 231, 235;

--color-map-shape-opacity: 0.5;
--color-map-marker-opacity: 0.75;
}

.dark {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Map/icons/AssertedDistribution.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const AssertedDistribution = {
className: 'bg-map-asserted bg-opacity-50 rounded-full',
className: 'bg-map-asserted rounded-full map-point-marker',
iconSize: [8, 8],
iconAnchor: [4, 4]
}
2 changes: 1 addition & 1 deletion src/components/Map/icons/CollectionObject.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const CollectionObject = {
className: 'bg-map-collection-object bg-opacity-50 rounded-full',
className: 'bg-map-collection-object rounded-full map-point-marker',
iconSize: [8, 8],
iconAnchor: [4, 4]
}
2 changes: 1 addition & 1 deletion src/components/Map/icons/Georeference.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const Georeference = {
className: 'bg-map-georeference bg-opacity-50 rounded-full',
className: 'bg-map-georeference rounded-full map-point-marker',
iconSize: [8, 8],
iconAnchor: [4, 4]
}
2 changes: 1 addition & 1 deletion src/components/Map/icons/TypeMaterial.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const TypeMaterial = {
className: 'bg-map-type-material bg-opacity-50 rounded-full',
className: 'bg-map-type-material map-point-marker rounded-full',
iconSize: [8, 8],
iconAnchor: [4, 4]
}
2 changes: 1 addition & 1 deletion src/components/Map/shapes/Aggregate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export const Aggregate = {
weight: 1,
dashArray: '3',
dashOffset: '3',
fillOpacity: 0.25
fillOpacity: 'var(--color-map-shape-opacity)'
}
2 changes: 1 addition & 1 deletion src/components/Map/shapes/AssertedDistribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export const AssertedDistribution = {
weight: 1,
dashArray: '3',
dashOffset: '3',
fillOpacity: 0.25
fillOpacity: 'var(--color-map-shape-opacity)'
}
2 changes: 1 addition & 1 deletion src/components/Map/shapes/CollectionObject.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const CollectionObject = {
color: `rgb(var(--color-map-collection-object))`,
weight: 1,
fillOpacity: 0.25
fillOpacity: 'var(--color-map-shape-opacity)'
}
2 changes: 1 addition & 1 deletion src/components/Map/shapes/TypeMaterial.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const TypeMaterial = {
color: `rgb(var(--color-map-type-material))`,
weight: 1,
fillOpacity: 0.25
fillOpacity: 'var(--color-map-shape-opacity)'
}

0 comments on commit 7c5dc3f

Please sign in to comment.