From ab03df87daf84cec63da22b0a3c58fe0236784cd Mon Sep 17 00:00:00 2001
From: vista-man <524715@vistacollege.nl>
Date: Mon, 27 Jan 2025 18:09:53 +0100
Subject: [PATCH] Add To-Do List application with HTML, CSS, and JavaScript
---
JavaScript/to do/index.html | 58 +++++++++++++++++++++++++++++++++++++
JavaScript/to do/script.js | 25 ++++++++++++++++
JavaScript/to do/styles.css | 40 +++++++++++++++++++++++++
3 files changed, 123 insertions(+)
create mode 100644 JavaScript/to do/index.html
create mode 100644 JavaScript/to do/script.js
create mode 100644 JavaScript/to do/styles.css
diff --git a/JavaScript/to do/index.html b/JavaScript/to do/index.html
new file mode 100644
index 0000000..45b1327
--- /dev/null
+++ b/JavaScript/to do/index.html
@@ -0,0 +1,58 @@
+
+
+
+
+
+ To-Do List
+
+
+
+
+
+
+
+
diff --git a/JavaScript/to do/script.js b/JavaScript/to do/script.js
new file mode 100644
index 0000000..1d3a6ae
--- /dev/null
+++ b/JavaScript/to do/script.js
@@ -0,0 +1,25 @@
+document.getElementById('add-task').addEventListener('click', function() {
+ const taskText = document.getElementById('new-task').value;
+ if (taskText === '') return;
+
+ const li = document.createElement('li');
+ li.textContent = taskText;
+
+ const completeButton = document.createElement('button');
+ completeButton.textContent = 'Complete';
+ completeButton.addEventListener('click', function() {
+ li.classList.toggle('completed');
+ });
+
+ const deleteButton = document.createElement('button');
+ deleteButton.textContent = 'Delete';
+ deleteButton.addEventListener('click', function() {
+ li.remove();
+ });
+
+ li.appendChild(completeButton);
+ li.appendChild(deleteButton);
+
+ document.getElementById('task-list').appendChild(li);
+ document.getElementById('new-task').value = '';
+});
diff --git a/JavaScript/to do/styles.css b/JavaScript/to do/styles.css
new file mode 100644
index 0000000..8ebc6cb
--- /dev/null
+++ b/JavaScript/to do/styles.css
@@ -0,0 +1,40 @@
+body {
+ font-family: Arial, sans-serif;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ background-color: #f0f0f0;
+}
+
+.container {
+ background: white;
+ padding: 20px;
+ border-radius: 5px;
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
+}
+
+ul {
+ list-style: none;
+ padding: 0;
+}
+
+li {
+ display: flex;
+ justify-content: space-between;
+ padding: 10px;
+ border-bottom: 1px solid #ddd;
+}
+
+li.completed {
+ text-decoration: line-through;
+ color: #888;
+}
+
+button {
+ background: none;
+ border: none;
+ cursor: pointer;
+}