Skip to content

Commit

Permalink
Awful port to extract variables for map colors
Browse files Browse the repository at this point in the history
  • Loading branch information
ttmx committed Sep 16, 2024
1 parent 8bdcd18 commit c23ae00
Show file tree
Hide file tree
Showing 3 changed files with 202 additions and 63 deletions.
6 changes: 4 additions & 2 deletions src/lib/components/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import { currentPos, bearingNorth, bearing } from '$lib/location';
import type { Unsubscriber } from 'svelte/motion';
import { getMapStyle } from '$lib/mapStyle';
import { getCssVariable } from '$lib/utils';
export let loading = true;
export let bottomPadding = 0;
Expand Down Expand Up @@ -173,8 +174,9 @@
map.addImage('bike_inactive_selected', await loadSvg('./assets/bike_marker_inactive_selected.svg'));
map.addImage('dock_inactive', await loadSvg('./assets/dock_marker_inactive.svg'));
map.addImage('dock_inactive_selected', await loadSvg('./assets/dock_marker_inactive_selected.svg'));
const imgs = [['bike', './assets/bike_marker.svg', '#79c000'], ['bike_selected', './assets/bike_marker_selected.svg', '#fff'], ['dock', './assets/dock_marker.svg', '#79c000'], ['dock_selected', './assets/dock_marker_selected.svg', '#fff']];
const primaryColor = `hsl(${getCssVariable('--color-primary')})`;
const imgs = [['bike', './assets/bike_marker.svg', primaryColor], ['bike_selected', './assets/bike_marker_selected.svg', '#fff'], ['dock', './assets/dock_marker.svg', primaryColor], ['dock_selected', './assets/dock_marker_selected.svg', '#fff']];
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d', { willReadFrequently: true })!;
const start = performance.now();
Expand Down
Loading

0 comments on commit c23ae00

Please sign in to comment.