<li class="rounded" onclick="App.create(event)">
const App = (() => {
document.getElementById("switch-thema").addEventListener("change", () => {
const thema = document.getElementById("thema");
if (
thema.className == "w-64 h-screen bg-white rounded relative theme-white"
) {
thema.className = "w-64 h-screen bg-black rounded relative theme-black";
} else if (
thema.className == "w-64 h-screen bg-black rounded relative theme-black"
) {
thema.className = "w-64 h-screen bg-white rounded relative theme-white";
}
});
document.getElementById("toggle").addEventListener("click", () => {
const noactive = document.getElementById("noactive");
if (noactive.className == "flex flex-row gap-6 toggle-noactive") {
noactive.className = "flex flex-row gap-6 toggle-active";
console.log((toggle.lastElementChild.className = "uil uil-angle-right"));
} else if (noactive.className == "flex flex-row gap-6 toggle-active") {
noactive.className = "flex flex-row gap-6 toggle-noactive";
console.log((toggle.lastElementChild.className = "uil uil-angle-left"));
}
});
return {
create: function dropdown(event) {
if (event.target.parentElement.className == "dropdown rounded") {
event.target.parentElement.className = "rounded";
event.target.parentElement.firstElementChild.className =
"uil uil-angle-right -mx-2 pl-3";
event.target.nextElementSibling.className =
"dropdown-menu bg-color hidden";
} else if (
event.target.parentElement.className == "rounded" &&
event.target.localName == "a"
) {
event.target.parentElement.className = "dropdown rounded";
event.target.parentElement.firstElementChild.className =
"uil uil-angle-down -mx-2 pl-3";
event.target.nextElementSibling.className = "dropdown-menu bg-color";
}
},
};
})();