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

View File

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