Optimized responsive layout.

This commit is contained in:
Cotes Chung 2020-06-07 00:42:21 +08:00
parent 34d54f9349
commit ba47cc0509
3 changed files with 88 additions and 81 deletions

View file

@ -45,7 +45,7 @@
or item.name == page.tab_active or item.name == page.tab_active
or item.name == "Home" and page.layout == "home" %}active{% endif %}"> or item.name == "Home" and page.layout == "home" %}active{% endif %}">
<a href="{{ ref }}" class="nav-link d-flex justify-content-center align-items-center w-100"> <a href="{{ ref }}" class="nav-link d-flex justify-content-center align-items-center w-100">
<i class="fa-fw {{ item.icon }} ml-3 mr-3 unloaded"></i> <i class="fa-fw {{ item.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
<span>{{ item.name | upcase }}</span> <span>{{ item.name | upcase }}</span>
</a> </a>
</li> <!-- .nav-item --> </li> <!-- .nav-item -->

View file

@ -53,7 +53,7 @@ layout: page
{% for post in posts %} {% for post in posts %}
<div class="post-preview"> <div class="post-preview">
<div class="d-flex justify-content-between align-items-center pr-2"> <div class="d-flex justify-content-between align-items-center pr-xl-2">
<h1><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h1> <h1><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h1>
{% if post.pin %} {% if post.pin %}
<i class="fas fa-thumbtack fa-fw fa-sm text-muted pinned" data-toggle="tooltip" data-placement="top" <i class="fas fa-thumbtack fa-fw fa-sm text-muted pinned" data-toggle="tooltip" data-placement="top"

View file

@ -11,93 +11,100 @@
#post-list { #post-list {
margin-top: 1rem; margin-top: 1rem;
padding-right: .5rem; padding-right: .5rem;
.post-meta {
i:not(:first-child) { // post-meta icons on HOME .post-preview {
margin-left: 1.5rem; padding-top: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--main-border-color);
h1 {
font-size: 1.4rem;
margin: 0;
} }
}
} i.far { /* fontawesome icons */
font-size: 86%;
}
.post-meta {
i:not(:first-child) { // post-meta icons on the homepage
margin-left: 1.5rem;
}
}
.post-content {
margin-top: .6rem;
margin-bottom: .6rem;
color: var(--post-list-text-color);
>p {
/* Make preview shorter on the homepage */
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.pinned {
transform: rotate(45deg);
}
} // .post-preview
} // #post-list
.pagination { .pagination {
font-size: 1rem; font-size: 1rem;
a:hover { a:hover {
text-decoration: none; text-decoration: none;
} }
}
.post-preview { .page-item {
padding-top: 1.5rem; .page-link {
padding-bottom: 1rem; color: var(--btn-patinator-text-color);
border-bottom: 1px solid var(--main-border-color); width: 2.5rem;
h1 { height: 2.5rem;
font-size: 1.4rem; padding: 0;
margin: 0; text-align: center;
}
i.far { /* fontawesome icons */
font-size: 86%;
}
.post-content {
margin-top: .6rem;
margin-bottom: .6rem;
color: var(--post-list-text-color);
>p { /* Make preview shorter in Home page*/
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; display: flex;
-webkit-box-orient: vertical; -webkit-box-pack: center;
} justify-content: center;
} -webkit-box-align: center;
.pinned { align-items: center;
transform: rotate(45deg); border-radius: 50%;
} border: 1px solid var(--btn-paginator-border-color);
} font-family: 'Lato', sans-serif;
.page-item {
.page-link {
color: var(--btn-patinator-text-color);
width: 2.5rem;
height: 2.5rem;
padding: 0;
text-align: center;
display: -webkit-box;
display: flex;
-webkit-box-pack: center;
justify-content: center;
-webkit-box-align: center;
align-items: center;
border-radius: 50%;
border: 1px solid var(--btn-paginator-border-color);
font-family: 'Lato', sans-serif;
background-color: var(--button-bg);
}
&.active {
.page-link {
background-color: var(--btn-active-bg);
border-color: var(--btn-active-border-color);
box-shadow: 0 0 8px 0 var(--btn-paginator-shadow) !important;
color: var(--btn-text-color);
}
}
&.disabled {
cursor: not-allowed;
.page-link {
color: rgba(108, 117, 125, 0.57);
border-color: var(--btn-paginator-border-color);
background-color: var(--button-bg); background-color: var(--button-bg);
} }
} &.active {
&:first-child .page-link, .page-link {
&:last-child .page-link { background-color: var(--btn-active-bg);
border-radius: 50%; border-color: var(--btn-active-border-color);
} box-shadow: 0 0 8px 0 var(--btn-paginator-shadow) !important;
&:not(:last-child) { color: var(--btn-text-color);
margin-right: 0.6rem; }
} }
&.disabled {
} // .page-item cursor: not-allowed;
.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%;
}
&:not(:last-child) {
margin-right: 0.7rem;
}
} // .page-item
} // .pagination
@media all and (max-width: 576px) { @media all and (max-width: 576px) {
#post-list .post-meta>span i:not(:first-child) { #post-list .post-meta>span i:not(:first-child) {
@ -121,12 +128,12 @@
.pagination { .pagination {
font-size: .85rem; font-size: .85rem;
.page-item .page-link {
width: 2.2rem;
height: 2.2rem;
}
} }
.page-item .page-link {
width: 2.2rem;
height: 2.2rem;
}
} }
/* Pannel hidden */ /* Pannel hidden */