From 30275f8837ddbbda7022f3d9ea0b768041cac43b Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 7 Aug 2024 12:33:57 +0200 Subject: [PATCH 1/3] add duration --- lib/components/map/itinerary-summary-overlay.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/components/map/itinerary-summary-overlay.tsx b/lib/components/map/itinerary-summary-overlay.tsx index 8baf875ac..9531ded58 100644 --- a/lib/components/map/itinerary-summary-overlay.tsx +++ b/lib/components/map/itinerary-summary-overlay.tsx @@ -19,6 +19,7 @@ import { getVisibleItineraryIndex } from '../../util/state' import { isDefined } from '../../util/ui' +import FormattedDuration from '../util/formatted-duration' import MetroItineraryRoutes from '../narrative/metro/metro-itinerary-routes' type ItinWithGeometry = Itinerary & { @@ -37,6 +38,18 @@ type Props = { visibleItinerary?: number } +const TimeWrapper = styled.span` + align-items: center; + background: black; + border-radius: 5px; + color: white; + display: inline-flex; + font-weight: 600; + justify-content: center; + margin-left: 8px; + padding: 0px 8px; +` + const Card = styled.div` ${boxShadowCss} @@ -189,6 +202,9 @@ const ItinerarySummaryOverlay = ({ itinerary={mp.itin} LegIcon={LegIcon} /> + + + ) From e23e967d03f7314d8ab3aeb883ce811f81051969 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 7 Aug 2024 12:36:09 +0200 Subject: [PATCH 2/3] cleanup/perfecting --- lib/components/map/itinerary-summary-overlay.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/components/map/itinerary-summary-overlay.tsx b/lib/components/map/itinerary-summary-overlay.tsx index 9531ded58..ad671ec5e 100644 --- a/lib/components/map/itinerary-summary-overlay.tsx +++ b/lib/components/map/itinerary-summary-overlay.tsx @@ -46,7 +46,7 @@ const TimeWrapper = styled.span` display: inline-flex; font-weight: 600; justify-content: center; - margin-left: 8px; + margin-left: 24px; padding: 0px 8px; ` @@ -55,7 +55,7 @@ const Card = styled.div` background: #fffffffa; border-radius: 5px; - padding: 6px; + padding: 8px; align-items: center; display: flex; flex-wrap: wrap; @@ -71,6 +71,7 @@ const Card = styled.div` } div { margin-top: -0px!important; + transform: scale(0.9); } .route-block-wrapper span { padding: 0px; @@ -125,7 +126,8 @@ function getUniquePoint( const selfDistance = distance(point, centerOfLine) // maximize distance from all other points while minimizing distance to center of our own line - const averageDistance = totalDistance / otherMidpoints.length - selfDistance + const averageDistance = + 1.2 * (totalDistance / otherMidpoints.length) - selfDistance if (averageDistance > maxDistance) { maxDistance = averageDistance From 61c82676ba7d7991946c5177ba7e4894b40c14f1 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 7 Aug 2024 15:04:45 +0200 Subject: [PATCH 3/3] correct css --- lib/components/map/itinerary-summary-overlay.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/map/itinerary-summary-overlay.tsx b/lib/components/map/itinerary-summary-overlay.tsx index ad671ec5e..aec2823fc 100644 --- a/lib/components/map/itinerary-summary-overlay.tsx +++ b/lib/components/map/itinerary-summary-overlay.tsx @@ -70,7 +70,7 @@ const Card = styled.div` } } div { - margin-top: -0px!important; + margin-top: -0px !important; transform: scale(0.9); } .route-block-wrapper span {