Skip to content

Commit

Permalink
Add font styling, tweak font sizes and date formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
e-halinen committed Mar 14, 2024
1 parent 323f370 commit eb5b081
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 36 deletions.
2 changes: 2 additions & 0 deletions src/components/lineTimetable/allStopsList.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
}

.lineInfoText {
font-family: GothamRounded-Medium;
font-weight: bold;
font-size: 2rem;
}

.stopListText {
font-size: medium;
font-family: GothamRounded-Book;
}

@media print {
Expand Down
5 changes: 1 addition & 4 deletions src/components/lineTimetable/lineTableColumns.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.departureRowContainer {
max-width: 1171px;
font-family: GothamRounded-Medium;
}

.departureRowContainer > *:nth-child(odd) {
Expand All @@ -23,10 +24,6 @@
margin-top: 1rem;
}

.stopNameContainer {
margin-bottom: 10px;
}

@media print {
.departureRow {
page-break-inside: avoid;
Expand Down
4 changes: 1 addition & 3 deletions src/components/lineTimetable/lineTableColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ const DeparturesColumn = props => {

return (
<div>
<div className={styles.stopNameContainer}>
<LineTableHeader stop={stop} />
</div>
<LineTableHeader stop={stop} />
<div className={styles.departureRowContainer}>{departureRows}</div>
</div>
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/lineTimetable/lineTableHeader.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
}

.stopName {
font-size: 1.5em;
font-size: 1.2em;
margin: 0 0 0 2rem;
font-family: GothamRounded-Medium;
}
9 changes: 6 additions & 3 deletions src/components/lineTimetable/lineTimetable.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
--timetable-accent-color: white;
font-size: 16px;
margin-bottom: 10px;
font-family: GothamRounded-Medium;
}

.root.a3 {
Expand Down Expand Up @@ -163,12 +164,14 @@

.timetableDays {
margin: 0 1rem 1rem 2rem;
font-size: 20px;
font-size: 1em;
font-family: GothamRounded-Book;
}

.timetableDates {
margin: 0 1rem 1rem 35%;
font-size: 20px;
margin: 0 1rem 1rem 4rem;
font-size: 1em;
font-family: GothamRounded-Book;
}

.pageBreak {
Expand Down
27 changes: 2 additions & 25 deletions src/components/lineTimetable/lineTimetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,7 @@ const formatDate = date => {
const monthIndex = date.getMonth();
const year = date.getFullYear();

return `${day} ${monthNames[monthIndex]} ${year}`;
};

const getZoneLetterStyle = zone => ({
transform:
zone === 'B'
? 'translate(calc(-50%), calc(-50% + 2px))'
: zone === 'C'
? 'translate(calc(-50% - 2px), calc(-50% + 2px))'
: zone === 'D'
? 'translate(calc(-50% + 2px), calc(-50% + 2px))'
: 'translate(-50%, -50%)', // No px adjustments for zone A and the "else" case.
});

const getNotes = (notes, symbols) => {
const parsedNotes = [];
symbols.forEach(symbol => {
notes.forEach(note => {
if (note.substring(0, symbol.length) === symbol && !parsedNotes.includes(note)) {
parsedNotes.push(note);
}
});
});
return parsedNotes;
return `${day}.${monthIndex}.${year}`;
};

const PrintButton = lang => {
Expand Down Expand Up @@ -92,7 +69,7 @@ class LineTimetable extends Component {
<span className={styles.timetableDays}>Maanantai-Perjantai</span>
<span className={styles.timetableDays}>Måndag-Fredag</span>
<span className={styles.timetableDates}>
{this.props.dateBegin} - {this.props.dateEnd}
{formatDate(new Date(this.props.dateBegin))}-{formatDate(new Date(this.props.dateEnd))}
</span>
<LineTableColumns
departures={this.props.departures}
Expand Down
3 changes: 3 additions & 0 deletions src/components/lineTimetable/lineTimetableHeader.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
font-size: 4rem;
font-weight: bold;
margin: 2rem 2rem 0 2rem;
font-family: GothamRounded-Medium;
}

.nameContainer {
Expand All @@ -18,9 +19,11 @@
.lineName {
font-size: 30px;
font-weight: bold;
font-family: GothamRounded-Medium;
}

.lineNameSecondary {
font-size: 25px;
font-weight: normal;
font-family: GothamRounded-Book;
}

0 comments on commit eb5b081

Please sign in to comment.