feat(map): Introduce CSS Grid sidebar layout and integrated navigation + draw panels, add directions view and step-to-map interaction

This commit is contained in:
2026-02-05 15:49:07 +00:00
parent 32bec849ee
commit f215133997
7 changed files with 492 additions and 96 deletions

View File

@@ -652,6 +652,7 @@ export const navigationStyles = css`
padding: 10px 12px;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
transition: background-color 0.15s ease;
cursor: pointer;
}
.nav-step:last-child {
@@ -732,6 +733,73 @@ export const navigationStyles = css`
font-size: 12px;
}
/* Directions view styles */
.nav-directions-header {
display: flex;
align-items: center;
gap: 12px;
padding: 12px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-back-btn {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border: none;
border-radius: 6px;
background: rgba(255, 255, 255, 0.1);
color: var(--geo-text, #fff);
cursor: pointer;
transition: background-color 0.15s ease;
flex-shrink: 0;
}
.nav-back-btn:hover {
background: rgba(255, 255, 255, 0.2);
}
.nav-back-btn svg {
width: 18px;
height: 18px;
}
.nav-directions-summary {
flex: 1;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 6px;
font-size: 13px;
font-weight: 600;
color: var(--geo-text, #fff);
}
.nav-directions-summary svg {
width: 14px;
height: 14px;
color: var(--geo-tool-active, #0084ff);
}
.nav-directions-separator {
color: rgba(255, 255, 255, 0.4);
margin: 0 4px;
}
/* Make steps section taller when it's the main content in directions view */
.nav-directions-view .nav-steps {
max-height: none;
flex: 1;
overflow-y: auto;
}
.nav-directions-view {
display: flex;
flex-direction: column;
}
/* Traffic-aware route info */
.nav-traffic-info {
display: flex;
@@ -801,21 +869,27 @@ export const navigationStyles = css`
* Header toolbar styles for toolbar above map
*/
export const headerToolbarStyles = css`
/* CSS Grid layout for sidebars that push the map */
.geo-component {
display: flex;
flex-direction: column;
display: grid;
grid-template-columns: var(--left-panel-width, 0px) 1fr var(--right-panel-width, 0px);
grid-template-rows: auto 1fr;
grid-template-areas:
"header header header"
"left-panel map-area right-panel";
height: 100%;
width: 100%;
transition: grid-template-columns 0.25s ease;
}
.header-toolbar {
grid-area: header;
display: flex;
align-items: center;
gap: 12px;
padding: 8px 12px;
background: var(--geo-toolbar-bg, rgba(30, 30, 30, 0.95));
border-bottom: 1px solid var(--geo-toolbar-border, rgba(255, 255, 255, 0.1));
flex-shrink: 0;
min-height: 52px;
position: relative;
z-index: 10;
@@ -824,7 +898,7 @@ export const headerToolbarStyles = css`
.toolbar-left {
display: flex;
align-items: center;
gap: 4px;
gap: 8px;
flex-shrink: 0;
}
@@ -890,11 +964,196 @@ export const headerToolbarStyles = css`
max-width: 300px;
}
/* Map container takes remaining space */
/* Left Sidebar - Navigation Panel */
.left-sidebar {
grid-area: left-panel;
background: var(--geo-toolbar-bg, rgba(30, 30, 30, 0.95));
border-right: 1px solid var(--geo-toolbar-border, rgba(255, 255, 255, 0.1));
overflow: hidden;
display: flex;
flex-direction: column;
min-width: 0;
}
.left-sidebar.collapsed {
border-right: none;
}
.left-sidebar .navigation-panel {
width: 300px;
min-width: 300px;
border: none;
border-radius: 0;
background: transparent;
backdrop-filter: none;
-webkit-backdrop-filter: none;
height: 100%;
overflow-y: auto;
}
/* Right Sidebar - Draw Panel */
.right-sidebar {
grid-area: right-panel;
background: var(--geo-toolbar-bg, rgba(30, 30, 30, 0.95));
border-left: 1px solid var(--geo-toolbar-border, rgba(255, 255, 255, 0.1));
overflow: hidden;
display: flex;
flex-direction: column;
min-width: 0;
}
.right-sidebar.collapsed {
border-left: none;
}
/* Draw Panel Styles */
.draw-panel {
width: 180px;
min-width: 180px;
display: flex;
flex-direction: column;
height: 100%;
overflow-y: auto;
}
.draw-panel-header {
display: flex;
align-items: center;
gap: 8px;
padding: 12px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.draw-panel-header-icon {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
color: var(--geo-tool-active, #0084ff);
}
.draw-panel-header-icon svg {
width: 18px;
height: 18px;
}
.draw-panel-header-title {
font-size: 13px;
font-weight: 600;
color: var(--geo-text, #fff);
}
.draw-tools-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8px;
padding: 12px;
}
.draw-tool-button {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
padding: 12px 8px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
background: transparent;
color: var(--geo-text, #fff);
cursor: pointer;
transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.draw-tool-button:hover {
background: var(--geo-tool-hover, rgba(255, 255, 255, 0.1));
border-color: rgba(255, 255, 255, 0.2);
}
.draw-tool-button.active {
background: var(--geo-tool-active, #0084ff);
border-color: var(--geo-tool-active, #0084ff);
color: #fff;
}
.draw-tool-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.draw-tool-button svg {
width: 22px;
height: 22px;
}
.draw-tool-button-label {
font-size: 11px;
font-weight: 500;
white-space: nowrap;
}
.draw-panel-divider {
height: 1px;
margin: 4px 12px;
background: rgba(255, 255, 255, 0.1);
}
.draw-panel-actions {
display: flex;
flex-direction: column;
gap: 8px;
padding: 12px;
}
.draw-action-button {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 10px 12px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
background: transparent;
color: var(--geo-text, #fff);
cursor: pointer;
font-size: 12px;
font-weight: 500;
transition: background-color 0.15s ease, border-color 0.15s ease;
}
.draw-action-button:hover {
background: var(--geo-tool-hover, rgba(255, 255, 255, 0.1));
border-color: rgba(255, 255, 255, 0.2);
}
.draw-action-button.active {
background: var(--geo-tool-active, #0084ff);
border-color: var(--geo-tool-active, #0084ff);
}
.draw-action-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.draw-action-button svg {
width: 16px;
height: 16px;
}
.draw-action-button.danger:hover {
background: rgba(239, 68, 68, 0.2);
border-color: rgba(239, 68, 68, 0.4);
color: #fca5a5;
}
/* Map container takes grid area */
.geo-component .map-container {
flex: 1;
grid-area: map-area;
position: relative;
min-height: 0;
min-width: 0;
}
`;