Skip to content

Commit

Permalink
add dark mode setting
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorVilas committed Jan 14, 2023
1 parent 7cab942 commit 0b758d7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/modules/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,18 @@ export const ui = (() => {


const optionsList = document.createElement("ul");
optionsList.classList.add("fieldset-list")
optionsList.classList.add("fieldset-list");

const darkModeLi = document.createElement("li");
darkModeLi.classList.add("menu-item", "dark-mode");
const darkModeCheckbox = document.createElement("input");
darkModeCheckbox.type = "checkbox";
darkModeCheckbox.id = "dark-mode";
const darkModeLabel = document.createElement("label");
darkModeLabel.innerText = "Dark mode";
darkModeLabel.htmlFor = darkModeCheckbox.id;
darkModeLi.append(darkModeCheckbox, darkModeLabel);

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

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

fieldsetOptions.append(legendOptions);
Expand Down

0 comments on commit 0b758d7

Please sign in to comment.