Skip to content

Commit

Permalink
Timeline: Fine-tuning (See #39)
Browse files Browse the repository at this point in the history
  • Loading branch information
v6ak committed Sep 26, 2023
1 parent 859cb6a commit 2f00720
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 14 additions & 4 deletions client/src/main/scala/com/v6ak/zbdb/TimeLineRenderer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ final class TimeLineRenderer(participantTable: ParticipantTable, plotRenderer: P
td(`class` := "timeline-content", content),
)

private def empty() = tr(
`class` := s"timeline-process",
td(`class` := "timeline-time")(br()),
td(`class` := "timeline-duration"),
td(`class` := "timeline-content"),
)

private def end(content: Frag, className: String = "") = tr(
`class` := s"timeline-end $className",
td(`class` := "timeline-time"),
Expand Down Expand Up @@ -145,10 +152,13 @@ final class TimeLineRenderer(participantTable: ParticipantTable, plotRenderer: P
duration = intervalTime,
),
if (isFinish)
finish(
endTime,
fseq(s"Cíl: ${partMeta.place}", cumLen)
// TODO: stats
fseq(
empty(),
finish(
endTime,
fseq(s"Cíl: ${partMeta.place}", cumLen)
// TODO: stats
)
)
else
timePoint(
Expand Down
18 changes: 4 additions & 14 deletions server/app/assets/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ body{

.timeline {
margin-bottom: 20px;

// We recomment even numbers. Otherwise, the centering looks quite odd.
@thin-line: 2px;
@thick-line: 6px;

Expand Down Expand Up @@ -204,6 +206,7 @@ body{
.timeline-duration {
padding-left: 5px
}

.timeline-point {

&.arrival {
Expand All @@ -228,20 +231,7 @@ body{
.with-bullet(red, red, 0, solid);
}
.timeline-point.finish {
.timeline-time, .timeline-content {
padding-top: 20px;
}
.with-bullet(green, green, @thick-line, solid, 20px);
.timeline-time:before{
// silly hack that covers the end of the line
content: "";
width: 7px;
height: 30px;
background-color: white;
position: absolute;
top: 27px;
right: -7px;
}
.with-bullet(green, green, 0, solid);
}
.timeline-point.start {
.timeline-time, .timeline-content {
Expand Down

0 comments on commit 2f00720

Please sign in to comment.