Another day of life, another CDL question on Svelte!
https://www.sveltelab.dev/7gkkb6hx4odofjj
I'm trying to add some dynamic code to the Header.svelte so that when I click on a link, under the Navbar I'll add my title, see Codepen for example.
https://codepen.io/pen/
What am I after? so every time I click on a nav item, I Want the "projects" text to change to either projects, about, or contact. and whatever page I'm in, I'd like that nav item to remain in the hover color.
I tried doing this in an if conditional but I failed, couldn't find anything useful on google either, unless I'm just being silly.
I thought "if path === /projects then h1 = projects, else if ...
4 Replies
I'm planning on jumping to Svelte soon so please learn as much as you can and be ready to answer my questions 😂
I think you forgot to save your codepen, you're just linking to a blank pen
I'm pretty good at that tbh
semi-solved the codepen issue, by just putting the title under the nav, instead of in the same block as the nav
the other issue still stands (the sveltelab link)