This site is based from astro-erudite’s v1.6.0 release, which I made some modifications to fit my personal taste and preferences. You would notice that I kept the original features, UX, and styles, but tweaked a few things here and there.
Navigation
The initial look of the navigation header is meant to fit the bento style of the landing page.

Then when you navigate through the pages it will transition into the default style of navigations where it sticks to the top.

This changing style of navigation header is to give more consistent experience between the landing page and the posts, while not compromising the aesthetic and the site’s usability.
The Logic
The script only runs a function that initially checks if the user is on the landing or homepage, which is where the grid or bento style is.
<script> function initHeaderScroll() { const header = document.getElementById('main-header'); const isHomePage = header?.getAttribute('data-home-page') === 'true';
if (isHomePage) { const scrollThreshold = 100;
function handleScroll() { const currentScrollY = window.scrollY;
if (currentScrollY > scrollThreshold) { header?.classList.remove('-translate-y-full'); } else { header?.classList.add('-translate-y-full'); } }
handleScroll(); window.addEventListener('scroll', handleScroll, { passive: true }); } }
initHeaderScroll(); document.addEventListener('astro:page-load', initHeaderScroll);</script>Then, when the user scrolls down past a certain threshold (100 pixels in this case), the header becomes visible by removing the -translate-y-full class, which is responsible for hiding it off-screen.
When the user scrolls back up to the top of the page, the header hides again by adding the same class back. To be continued… (Still writing the other parts, antok na ‘ko).