The header animates in when the UA navigates from the home page or from another site, but not when navigating from other pages on the site.
16 lines
387 B
JavaScript
16 lines
387 B
JavaScript
/* site.js
|
|
* Eryn Wells <eryn@erynwells.me>
|
|
*/
|
|
|
|
window.addEventListener("DOMContentLoaded", () => {
|
|
const siteHeader = document.querySelector("header.site");
|
|
if (!siteHeader) {
|
|
return;
|
|
}
|
|
siteHeader.classList.add("visible");
|
|
|
|
const documentReferrer = new URL(document.referrer);
|
|
if (documentReferrer.pathname === "/") {
|
|
siteHeader.classList.add("animated");
|
|
}
|
|
});
|