Skip to content

Commit

Permalink
feat: add dark colors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-yarmosh committed Sep 23, 2024
1 parent f18449b commit 11fbb23
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
10 changes: 5 additions & 5 deletions assets/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@
--bluegray-800: #37404c;
--bluegray-900: #282e38;

--dark-50: #f8fafc; /**/
--dark-100: #f1f5f9; /**/
--dark-200: #e2e8f0; /**/
--dark-300: #cbd5e1; /**/
--dark-50: #f8fafc;
--dark-100: #f1f5f9;
--dark-200: #e2e8f0;
--dark-300: #cbd5e1;
--dark-400: #4f6180;
--dark-500: #33415a;
--dark-600: #2d3c59;
--dark-700: #1a2842;
--dark-800: #17233a;
--dark-900: #162034;
--dark-950: #131728; /**/
--dark-950: #131728;

--sidebar-border: #4f6180;
--table-border: #2d3c59;
Expand Down
6 changes: 3 additions & 3 deletions utils/dark-map-styles.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"elementType": "geometry",
"stylers": [
{
"color": "#ff0000"
"color": "#131728"
},
{
"lightness": 0
Expand All @@ -16,7 +16,7 @@
"elementType": "geometry",
"stylers": [
{
"color": "#00ff00"
"color": "#2d3c59"
},
{
"lightness": 0
Expand All @@ -28,7 +28,7 @@
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#0000ff"
"color": "#17233a"
},
{
"lightness": 0
Expand Down
27 changes: 16 additions & 11 deletions utils/init-google-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const DEFAULT_MARKER_COLOR = '#17d4a7';

const INITIAL_MAP_STYLES = mapStyles;
const MODERATE_MAP_STYLES = [
...INITIAL_MAP_STYLES,
{
elementType: 'labels.text.stroke',
stylers: [{ visibility: 'on' }],
Expand All @@ -23,26 +22,32 @@ const MODERATE_MAP_STYLES = [
},
];
const DETAILED_MAP_STYLES = [
...MODERATE_MAP_STYLES,
{
featureType: 'road',
stylers: [{ visibility: 'on' }],
},
];
const INITIAL_MAP_STYLES_DARK = [ ...INITIAL_MAP_STYLES, ...darkMapStyles ];
const MODERATE_MAP_STYLES_DARK = [ ...MODERATE_MAP_STYLES, ...darkMapStyles ];
const DETAILED_MAP_STYLES_DARK = [ ...DETAILED_MAP_STYLES, ...darkMapStyles ];
const INITIAL_MAP_STYLES_DARK = darkMapStyles;
const MODERATE_MAP_STYLES_DARK = [{
elementType: 'labels.text.stroke',
stylers: [
{ visibility: 'on' },
{ color: '#131728' },
],
}];

const stylesByTheme = {
light: {
background: '#ffffff',
initial: INITIAL_MAP_STYLES,
moderate: MODERATE_MAP_STYLES,
detailed: DETAILED_MAP_STYLES,
moderate: [ ...INITIAL_MAP_STYLES, ...MODERATE_MAP_STYLES ],
detailed: [ ...INITIAL_MAP_STYLES, ...MODERATE_MAP_STYLES, ...DETAILED_MAP_STYLES ],
},
dark: {
initial: INITIAL_MAP_STYLES_DARK,
moderate: MODERATE_MAP_STYLES_DARK,
detailed: DETAILED_MAP_STYLES_DARK,
background: '#131728',
initial: [ ...INITIAL_MAP_STYLES, ...INITIAL_MAP_STYLES_DARK ],
moderate: [ ...INITIAL_MAP_STYLES, ...MODERATE_MAP_STYLES, ...INITIAL_MAP_STYLES_DARK, ...MODERATE_MAP_STYLES_DARK ],
detailed: [ ...INITIAL_MAP_STYLES, ...MODERATE_MAP_STYLES, ...DETAILED_MAP_STYLES, ...INITIAL_MAP_STYLES_DARK, ...MODERATE_MAP_STYLES_DARK ],
},
};

Expand All @@ -64,7 +69,7 @@ export const initGoogleMap = async (probe: Probe) => {
const style = stylesByTheme[auth.theme];

map = new Map(element, {
backgroundColor: '#fafafa',
backgroundColor: style.background,
styles: style.initial,
zoom: MAP_ZOOM_REG,
center: { lat: probe.latitude, lng: probe.longitude },
Expand Down

0 comments on commit 11fbb23

Please sign in to comment.