Skip to content

Commit

Permalink
add button to load main page
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorVilas committed Jan 19, 2023
1 parent 805647b commit fd9cd49
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/modules/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ export const ui = (() => {
darkModeLabel.htmlFor = darkModeCheckbox.id;
darkModeLi.append(darkModeCheckbox, darkModeLabel);

const homeLi = document.createElement("li");
homeLi.classList.add("menu-item", "go-home");
const homePara = document.createElement("p");
homePara.innerText = "Go to main page";
homePara.addEventListener("click", () => {
mainPage();
toggleMenu();
});
homeLi.append(homePara);


const aboutLi = document.createElement("li");
aboutLi.classList.add("menu-item", "about");
const aboutDivPara = document.createElement("p");
Expand All @@ -112,7 +123,7 @@ export const ui = (() => {

aboutDivPara.append(aboutLink);
aboutLi.append(aboutDivPara);
optionsList.append(darkModeLi, aboutLi);
optionsList.append(darkModeLi, homeLi, aboutLi);
fieldsetOptions.append(optionsList);

fieldsetOptions.append(legendOptions);
Expand Down

0 comments on commit fd9cd49

Please sign in to comment.