Skip to content

Paginate #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Dec 7, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add read more button
skoji committed Dec 7, 2019
commit c3e2454cb0583d9ed5971475e2959c82f8f0fd55
8 changes: 6 additions & 2 deletions _includes/infinite-scroller.html
Original file line number Diff line number Diff line change
@@ -4,10 +4,13 @@
let previous_page = Number("{{ paginator.previous_page }}");
let next_page = Number("{{ paginator.next_page }}");
const total_pages = {{ paginator.total_pages }};

const scroller = document.getElementById('scroller');
window.onload = () => {
if (next_page) {

scroller.style.display = 'block';
scroller.onclick = () => {
read_more();
};
}
};

@@ -29,6 +32,7 @@
next_page += 1;
} else {
next_page = undefined
scroller.style.display = 'none';
}
}
});
8 changes: 8 additions & 0 deletions _sass/_layout.scss
Original file line number Diff line number Diff line change
@@ -228,6 +228,14 @@
}
}

#scroller {
height: $spacing-unit;
margin: $spacing-unit auto;
display: none;
background-color: $header-footer-bg-color;
width: 90%;
}

@include media-query($on-palm) {
.post-list {
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -14,3 +14,4 @@
</ul>

</div>
<button id="scroller" type="button">もっと読む</button>