Add some JS to run at DOMContentLoaded that animates the header in
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.
This commit is contained in:
parent
70a380e941
commit
93006dadcb
1 changed files with 16 additions and 0 deletions
|
@ -0,0 +1,16 @@
|
|||
/* 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");
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue