Change to grid for lines

pull/414/head
HeNine 3 years ago
parent fe2390d0a2
commit 6c21834172

@ -43,14 +43,21 @@ function fillResults(results) {
line_div.classList.add("line"); line_div.classList.add("line");
// line_div.innerHTML = `
// <div class="line_time">
// <div class="line_start_bus_time">${line.start_bus_time}</div>
// <div class="line_start_time">${line.start_time}</div>
// </div>
// <div class="line_text">${line.text}</div>
// `;
line_div.innerHTML = ` line_div.innerHTML = `
<div class="line_time">
<div class="line_start_bus_time">${line.start_bus_time}</div> <div class="line_start_bus_time">${line.start_bus_time}</div>
<div class="line_start_time">${line.start_time}</div>
</div>
<div class="line_text">${line.text}</div> <div class="line_text">${line.text}</div>
<div class="line_start_time">${line.start_time}</div>
`; `;
results_element.append(line_div) results_element.append(line_div)
} }
} }

@ -35,45 +35,43 @@ button {
} }
.line { .line {
display: flex; display: grid;
flex-direction: row;
margin-bottom: 0.5em; grid-template-columns: [times] max-content [text] auto;
grid-template-rows: minmax(1.36em, max-content) min-content;
align-items: start;
margin-bottom: 0.1em;
padding: 0.1em; padding: 0.1em;
max-width: 50em; max-width: 50em;
.line_time {
text-align: right;
display: flex;
flex-direction: column;
flex-shrink: 0;
//padding-top: 0.15em;
.line_start_time { .line_start_time {
color: lightgray; color: lightgray;
font-family: monospace; font-family: monospace;
font-size: smaller; font-size: smaller;
grid-column: times;
align-self: start;
} }
.line_start_bus_time { .line_start_bus_time {
font-family: sans-serif; font-family: sans-serif;
font-size: small; //font-size: small;
display: flex; text-align: right;
flex-direction: column;
margin-bottom: 0.2em; grid-column: times;
height: 1.36em; // try to align the baselines
justify-content: flex-end; padding: 0.2em;
align-content: flex-end; align-self: start;
}
} }
.line_text { .line_text {
display: flex; padding: 0.2em;
margin-left: 0.5em;
margin-left: 0.3em;
grid-column: text;
grid-row: span 2;
} }
} }
Loading…
Cancel
Save