Skip to content

Commit

Permalink
Hide publications button on page load
Browse files Browse the repository at this point in the history
  • Loading branch information
OvrK12 committed Apr 30, 2024
1 parent f2a6e69 commit 9a0bd17
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
10 changes: 10 additions & 0 deletions _pages/publications.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ nav_order: 6


<script>
/*
Reveal more publications on button click
*/
document.addEventListener('DOMContentLoaded', function() {
const publicationContainer = document.querySelector('.publications');
const showMoreBtn = document.getElementById('show-more-btn');
Expand All @@ -39,7 +42,14 @@ document.addEventListener('DOMContentLoaded', function() {
}

showMoreBtn.addEventListener('click', showMoreItems);
// display first items
showMoreItems();

// only show button after first items have been displayed
if (currentVisibleIndex < publicationItems.length) {
showMoreBtn.style.display = 'block';
}

}
});
</script>
17 changes: 16 additions & 1 deletion _sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,9 @@ footer.sticky-bottom {

.publications .item {
display: none;
transition: opacity 2.5s ease-in-out;
animation: fadeInAnimation ease 0.5s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}

.publications .container {
Expand Down Expand Up @@ -573,13 +575,26 @@ footer.sticky-bottom {
color: #ffffff;
background-color: var(--global-theme-color);
box-shadow: none;
display: none;
transition: background-color 0.3s ease;
animation: fadeInAnimation ease 0.5s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}

.publications .show-more:hover {
background-color: var(--global-hover-color);
}

@keyframes fadeInAnimation {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

// Rouge Color Customization
figure.highlight {
margin: 0 0 1rem;
Expand Down

0 comments on commit 9a0bd17

Please sign in to comment.