From 70c2a4644a7fe6da1abc399489898ceffe1bd299 Mon Sep 17 00:00:00 2001 From: Theodoros Moschoglou <146652642+Wake-cloud@users.noreply.github.com> Date: Sun, 24 Nov 2024 06:40:12 +0200 Subject: [PATCH] Updated the style Hope you like it! --- TDL-main/CONTRIBUTING.md | 5 ++ TDL-main/LICENSE | 21 ++++++ TDL-main/README.md | 2 + TDL-main/app.js | 55 ++++++++++++++++ TDL-main/index.html | 31 +++++++++ TDL-main/styles.css | 138 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 252 insertions(+) create mode 100644 TDL-main/CONTRIBUTING.md create mode 100644 TDL-main/LICENSE create mode 100644 TDL-main/README.md create mode 100644 TDL-main/app.js create mode 100644 TDL-main/index.html create mode 100644 TDL-main/styles.css diff --git a/TDL-main/CONTRIBUTING.md b/TDL-main/CONTRIBUTING.md new file mode 100644 index 0000000..01044b5 --- /dev/null +++ b/TDL-main/CONTRIBUTING.md @@ -0,0 +1,5 @@ +1. Fork the repository +2. Clone the repository +3. Make changes and push the code +4. Make a Pull Request to this repository +5. Wait for the response diff --git a/TDL-main/LICENSE b/TDL-main/LICENSE new file mode 100644 index 0000000..f30fd58 --- /dev/null +++ b/TDL-main/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 junaid-secondary + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/TDL-main/README.md b/TDL-main/README.md new file mode 100644 index 0000000..5f84fef --- /dev/null +++ b/TDL-main/README.md @@ -0,0 +1,2 @@ +# TDL +This is a simple todo list using html and css. Please help me to make it functional and beautiful diff --git a/TDL-main/app.js b/TDL-main/app.js new file mode 100644 index 0000000..52ac219 --- /dev/null +++ b/TDL-main/app.js @@ -0,0 +1,55 @@ +// Create a "close" button and append it to each list item +var myNodelist = document.getElementsByTagName("LI"); +var i; +for (i = 0; i < myNodelist.length; i++) { + var span = document.createElement("SPAN"); + var txt = document.createTextNode("\u00D7"); + span.className = "close"; + span.appendChild(txt); + myNodelist[i].appendChild(span); +} + +// Click on a close button to hide the current list item +var close = document.getElementsByClassName("close"); +var i; +for (i = 0; i < close.length; i++) { + close[i].onclick = function() { + var div = this.parentElement; + div.style.display = "none"; + } +} + +// Add a "checked" symbol when clicking on a list item +var list = document.querySelector('ul'); +list.addEventListener('click', function(ev) { + if (ev.target.tagName === 'LI') { + ev.target.classList.toggle('checked'); + } +}, false); + +// Create a new list item when clicking on the "Add" button +function newElement() { + var li = document.createElement("li"); + var inputValue = document.getElementById("myInput").value; + var t = document.createTextNode(inputValue); + li.appendChild(t); + if (inputValue === '') { + alert("You must write something!"); + } else { + document.getElementById("myUL").appendChild(li); + } + document.getElementById("myInput").value = ""; + + var span = document.createElement("SPAN"); + var txt = document.createTextNode("\u00D7"); + span.className = "close"; + span.appendChild(txt); + li.appendChild(span); + + for (i = 0; i < close.length; i++) { + close[i].onclick = function() { + var div = this.parentElement; + div.style.display = "none"; + } + } +} diff --git a/TDL-main/index.html b/TDL-main/index.html new file mode 100644 index 0000000..9de788f --- /dev/null +++ b/TDL-main/index.html @@ -0,0 +1,31 @@ + + +
+ + + + + +