cff-displays/index.css
2024-04-10 19:21:19 +02:00

394 lines
7.2 KiB
CSS

@font-face {
src: url("SBB Web Light.ttf");
font-family: "SBB Web Light";
}
@font-face {
src: url("SBB Web Roman.ttf");
font-family: "SBB Web Roman";
}
:root {
--blue: #2D327D;
--granite: #686868;
--graphite: #B7B7B7;
--cloud: #E5E5E5;
--white: #FFFFFF;
--black: #000000;
--red: #EB0000;
--red125: #C60018;
--red150: #A20013;
--first-second-angle: to bottom;
}
* {
margin: 0;
box-sizing: border-box;
}
body {
font-family: "SBB Web Roman", sans-serif;
font-size: 16pt;
color: var(--white);
}
.template {
display: none !important;
}
#station {
display: flex;
gap: 1em;
align-items: flex-end;
color: var(--black);
margin: 1em 0;
}
#refresh {
width: 3.4em;
height: 3.4em;
cursor: pointer;
position: relative;
background-color: var(--white);
border: none;
transition: background-color 0.2s;
}
#refresh::after {
content: "";
position: absolute;
inset: 0;
width: 100%;
height: 100%;
background-color: var(--granite);
mask-image: url(icons/arrows-circle-medium.svg);
-webkit-mask-image: url(icons/arrows-circle-medium.svg);
mask-size: contain;
-webkit-mask-size: contain;
mask-position: center;
-webkit-mask-position: center;
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
transition: transform 0.2s;
will-change: transform;
}
#refresh:hover {
background-color: var(--cloud);
}
#refresh:hover::after {
transform: rotate(90deg);
}
#grid {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: auto 1fr auto;
grid-template-areas:
"type-time stops"
"destination stops"
"composition composition";
gap: 0.5em;
background-color: var(--blue);
}
#type-time {
grid-area: type-time;
display: flex;
gap: 0.5em;
align-items: center;
padding: 0 0.5rem;
}
#train-type {
height: 80%;
}
#departure {
font-size: 150%;
font-weight: bold;
}
#destination {
grid-area: destination;
font-size: 150%;
font-weight: bold;
padding: 0 0.5rem;
}
#stops {
grid-area: stops;
display: flex;
flex-direction: column;
gap: 0.5em;
}
#composition {
grid-area: composition;
display: flex;
flex-direction: column;
--n-waggons: 1;
}
#sectors {
display: flex;
padding: 0 1em;
width: 100%;
}
.sector {
box-shadow: -1px 0 0 var(--white);
text-align: center;
--weight: 1;
width: calc(100% / var(--n-waggons) * var(--weight));
}
.sector:last-child {
border-right: solid var(--white) 1px;
}
#carriages {
background-color: var(--cloud);
display: grid;
width: 100%;
min-height: 2em;
gap: 0.2em;
padding: 0.5em 1em;
--offset: 0;
grid-template-columns: repeat(var(--n-waggons), 1fr);
align-items: flex-end;
}
.waggon {
--bg: var(--blue);
--fg: var(--white);
position: relative;
}
.waggon.class-first {
--bg: var(--white);
--fg: var(--blue);
}
.waggon:first-child {
grid-column: calc(var(--offset) + 1);
}
.waggon .number {
font-size: 75%;
text-align: center;
color: var(--black);
}
.waggon .outline {
border: solid var(--blue) 2px;
background-color: var(--bg);
color: var(--fg);
width: 100%;
height: 1.8em;
display: grid;
place-items: center;
}
.waggon.class-first-second .outline {
background: linear-gradient(var(--first-second-angle), var(--white) 50%, var(--blue) 50%);
}
.waggon.form-start_links .outline {
border-top-left-radius: 0.5em;
border-bottom-left-radius: 0.25em;
}
.waggon.form-mitte .outline {
}
.waggon.form-end_recht .outline {
border-top-right-radius: 0.5em;
border-bottom-right-radius: 0.25em;
}
.waggon .class {
font-weight: bold;
}
.waggon.class-first-second .class {
background: linear-gradient(var(--first-second-angle), var(--blue) 50%, var(--white) 50%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.waggon.class-loc .class {
background-color: var(--fg);
mask-image: url("./icons/steam-locomotive.svg");
-webkit-mask-image: url("./icons/steam-locomotive.svg");
mask-size: contain;
-webkit-mask-size: contain;
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-position: center;
-webkit-mask-position: center;
width: 100%;
height: 100%;
}
.waggon.form-start_links.class-loc .class {
transform: scaleX(-1);
}
.waggon.class-familie .class {
background-color: var(--fg);
mask-image: url("./icons/sa-fa.svg");
-webkit-mask-image: url("./icons/sa-fa.svg");
mask-size: contain;
-webkit-mask-size: contain;
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-position: center;
-webkit-mask-position: center;
width: 100%;
height: 1em;
}
.waggon .services {
display: none;
}
#carriages[data-direction="left"] .waggon:first-child::before {
content: "";
width: 1.8em;
height: 1.8em;
display: grid;
place-items: center;
position: absolute;
bottom: 0;
right: 100%;
margin-right: 0.2em;
background-color: var(--blue);
mask-image: url("./icons/double-chevron-small-left-small.svg");
-webkit-mask-image: url("./icons/double-chevron-small-left-small.svg");
mask-size: contain;
-webkit-mask-size: contain;
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-position: center;
-webkit-mask-position: center;
}
#carriages[data-direction="right"] .waggon:last-child::after {
content: "";
width: 1.8em;
height: 1.8em;
display: grid;
place-items: center;
position: absolute;
bottom: 0;
left: 100%;
background-color: var(--blue);
mask-image: url("./icons/double-chevron-small-right-small.svg");
-webkit-mask-image: url("./icons/double-chevron-small-right-small.svg");
mask-size: contain;
-webkit-mask-size: contain;
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
mask-position: center;
-webkit-mask-position: center;
}
#search {
display: flex;
gap: 0.5em;
}
#search-input {
font-family: inherit;
font-size: 80%;
padding: 6px 8px 6px 8px;
border: solid var(--graphite) 1px;
}
#search-input:focus-visible {
outline: none;
border-color: var(--granite);
}
#search-btn {
font-family: inherit;
font-size: 80%;
padding: 11px 40px 11px 40px;
background-color: var(--red);
color: var(--white);
border: none;
cursor: pointer;
}
#search-btn:hover {
background-color: var(--red125);
}
#stations {
display: flex;
flex-direction: column;
}
#stations .station {
padding: 0.5em 2em;
border-bottom: solid var(--graphite) 1px;
cursor: pointer;
color: var(--black);
}
#stations .station:last-child {
border-bottom: none;
}
#stations .station:hover {
background-color: var(--cloud);
}
.select-wrapper {
position: relative;
width: 10em;
}
.select-wrapper select {
font-family: inherit;
font-size: inherit;
background-color: var(--white);
border: solid var(--graphite) 1px;
border-radius: 0;
padding: 11px 40px 11px 40px;
color: var(--granite);
text-align: left;
appearance: none;
-webkit-appearance: none;
width: 100%;
cursor: pointer;
}
.select-wrapper .select-arrow {
width: 2em;
height: 100%;
position: absolute;
right: 0;
background-color: var(--granite);
mask-image: url(icons/chevron-small-down-medium.svg);
-webkit-mask-image: url(icons/chevron-small-down-medium.svg);
mask-size: contain;
-webkit-mask-size: contain;
mask-position: center;
-webkit-mask-position: center;
mask-repeat: no-repeat;
-webkit-mask-repeat: no-repeat;
pointer-events: none;
}
.select-wrapper select:focus-visible {
outline: none;
border-color: var(--granite);
}
.field {
display: flex;
flex-direction: column;
gap: 0.2em;
}
.field label {
font-family: inherit;
font-size: 80%;
color: var(--granite);
padding-left: 0.5em;
}