mirror of
https://github.com/ViViDboarder/Vivid-Casper.git
synced 2024-12-22 03:27:40 +00:00
Added regular pagination option
Casper comes with infinite scrolling by default. This update makes it possible to go with the default pagination style when the <html> element has a class no-infinite-scroll.
This commit is contained in:
parent
140632b885
commit
88ca182a58
@ -273,7 +273,7 @@ production stylesheet in assets/built/screen.css
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.home-template.has-cover .gh-head {
|
||||
:is(.home-template, .paged:not(.tag-template):not(.author-template)).has-cover .gh-head {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
@ -1145,6 +1145,41 @@ make sure this only happens on large viewports / desktop-ish devices.
|
||||
}
|
||||
}
|
||||
|
||||
/* Pagination
|
||||
/* ---------------------------------------------------------- */
|
||||
|
||||
.pagination {
|
||||
display: none;
|
||||
grid-template-columns: 1fr auto 1fr;
|
||||
align-items: center;
|
||||
margin-top: 8vmin;
|
||||
}
|
||||
|
||||
html.no-infinite-scroll .pagination {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.pagination a {
|
||||
font-size: 1.7rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.pagination .page-number {
|
||||
grid-column-start: 2;
|
||||
color: var(--color-secondary-text);
|
||||
}
|
||||
|
||||
.pagination .older-posts {
|
||||
grid-column-start: 3;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.pagination .page-number {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 7. Single Post
|
||||
/* ---------------------------------------------------------- */
|
||||
|
@ -14,6 +14,8 @@
|
||||
*/
|
||||
|
||||
(function (window, document) {
|
||||
if (document.documentElement.classList.contains('no-infinite-scroll')) return;
|
||||
|
||||
// next link element
|
||||
var nextElement = document.querySelector('link[rel=next]');
|
||||
if (!nextElement) {
|
||||
|
@ -2,7 +2,9 @@
|
||||
{{!-- The tag above means - insert everything in this file into the {body} of the default.hbs template --}}
|
||||
|
||||
<main id="site-main" class="site-main outer">
|
||||
<div class="post-feed inner">
|
||||
<div class="inner posts">
|
||||
|
||||
<div class="post-feed">
|
||||
|
||||
{{#author}}
|
||||
<section class="post-card post-card-large">
|
||||
@ -66,5 +68,9 @@
|
||||
{{> "post-card"}}
|
||||
{{/foreach}}
|
||||
|
||||
</div>
|
||||
|
||||
{{pagination}}
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
@ -48,5 +48,7 @@ into the {body} of the default.hbs template --}}
|
||||
{{/foreach}}
|
||||
</div>
|
||||
|
||||
{{pagination}}
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
Loading…
Reference in New Issue
Block a user