digitransit-ui/app/component/trafficnow/trafficnow.scss
2026-01-26 15:51:16 +02:00

388 lines
7.3 KiB
SCSS

.traffic-now {
--white: #{$white};
--background-color-lighter: #{$background-color-lighter};
display: flex;
flex-direction: column;
height: 100%;
h2,
h3,
p {
margin: unset;
}
.icon-container {
display: flex;
}
.separator {
&.horizontal {
border-top: 1px solid $light-gray;
}
&.vertical {
border-right: 1px solid $light-gray;
}
}
&__header {
display: flex;
flex-direction: column;
gap: var(--space-m);
padding: var(--space-l) 50px var(--space-xl) 50px;
flex: 0 0 50%;
&-breadcrumb {
display: inline-flex;
align-items: center;
}
&-crumbarrow {
width: 10px;
height: 10px;
rotate: -90deg;
color: $link-color;
}
&--mobile {
padding: 25px 20px 20px 20px;
flex: 0 0 100%;
}
}
&__content {
display: flex;
align-content: center;
height: 100%;
justify-content: center;
background-color: $background-color-lighter;
&--mobile {
padding: 0 var(--space-s);
}
&__filters {
display: flex;
flex-direction: column;
gap: var(--space-m);
padding-top: var(--space-xl);
padding-right: var(--space-xl);
position: sticky;
top: 0;
&-mobile {
padding: var(--space-xl) var(--space-m);
}
&-button-container {
background-color: $background-color-lighter;
padding: var(--space-m) 0;
position: sticky;
top: 0;
z-index: 10;
}
&-container {
display: flex;
flex-direction: column;
min-width: 320px;
max-width: 480px;
background-color: $white;
flex-shrink: 0;
padding-left: 50px;
border-right: 1px solid $light-gray;
}
&__toggle {
&--container {
gap: var(--space-s);
.toggle {
height: 24px;
.slider {
width: 45px;
&::before {
height: 22px;
width: 22px;
}
}
}
}
}
fieldset {
display: flex;
flex-direction: column;
padding-inline: 0;
border: 0;
margin: 0;
padding-block: 0;
label {
display: flex;
flex-direction: row;
align-items: center;
gap: var(--space-xs);
}
legend {
padding: unset;
margin: unset;
font-weight: unset;
margin-left: unset;
}
input[type='radio'],
input[type='checkbox'] {
accent-color: $primary-color;
width: 1em;
height: 1em;
margin: 0;
}
}
}
&__alerts {
display: flex;
width: 100%;
height: 100%;
flex-direction: column;
min-width: 0;
gap: var(--space-l);
min-height: 0;
overflow: auto;
&-list {
display: flex;
flex-direction: column;
gap: 4px;
}
&--empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
background-color: $white;
border: 1px solid $light-gray;
border-radius: var(--radius-l);
gap: var(--space-s);
}
&--desktop {
padding: var(--space-xl) 50px var(--space-xl) var(--space-xl);
gap: var(--space-s);
.list {
gap: inherit;
}
}
}
}
&__disruption-card {
display: flex;
flex-direction: column;
padding: var(--space-l) var(--space-l) var(--space-m) var(--space-l);
gap: var(--space-s);
border-radius: var(--radius-m);
border: 1px solid $light-gray;
cursor: pointer;
&:hover &__icon {
transform: translateY(4px);
transition: transform 0.1s;
&--inverted {
transform: rotate(180deg) translateY(4px);
transition: transform 0.1s;
}
}
&__top-row {
display: flex;
flex-direction: row;
justify-content: space-between;
}
&__icon {
&--inverted {
transform: rotate(180deg);
}
}
.route-badges {
display: flex;
flex-wrap: wrap;
gap: var(--space-xs);
&-mode {
gap: var(--space-xxs);
&-lines {
display: flex;
flex-wrap: wrap;
gap: var(--space-xxs);
a {
color: inherit;
background-color: color-mix(in srgb, currentcolor, white 90%);
border-radius: var(--radius-s);
padding: var(--space-xs) var(--space-xxs);
text-decoration: none;
&.highlight {
box-shadow: 0 0 10px 2px orange;
}
&:hover {
background-color: color-mix(in srgb, currentcolor, white 80%);
}
}
&--text {
color: $black;
}
}
}
}
&__content {
max-height: 0;
opacity: 0;
overflow: hidden;
transition:
max-height 0.2s cubic-bezier(0.4, 0.2, 0.2, 1),
opacity 0.1s ease-in 0.1s;
&--open {
max-height: 500px; // Should be larger than expected content height
opacity: 1;
}
}
&__content-row {
display: flex;
justify-content: space-between;
align-items: center;
&-validity {
display: flex;
gap: var(--space-xs);
&-icon {
display: flex;
gap: 4px;
align-items: center;
}
}
}
}
&__modal-filters {
@media screen and (min-width: 620px) {
top: 50%;
left: 50%;
right: auto;
bottom: auto;
transform: translate(-50%, -50%);
width: 95vw;
}
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: $white;
header {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: var(--space-m);
border: 1px solid $light-gray;
}
.separator {
&.horizontal {
border-top: 1px solid $light-gray;
}
&.vertical {
border-right: 1px solid $light-gray;
}
}
}
// Utilities
.flex-row {
display: flex;
flex-direction: row;
&.vertically-centered {
align-items: center;
}
}
.flex-column {
display: flex;
flex-direction: column;
}
}
.traffic-now__link {
text-decoration: none;
color: inherit;
cursor: pointer;
margin: 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
&:hover &__caret {
transform: translateX(4px);
transition: transform 0.1s;
}
&__left-column {
display: flex;
flex-direction: row;
justify-content: start;
align-items: center;
gap: var(--space-s);
&-body {
display: flex;
flex-direction: column;
justify-content: start;
letter-spacing: -0.5px;
font-style: normal;
h2 {
@media (min-width: 768px) {
font-size: 1.25em;
}
margin: 0;
color: $black;
font-size: 1.125em;
font-weight: $font-weight-medium;
line-height: 24px;
}
p {
margin: 0;
color: $gray;
font-size: 14px;
font-weight: $font-weight-disclaimer;
line-height: 18px;
}
}
}
}