Add "view more" button to main container and update styles

This commit is contained in:
2025-10-03 05:29:34 +10:00
parent 11b35c0af9
commit 5cdb914e76
2 changed files with 11 additions and 1 deletions

View File

@@ -531,7 +531,15 @@ function hideLoadingIndicator() {
function showViewMoreButton() { function showViewMoreButton() {
const postsContainer = document.getElementById("posts"); const postsContainer = document.getElementById("posts");
const containerDiv = postsContainer.parentElement; // Get the main container
// Check if button already exists
if (document.getElementById("view-more-button")) {
return;
}
const viewMoreDiv = document.createElement("a"); const viewMoreDiv = document.createElement("a");
viewMoreDiv.id = "view-more-button";
viewMoreDiv.href = "https://bsky.app/profile/lit.mates.dev"; viewMoreDiv.href = "https://bsky.app/profile/lit.mates.dev";
viewMoreDiv.target = "_blank"; viewMoreDiv.target = "_blank";
viewMoreDiv.className = "view-more-posts"; viewMoreDiv.className = "view-more-posts";
@@ -541,7 +549,7 @@ function showViewMoreButton() {
<small>Follow @lit.mates.dev for more posts</small> <small>Follow @lit.mates.dev for more posts</small>
</div> </div>
`; `;
postsContainer.appendChild(viewMoreDiv); containerDiv.appendChild(viewMoreDiv); // Add to main container, not posts container
} }
async function fetchPosts() { async function fetchPosts() {

View File

@@ -679,6 +679,8 @@ footer a:hover {
cursor: pointer; cursor: pointer;
text-decoration: none; text-decoration: none;
display: block; display: block;
clear: both;
margin-top: 3rem;
} }
.view-more-posts:hover { .view-more-posts:hover {