I’ve been trying to redesign my website recently, and I thought the idea to change the main header to change into different backgrounds depending on the button you hover would be cool
However, I know nothing about javascript besides from the absolute basic, so some help would be nice
Here’s what I’m trying to to achieve
Here’s the current HTML for the header
<body>
<div class="logocontainer">
<a href="index.html">
<img src="images/badasslogo.png" class="logo"></a>
</div>
<div id="buttoncontainer" class="buttoncontainer">
</div>
<script src="js/menu.js"></script>
Here’s the CSS
.logocontainer {
text-align: center;
}
.logo {
display: inline-block;
margin-bottom: 0.30%;
align: center;
}
.buttoncontainer {
text-align: center;
}
.button {
display: inline-block;
}
.button:hover {
box-shadow: 0 0 5px white;
filter: brightness(125%);
}
.button:active {
box-shadow: 0 0 10px white;
filter: brightness(155%);
}
And the .js file which I use for the buttons, since if I didn’t use it, I would have to update every single page manually if I ever wanted to add more buttons to it
let headerContent = `
<a href="index.html">
<img src="images/buttons/homebutton.png" class="button"></a>
<a href="blog/blogmain.html">
<img src="images/buttons/blogbutton.png" class="button"></a>
<a href="art/artmain.html">
<img src="images/buttons/artbutton.png" class="button"></a>
<a href="fanart/fanartmain.html">
<img src="images/buttons/fanartbutton.png" class="button"></a>
<a href="partners/partnersmain.html">
<img src="images/buttons/partnersbutton.png" class="button"></a>
<a href="guestbook/guestbook.html">
<img src="images/buttons/guestbookbutton.png" class="button"></a>
<a href="https://junessaidotnet.proboards.com/">
<img src="images/buttons/forumsbutton.png" class="button"></a>
<a href="downloads/downloadsmain.html">
<img src="images/buttons/downloadsbutton.png" class="button"></a>
<a href="extras/extrasmain.html">
<img src="images/buttons/extrasbutton.png" class="button"></a>
<a href="donate/donatemain.html">
<img src="images/buttons/donatebutton.png" class="button"></a>
<a href="about/about.html">
<img src="images/buttons/aboutbutton.png" class="button"></a>
`;
document.querySelector('#buttoncontainer').insertAdjacentHTML('beforeend', headerContent);
Also, if possible
Is there any way to insert the logo into .js file aswell?