diff --git a/Rupali Parida/README.md b/Rupali Parida/README.md new file mode 100644 index 0000000..f6de5d8 --- /dev/null +++ b/Rupali Parida/README.md @@ -0,0 +1,9 @@ +Todo List + +A simple and efficient Todo List application to keep track of your tasks. This application allows you to add, remove, and manage your tasks with ease. + +Features: + +Add new tasks +Mark tasks as completed +Delete tasks \ No newline at end of file diff --git a/Rupali Parida/app.js b/Rupali Parida/app.js new file mode 100644 index 0000000..9aa2463 --- /dev/null +++ b/Rupali Parida/app.js @@ -0,0 +1,49 @@ +const inputBox = document.getElementById("input-box"); +const listContainer = document.getElementById("list-container"); +const emptyImage = document.querySelector(".empty-image"); + +function addTask() { + if (inputBox.value === '') { + alert("you must write something!"); + } + else { + let li = document.createElement("li"); + li.innerHTML = inputBox.value; + listContainer.appendChild(li); + let span = document.createElement("span"); + span.innerHTML = "\u00d7"; + li.appendChild(span); + } + inputBox.value = ""; + saveData(); + checkEmpty(); +} + +listContainer.addEventListener("click", function (e) { + if (e.target.tagName === "LI") { + e.target.classList.toggle("checked") + saveData(); + } + else if (e.target.tagName === "SPAN") { + e.target.parentElement.remove(); + saveData(); + } + checkEmpty(); +}, false); + +function saveData() { + localStorage.setItem("data", listContainer.innerHTML); +} +function showTask() { + listContainer.innerHTML = localStorage.getItem("data"); + checkEmpty(); +} +function checkEmpty() { + if (listContainer.children.length === 0) { + emptyImage.style.display = "block"; + } else { + emptyImage.style.display = "none"; + } +} + +showTask(); \ No newline at end of file diff --git a/Rupali Parida/img 2/background.jpg b/Rupali Parida/img 2/background.jpg new file mode 100644 index 0000000..2b8450d Binary files /dev/null and b/Rupali Parida/img 2/background.jpg differ diff --git a/Rupali Parida/img 2/checked.png b/Rupali Parida/img 2/checked.png new file mode 100644 index 0000000..d26596a Binary files /dev/null and b/Rupali Parida/img 2/checked.png differ diff --git a/Rupali Parida/img 2/empty.svg b/Rupali Parida/img 2/empty.svg new file mode 100644 index 0000000..48b0e87 --- /dev/null +++ b/Rupali Parida/img 2/empty.svg @@ -0,0 +1,46 @@ + diff --git a/Rupali Parida/img 2/unchecked.png b/Rupali Parida/img 2/unchecked.png new file mode 100644 index 0000000..04a5c5f Binary files /dev/null and b/Rupali Parida/img 2/unchecked.png differ diff --git a/Rupali Parida/index.html b/Rupali Parida/index.html new file mode 100644 index 0000000..55722dd --- /dev/null +++ b/Rupali Parida/index.html @@ -0,0 +1,32 @@ + + + +
+ + +