diff --git a/example.css b/example.css index afd7900f5..bcef527bc 100644 --- a/example.css +++ b/example.css @@ -15,7 +15,6 @@ .otp .navbar-title { color: #fff; font-size: 24px; - padding-top: 7px; } .otp.mobile .navbar-title { diff --git a/index.css b/index.css index 697d3b1b6..c5a4df16f 100644 --- a/index.css +++ b/index.css @@ -1,5 +1,6 @@ @import url(node_modules/bootstrap/dist/css/bootstrap.min.css); - +@import url(react-sliding-pane/dist/react-sliding-pane.css); +@import url(lib/bike-rental.css); @import url(node_modules/maplibre-gl/dist/maplibre-gl.css); @import url(lib/components/admin/call-taker.css); @@ -12,190 +13,25 @@ @import url(lib/components/user/nav-login-button.css); @import url(lib/components/viewers/viewers.css); -@import url(lib/bike-rental.css); -@import url(react-sliding-pane/dist/react-sliding-pane.css); /* Hide IE/Edge clear button in text input fields. */ input[type="text"]::-ms-clear { display: none; } -/* New app menu */ -.app-menu-icon { - background: none; - border: none; - cursor: pointer; - display: flex; - flex-direction: column; - height: 15px; - justify-content: space-between; - padding: 0; - position: absolute; - top: 16px; - transition: all 1s ease; - width: 21px; - z-index: 10; -} - -@media only screen and (max-width: 768px) { - #locale-selector-wrapper { - display: none; - } - .app-menu-icon { - left: 15px; - } -} - -.app-menu-icon .menu-line { - border-bottom: 3px solid #ffffff; - display: block; - position: relative; - transition: all 0.5s ease; - width: 100%; -} - -.app-menu-icon[aria-expanded="true"] .menu-line.top { - transform: rotate(45deg); - top: 7px; -} -.app-menu-icon[aria-expanded="true"] .menu-line.bottom { - transform: rotate(-45deg); - bottom: 5px; -} -.app-menu-icon[aria-expanded="true"] .menu-line.middle { - display: none; -} - -.slide-pane { - transition: all 0.2s ease-in-out; -} - -.slide-pane_from_left { - margin: 52px auto 0 0; - /* Keep pane from overflowing on smaller screens */ - height: calc(100% - 52px); -} - -.slide-pane__content { - padding: 6px 0; -} - -.slide-pane__overlay { - z-index: 1000; -} - -.app-menu { - margin: 0; - padding: 0.5rem 0; -} - -.app-menu img, -.app-menu svg { - max-height: 1em; - margin: 0 2rem; - vertical-align: middle; - width: 1em; -} - -.app-menu a, -.app-menu button { - background: none; - border: none; - color: inherit; - cursor: pointer; - display: flex; - font-size: 20px; - padding: 0.5rem 0; - text-decoration: none; - width: 100%; -} - -/* Prevents hover styles from getting triggered on mobile */ -@media (hover: hover) { - .app-menu a:hover, - .app-menu button:hover { - color: #4c97f5; - } -} - -.app-menu a:focus, -.app-menu button:focus { - background-color: #ddd; - outline: 2px solid #4c97f5; - outline-offset: -2px; -} - -.app-menu button[aria-selected="true"], -.sort-option button[aria-selected="true"], -#locale-selector button[aria-selected="true"] { - font-weight: bold; -} - -.skip-nav-button { - color: initial; - position: fixed; - top: -30px; -} -.skip-nav-button:focus { - padding: 7px 24px; - top: 7px; - z-index: 100; -} - -.view-switcher { - display: none; -} - -@media (min-width: 768px) { - .view-switcher { - display: flex; - } -} - -.expand-menu-chevron { - flex-grow: 1; - text-align: end; -} - -.dropdown-header { - font-size: inherit; - line-height: normal; - color: inherit; - white-space: nowrap; -} - -.sub-menu-container { - border-top: 1px solid #cccccc; - margin-top: 0.5rem; - padding-left: 2rem; -} - -.app-menu .app-menu-divider { - border-bottom: 1px solid #ccc; - padding: 1rem 0; -} - -/* Header image or title */ -/* If an icon is used, visually-hide the title (but keep it visible to screen readers). */ -.with-icon div.navbar-title { - height: 0; - overflow: hidden; - width: 0; -} - /* Buttons */ button.header, button.step, .clear-button-formatting { background: transparent; - color: inherit; border: 0; + color: inherit; + margin: 0; + padding: 0; text-align: inherit; text-decoration: none; - padding: 0; - margin: 0; } .clear-button-formatting:active { @@ -217,9 +53,9 @@ button.step { } .overflow-ellipsis { - white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + white-space: nowrap; } .map-container .leaflet-top { diff --git a/lib/components/app/app.css b/lib/components/app/app.css index 87fe44222..c35529d15 100644 --- a/lib/components/app/app.css +++ b/lib/components/app/app.css @@ -1,8 +1,8 @@ /* application menu styling */ .app-menu-button { - border: none; background: none; + border: none; color: #fff; font-size: 24px; padding: 0px 0px; @@ -21,10 +21,10 @@ .app-menu .btn-default:active, .app-menu .open > .dropdown-toggle.btn-default:focus, .app-menu .open > .dropdown-toggle.btn-default { - color: #fff; background: none; - box-shadow: none; border: none; + box-shadow: none; + color: #fff; } .app-menu .btn-default:hover { @@ -47,36 +47,266 @@ } } +/* Navbar settings */ + +.navbar .navbar-header { + display: grid; + grid-template-columns: 300px auto 170px; +} + +.navbar .navbar-nav { + grid-column: 3; + margin: 0; +} + +.navbar .navbar-brand { + align-items: center; + display: flex; + gap: 25px; + grid-column: 1 / span 1; + width: 100%; +} + +.view-switcher { + align-items: center; + display: flex; + justify-content: center; +} + +@media (min-width: 992px) { + .view-switcher { + height: 100%; + left: 0; + position: absolute; + width: 100% + } +} + + +@media (max-width: 768px) { + .navbar .navbar-header { + grid-template-columns: 50px auto 70px; + width: auto !important; + + } + + .navbar .navbar-brand { + gap: 15px; + grid-column: 1 / span 2; + padding: 10px; + } + + .view-switcher { + display: none; +} + +} + +/* Mobile navbar */ +.mobile-navbar-container .navbar-header { + display: block; + grid-column: 1; + grid-row: 1; + justify-self: center; + width: 25px; +} + +.mobile-navbar-container .mobile-header { + grid-row: 1; + height: 100%; + justify-self: center; +} + +.mobile-navbar-container .locale-selector-and-login { + grid-row: 1; + height: 50px; + justify-self: flex-end; +} + +.mobile-navbar-container .container-fluid { + align-items: center; + display: grid; + grid-template-columns: 50px auto 70px; + grid-template-rows: 50px; + padding: 0; +} + +/* New app menu */ +.app-menu-icon { + background: none; + border: none; + cursor: pointer; + display: flex; + flex-direction: column; + height: 15px; + justify-content: space-between; + padding: 0; + transition: all 1s ease; + width: 21px; + z-index: 10; +} + +@media only screen and (max-width: 768px) { + #locale-selector-wrapper { + display: none; + } + .app-menu-icon { + left: 15px; + } +} + +.app-menu-icon .menu-line { + border-bottom: 3px solid #ffffff; + display: block; + position: relative; + transition: all 0.5s ease; + width: 100%; +} + +.app-menu-icon[aria-expanded="true"] .menu-line.top { + top: 7px; + transform: rotate(45deg); +} +.app-menu-icon[aria-expanded="true"] .menu-line.bottom { + bottom: 5px; + transform: rotate(-45deg); +} +.app-menu-icon[aria-expanded="true"] .menu-line.middle { + display: none; +} + +.slide-pane { + transition: all 0.2s ease-in-out; +} + +.slide-pane_from_left { + /* Keep pane from overflowing on smaller screens */ + height: calc(100% - 52px); + margin: 52px auto 0 0; +} + +.slide-pane__content { + padding: 6px 0; +} + +.slide-pane__overlay { + z-index: 1000; +} + +.app-menu { + margin: 0; + padding: 0.5rem 0; +} + +.app-menu img, +.app-menu svg { + margin: 0 2rem; + max-height: 1em; + vertical-align: middle; + width: 1em; +} + +.app-menu a, +.app-menu button { + background: none; + border: none; + color: inherit; + cursor: pointer; + display: flex; + font-size: 20px; + padding: 0.5rem 0; + text-decoration: none; + width: 100%; +} + +/* Prevents hover styles from getting triggered on mobile */ +@media (hover: hover) { + .app-menu a:hover, + .app-menu button:hover { + color: #4c97f5; + } +} + +.app-menu a:focus, +.app-menu button:focus { + background-color: #ddd; + outline: 2px solid #4c97f5; + outline-offset: -2px; +} + +.app-menu button[aria-selected="true"], +.sort-option button[aria-selected="true"], +#locale-selector button[aria-selected="true"] { + font-weight: bold; +} + +.skip-nav-button { + color: initial; + position: fixed; + top: -30px; +} +.skip-nav-button:focus { + padding: 7px 24px; + top: 7px; + z-index: 100; +} + +.expand-menu-chevron { + flex-grow: 1; + text-align: end; +} + +.dropdown-header { + color: inherit; + font-size: inherit; + line-height: normal; + white-space: nowrap; +} + +.sub-menu-container { + border-top: 1px solid #cccccc; + margin-top: 0.5rem; + padding-left: 2rem; +} + +.app-menu .app-menu-divider { + border-bottom: 1px solid #ccc; + padding: 1rem 0; +} + +/* Header image or title */ +/* If an icon is used, visually-hide the title (but keep it visible to screen readers). */ +.with-icon div.navbar-title { + height: 0; + overflow: hidden; + width: 0; +} + /* PrintLayout styles */ .otp.print-layout { - max-width: 640px; margin: 30px auto; + max-width: 640px; } .otp.print-layout > .header { - margin-bottom: 30px; border-bottom: 4px solid black; font-size: 36px; font-weight: 600; + margin-bottom: 30px; } .otp.print-layout > .map-container { border: 2px solid black; + box-sizing: border-box; height: 400px; margin-bottom: 30px; - box-sizing: border-box; } /* View Switcher Styling */ -.view-switcher { - align-items: center; - display: flex; - justify-content: center; -} .view-switcher a { - color: rgba(255, 255, 255, 0.85); border-radius: 15px; + color: rgba(255, 255, 255, 0.85); font-size: 14px; padding: 6px 12px; user-select: none; @@ -98,8 +328,8 @@ /* Full screen modal styling */ .fullscreen-modal { - width: 75vw; height: 60vh; + width: 75vw; } .fullscreen-modal .modal-content { height: 90vh; diff --git a/lib/components/app/desktop-nav.tsx b/lib/components/app/desktop-nav.tsx index f9a265b86..b2e1ad3c2 100644 --- a/lib/components/app/desktop-nav.tsx +++ b/lib/components/app/desktop-nav.tsx @@ -19,8 +19,8 @@ import NavbarItem from './nav-item' import ViewSwitcher from './view-switcher' const StyledNav = styled(Nav)` - /* Almost override bootstrap's margin-right: -15px */ - margin-right: -5px; + display: flex; + justify-content: end; /* Target only the svgs in the Navbar */ & > li > button > svg, & > li > span > button > span > svg { @@ -41,10 +41,6 @@ const StyledNav = styled(Nav)` padding: 15px; line-height: 20px; - @media (max-width: 768px) { - padding: 10px; - } - &:hover { background: rgba(0, 0, 0, 0.05); color: #ececec; @@ -99,18 +95,14 @@ const DesktopNav = ({ const BrandingElement = brandClickable ? 'a' : 'div' - const commonStyles = { marginLeft: 50 } - const brandingProps = brandClickable - ? { - href: '/#/', - style: { - ...commonStyles, - display: 'block', - position: 'relative', - zIndex: 10 - } - } - : { style: { ...commonStyles } } + const brandingProps = brandClickable && { + href: '/#/', + style: { + display: 'block', + position: 'relative', + zIndex: 10 + } + } const popupButtonText = popupTarget && intl.formatMessage({ @@ -142,7 +134,7 @@ const DesktopNav = ({ )} - + {popupTarget && ( diff --git a/lib/components/app/nav-item.tsx b/lib/components/app/nav-item.tsx index d6cd2f9f9..9c4c92be8 100644 --- a/lib/components/app/nav-item.tsx +++ b/lib/components/app/nav-item.tsx @@ -19,10 +19,6 @@ export const NavbarButton = styled.button` padding: 15px; transition: all 0.1s ease-in-out; - @media (max-width: 768px) { - padding: 10px; - } - &:hover, &[aria-expanded='true'] { background: rgba(0, 0, 0, 0.05); diff --git a/lib/components/app/view-switcher.tsx b/lib/components/app/view-switcher.tsx index fc500f9b5..0bd47d5e8 100644 --- a/lib/components/app/view-switcher.tsx +++ b/lib/components/app/view-switcher.tsx @@ -3,14 +3,11 @@ import React from 'react' import Link from '../util/link' -type Props = { - sticky?: boolean -} /** * This component is a switcher between * the main views of the application. */ -const ViewSwitcher = ({ sticky }: Props) => { +const ViewSwitcher = (): JSX.Element => { const intl = useIntl() return (
{ className="view-switcher" id="view-switcher" role="group" - style={ - sticky - ? { - height: '100%', - left: 0, - position: 'absolute', - width: '100%' - } - : {} - } > diff --git a/lib/components/mobile/mobile.css b/lib/components/mobile/mobile.css index b1197cfbd..77a8ef225 100644 --- a/lib/components/mobile/mobile.css +++ b/lib/components/mobile/mobile.css @@ -3,29 +3,26 @@ } .otp .mobile-bottom-button-container { - position: fixed; bottom: 0; - right: 0; - left: 0; height: 40px; + left: 0; + position: fixed; + right: 0; } /* Navbar settings */ .otp.mobile .navbar { - margin-bottom: 0; border: none; + margin-bottom: 0; } .otp .navbar .mobile-header { align-items: center; display: flex; - height: 50px; + height: 100%; justify-content: center; - left: 50px; max-width: 90%; - position: fixed; - right: 50px; text-align: center; } @@ -38,7 +35,6 @@ @media (max-width: 768px) { .otp .navbar .mobile-header-text { - margin-top: 2px; word-break: break-all; } } @@ -56,138 +52,132 @@ border: none; color: white; font-size: 18px; - left: 7px; - position: fixed; } .otp .navbar .mobile-close { - position: fixed; - top: 4px; - right: 6px; color: white; font-size: 18px; -} - -.otp .navbar-brand { - padding: 7px 10px; + position: fixed; + right: 6px; + top: 4px; } /* Welcome screen */ .otp.mobile .welcome-location { - position: fixed; - top: 50px; + height: 60px; left: 0; + position: fixed; right: 0; - height: 60px; + top: 50px; } .otp.mobile .welcome-map { - position: fixed; - top: 110px; + bottom: 0; left: 0; + position: fixed; right: 0; - bottom: 0; + top: 110px; } /* Location search screen */ .otp.mobile .location-search { - position: fixed; - top: 50px; + bottom: 0; left: 0; + position: fixed; right: 0; - bottom: 0; + top: 50px; } /* Main search screen */ .otp.mobile .search-settings { - position: fixed; - top: 50px; + box-shadow: 3px 0px 12px #00000052; + height: 250px; left: 0; + position: fixed; right: 0; - height: 250px; - box-shadow: 3px 0px 12px #00000052; + top: 50px; } .otp.mobile .search-map { - position: fixed; - top: 300px; + bottom: 0; left: 0; + position: fixed; right: 0; - bottom: 0; + top: 300px; } /* Batch routing search screen */ .otp.mobile .batch-search-map { - position: fixed; - top: 282px; + bottom: 0; left: 0; + position: fixed; right: 0; - bottom: 0; + top: 282px; } /* Detailed options screen */ .otp.mobile .options-main-content { - position: fixed; - top: 50px; - left: 0; - right: 0; bottom: 55px; - overflow-y: auto; + left: 0; overflow-x: hidden; + overflow-y: auto; + position: fixed; + right: 0; + top: 50px; } .otp.mobile .options-lower-tray { - position: fixed; + bottom: 0; height: 55px; left: 0; + position: fixed; right: 0; - bottom: 0; } /* Results screen: normal display */ .otp.mobile .mobile-narrative-header { - position: fixed; - height: 40px; - left: 0; - right: 0; background-color: #444; color: #fff; - text-align: center; font-size: 20px; font-weight: 500; + height: 40px; + left: 0; + position: fixed; + right: 0; + text-align: center; } .otp.mobile .mobile-narrative-container { - position: fixed; bottom: 20px; - right: 0; left: 0; padding: 8px 12px; + position: fixed; + right: 0; } .otp.mobile .dots-container { - position: fixed; bottom: 0; - right: 0; - left: 0; height: 20px; + left: 0; + position: fixed; + right: 0; text-align: center; } .otp.mobile .dots-container .dot { + background-color: #ddd; + border-radius: 4px; display: inline-block; - width: 8px; height: 8px; - border-radius: 4px; - background-color: #ddd; margin: 0px 3px; vertical-align: 2px; + width: 8px; } .otp.mobile .dots-container .dot.active { @@ -195,64 +185,64 @@ } .otp.mobile .results-map { - position: fixed; - top: 100px; + bottom: 140px; left: 0; + position: fixed; right: 0; - bottom: 140px; + top: 100px; } /* Results screen: error display */ .otp.mobile .results-error-map { - position: fixed; - top: 100px; + height: 200px; left: 0; + position: fixed; right: 0; - height: 200px; + top: 100px; } .otp.mobile .results-error-message { - position: fixed; - left: 0; - right: 0; bottom: 0; + left: 0; padding-top: 12px; + position: fixed; + right: 0; } /* User Settings */ .otp.mobile .user-settings { - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); background-color: white; - position: fixed; - left: 0; - right: 0; + border-radius: 5px; bottom: 0; - margin-bottom: 18px; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); height: 165px; - z-index: 999999; + left: 0; + margin-bottom: 18px; overflow-y: scroll; - border-radius: 5px; + position: fixed; + right: 0; + z-index: 999999; } /* Stop/Trip/Route Viewer screens */ .otp.mobile .viewer-container { - position: fixed; - top: 250px; bottom: 0; left: 0; - right: 0; overflow-y: auto; + position: fixed; + right: 0; + top: 250px; } .otp.mobile .viewer-map { - position: fixed; - top: 50px; + height: 200px; left: 0; + position: fixed; right: 0; - height: 200px; + top: 50px; } .otp.mobile .route-viewer-header { diff --git a/lib/components/narrative/loading.tsx b/lib/components/narrative/loading.tsx index 6761eeae4..9b4749382 100644 --- a/lib/components/narrative/loading.tsx +++ b/lib/components/narrative/loading.tsx @@ -10,7 +10,7 @@ type Props = { const Loading = ({ extraSmall, small }: Props): JSX.Element => { return ( -
+
diff --git a/lib/components/narrative/styled.js b/lib/components/narrative/styled.js index 9ca966693..8381eef24 100644 --- a/lib/components/narrative/styled.js +++ b/lib/components/narrative/styled.js @@ -14,6 +14,11 @@ export const NarrativeItinerariesContainer = styled.div` display: flex; flex-direction: column; height: 100%; + + // Prevent the loading spinner from clipping the top of the container + .loading-container { + margin-top: 25px; + } ` export const ULContainer = styled.ul` diff --git a/lib/components/user/nav-login-button.css b/lib/components/user/nav-login-button.css index 3bb007cb1..417c18a36 100644 --- a/lib/components/user/nav-login-button.css +++ b/lib/components/user/nav-login-button.css @@ -13,11 +13,6 @@ min-width: 0px; } -.otp.mobile .navbar .container-fluid .locale-selector-and-login { - position: fixed; - right: 0; - top: 0; -} .otp.mobile .navbar .container-fluid .locale-selector-and-login > li { display: inline-block; } @@ -26,10 +21,10 @@ } .navBarItem p { - padding: 5px 15px; - margin: 0; - font-weight: 600; font-size: 16px; + font-weight: 600; + margin: 0; + padding: 5px 15px; } .navBarItem ul { @@ -50,5 +45,8 @@ } #user-selector-label { background-color: transparent; + border: 0; + color: white; + height: 50px; } } diff --git a/lib/components/viewers/styled.ts b/lib/components/viewers/styled.ts index 5509975be..8a870a84e 100644 --- a/lib/components/viewers/styled.ts +++ b/lib/components/viewers/styled.ts @@ -50,7 +50,7 @@ export const PatternContainer = styled.div` & > span { width: 85%; - button { + button#headsign-selector-label { align-items: center; display: flex; justify-content: space-between; @@ -69,10 +69,10 @@ export const StopContainer = styled.ol` color: ${(props) => props?.textColor || DARK_TEXT_GREY}; background-color: ${(props) => props?.backgroundColor || '#fff'}; overflow-y: scroll; - height: 100%; - /* 100px bottom padding is needed to ensure all stops - are shown when browsers don't calculate 100% sensibly */ - padding: 15px 0 100px; + /* Calculate the height of the container a little short to ensure all stops + are shown when browsers don't calculate 100% sensibly. */ + height: calc(100% - 140px); + padding: 15px 0 0px; ` export const StopLink = styled.button` color: ${(props) => props?.textColor + 'da' || DARK_TEXT_GREY};