chore: improve responsive design of archive entries

This commit is contained in:
Cotes Chung 2022-08-08 20:56:38 +08:00
parent 22d4275f75
commit d792a2f6af
No known key found for this signature in database
GPG key ID: 0D9E54843167A808
2 changed files with 40 additions and 41 deletions

View file

@ -25,7 +25,7 @@ layout: page
{% assign last_year = cur_year %}
{% endif %}
<li class="d-flex align-items-center">
<li>
{% assign ts = post.date | date: '%s' %}
<span class="date day" data-ts="{{ ts }}" data-df="DD">{{ post.date | date: "%d" }}</span>
<span class="date month small text-muted ml-1" data-ts="{{ ts }}" data-df="{{ df_dayjs_m }}">

View file

@ -18,13 +18,15 @@
.year {
height: 3.5rem;
font-size: 1.5rem;
position: relative;
left: 2px;
margin-left: -$timeline-width;
&::before {
@extend %timeline;
height: 72px;
left: 72px;
left: 79px;
bottom: 16px;
}
@ -44,7 +46,7 @@
border-radius: 50%;
width: 12px;
height: 12px;
left: 14.5px;
left: 21.5px;
border: 3px solid;
background-color: var(--timeline-year-dot-color);
border-color: var(--timeline-node-bg);
@ -62,17 +64,6 @@
overflow: hidden;
text-overflow: ellipsis;
a {
/* post title in Archvies */
margin-left: 2.5rem;
position: relative;
top: 0.1rem;
&:hover {
border-bottom: none;
}
}
&:nth-child(odd) {
background-color: var(--main-wrapper-bg, #fff);
background-image: linear-gradient(to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff);
@ -82,14 +73,13 @@
@extend %timeline;
top: 0;
left: 68px;
height: 3rem;
left: 77px;
height: 3.1rem;
}
}
&:last-child li:last-child::before {
height: 1.5rem;
top: -12px;
}
} /* #archives ul */
@ -97,13 +87,33 @@
.date {
white-space: nowrap;
display: inline-block;
position: relative;
right: 0.5rem;
&.month {
width: 1.4rem;
text-align: center;
}
~ a::before {
/* A dot for Month and Day */
&.day {
font-size: 85%;
font-family: 'Lato', sans-serif;
}
}
a {
/* post title in Archvies */
margin-left: 2.5rem;
position: relative;
top: 0.1rem;
&:hover {
border-bottom: none;
}
&::before {
/* the dot before post title */
content: "";
display: inline-block;
position: relative;
@ -114,24 +124,13 @@
height: 8px;
float: left;
top: 1.35rem;
right: 21.5px;
left: 71px;
background-color: var(--timeline-node-bg);
box-shadow: 0 0 3px 0 #c2c6cc;
z-index: 1;
}
}
&.day {
font-size: 85%;
font-family: 'Lato', sans-serif;
text-align: center;
margin-right: -2px;
width: 1.2rem;
position: relative;
left: -0.15rem;
}
} // #archives .date
} // #archives
@media all and (max-width: 576px) {