I created a CSS code that adds a fade-in effect to the title of my website, and it works perfectly. However, I now want to customize the fade-in and fade-out effect based on the page I am transitioning from.
My desired outcome:
If I am leaving the "Biology" page and moving to "Biology → Zoology," I want only the "→ Zoology" part to fade in (which I have implemented successfully). But, if I continue to transition from "Biology → Zoology" to "Biology → Zoology → Vertebrates," I want the "→ Vertebrates" section to fade out while keeping "Biology → Zoology."
I believe the solution could look like this:
if ((window.location.pathname == 'x') && (Leaving_page == 'y')) {
//code for fade-in/out here
}