feat(ui): redesign the pagination button on home page

This commit is contained in:
Cotes Chung 2023-09-06 00:13:10 +08:00
parent 414b8f97ce
commit 62bcd601fc
No known key found for this signature in database
GPG Key ID: 0D9E54843167A808
5 changed files with 103 additions and 116 deletions

View File

@ -1,6 +1,7 @@
<!-- The paginator for post list on HomgPage. -->
<ul class="pagination align-items-center mt-4 mb-1 ps-lg-2">
<nav aria-label="Page Navigation">
<ul class="pagination align-items-center mt-4 mb-0">
<!-- left arrow -->
{% if paginator.previous_page %}
{% assign prev_url = paginator.previous_page_path | relative_url %}
@ -9,7 +10,7 @@
{% endif %}
<li class="page-item {% unless paginator.previous_page %}disabled{% endunless %}">
<a class="page-link btn-box-shadow" href="{{ prev_url }}" aria-label="previous-page">
<a class="page-link" href="{{ prev_url }}" aria-label="previous-page">
<i class="fas fa-angle-left"></i>
</a>
</li>
@ -45,7 +46,7 @@
<!-- show number -->
<li class="page-item {% if i == paginator.page %} active{% endif %}">
<a
class="page-link btn-box-shadow"
class="page-link"
href="{% if i > 1 %}{{ site.paginate_path | replace: ':num', i | relative_url }}{% else %}{{ '/' | relative_url }}{% endif %}"
>
{{- i -}}
@ -55,12 +56,12 @@
<!-- hide number -->
{% if i < pre and left_ellipsis == false %}
<li class="page-item disabled">
<span class="page-link btn-box-shadow">...</span>
<span class="page-link">...</span>
</li>
{% assign left_ellipsis = true %}
{% elsif i > next and right_ellipsis == false %}
<li class="page-item disabled">
<span class="page-link btn-box-shadow">...</span>
<span class="page-link">...</span>
</li>
{% assign right_ellipsis = true %}
{% endif %}
@ -81,9 +82,10 @@
{% endif %}
<li class="page-item {% unless paginator.next_page_path %}disabled{% endunless %}">
<a class="page-link btn-box-shadow" href="{{ next_url }}" aria-label="next-page">
<a class="page-link" href="{{ next_url }}" aria-label="next-page">
<i class="fas fa-angle-right"></i>
</a>
</li>
</ul>
</ul>
</nav>
<!-- .pagination -->

View File

@ -604,7 +604,7 @@ i {
}
.btn-box-shadow {
box-shadow: 0 0 8px 0 var(--btn-box-shadow) !important;
box-shadow: var(--card-shadow);
}
/* overwrite bootstrap muted */

View File

@ -17,10 +17,10 @@
--blockquote-text-color: #868686;
--link-color: rgb(138, 180, 248);
--link-underline-color: rgb(82, 108, 150);
--button-bg: rgb(39, 40, 43);
--btn-border-color: rgb(63, 65, 68);
--button-bg: #1e1e1e;
--btn-border-color: #2e2f31;
--btn-backtotop-color: var(--text-color);
--btn-backtotop-border-color: var(--btn-border-color);
--btn-backtotop-border-color: #212122;
--btn-box-shadow: var(--main-bg);
--card-header-bg: #292929;
--checkbox-color: rgb(118, 120, 121);
@ -55,9 +55,7 @@
/* Home page */
--post-list-text-color: rgb(175, 176, 177);
--btn-patinator-text-color: var(--text-color);
--btn-paginator-hover-color: rgb(64, 65, 66);
--btn-paginator-border-color: var(--btn-border-color);
--btn-text-color: var(--text-color);
--btn-paginator-hover-color: #2e2e2e;
/* Posts */
--toc-highlight: rgb(116, 178, 243);

View File

@ -59,8 +59,6 @@
--post-list-text-color: dimgray;
--btn-patinator-text-color: #555555;
--btn-paginator-hover-color: var(--sidebar-bg);
--btn-paginator-border-color: var(--sidebar-bg);
--btn-text-color: #676666;
/* Posts */
--toc-highlight: #0550ae;

View File

@ -89,8 +89,9 @@
} /* #post-list */
.pagination {
color: var(--btn-patinator-text-color);
color: var(--text-color);
font-family: Lato, sans-serif;
justify-content: space-evenly;
a:hover {
text-decoration: none;
@ -98,26 +99,27 @@
.page-item {
.page-link {
color: inherit;
width: 2.5rem;
height: 2.5rem;
padding: 0;
color: var(--btn-patinator-text-color);
padding: 0 0.6rem;
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
border-radius: 50%;
border: 1px solid var(--btn-paginator-border-color);
background-color: var(--button-bg);
&:hover {
background-color: var(--btn-paginator-hover-color);
}
border-radius: 0.5rem;
border: 0;
background-color: inherit;
}
&.active {
.page-link {
background-color: var(--btn-paginator-hover-color);
color: var(--btn-text-color);
}
}
&:not(.active) {
.page-link {
&:hover {
box-shadow: inset var(--btn-border-color) 0 0 0 1px;
}
}
}
@ -126,15 +128,8 @@
.page-link {
color: rgba(108, 117, 125, 0.57);
border-color: var(--btn-paginator-border-color);
background-color: var(--button-bg);
}
}
&:first-child .page-link,
&:last-child .page-link {
border-radius: 50%;
}
} /* .page-item */
} /* .pagination */
@ -175,8 +170,6 @@
/* Hide SideBar and TOC */
@media all and (max-width: 830px) {
.pagination {
justify-content: space-evenly;
.page-item {
&:not(:first-child):not(:last-child) {
display: none;
@ -193,16 +186,12 @@
.pagination {
font-size: 0.85rem;
justify-content: center;
.page-item {
&:not(:last-child) {
margin-right: 0.7rem;
}
.page-link {
width: 2rem;
height: 2rem;
}
}
.page-index {