-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b69a98b
commit 461a122
Showing
3 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>To-Do List App</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>My To-Do List</h1> | ||
<div class="input-container"> | ||
<input type="text" id="task-input" placeholder="Add a new task..."> | ||
<button id="add-task">Add</button> | ||
</div> | ||
|
||
<ul id="task-list"></ul> | ||
|
||
<footer> | ||
Designed and Developed by Wasiq Tariq | ||
</footer> | ||
</div> | ||
|
||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
document.getElementById('add-task').addEventListener('click', function() { | ||
const taskInput = document.getElementById('task-input'); | ||
const taskValue = taskInput.value.trim(); | ||
|
||
if (taskValue) { | ||
const taskList = document.getElementById('task-list'); | ||
const listItem = document.createElement('li'); | ||
listItem.textContent = taskValue; | ||
|
||
// Add delete button | ||
const deleteBtn = document.createElement('button'); | ||
deleteBtn.textContent = 'Delete'; | ||
deleteBtn.onclick = function() { | ||
taskList.removeChild(listItem); | ||
}; | ||
|
||
listItem.appendChild(deleteBtn); | ||
taskList.appendChild(listItem); | ||
taskInput.value = ''; // Clear the input | ||
} else { | ||
alert('Please enter a task!'); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
font-family: Arial, sans-serif; | ||
background-image: url('https://images.unsplash.com/photo-1506748686214-e9df14d4d9d0?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&q=80&w=1920'); /* Full HD image */ | ||
background-size: cover; /* Ensures the image covers the entire background */ | ||
background-position: center; /* Centers the image */ | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.container { | ||
max-width: 500px; | ||
margin: 50px auto; | ||
background: rgba(255, 255, 255, 0.9); /* Semi-transparent background */ | ||
padding: 20px; | ||
border-radius: 8px; | ||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
h1 { | ||
text-align: center; | ||
color: #333; | ||
} | ||
|
||
.input-container { | ||
display: flex; | ||
justify-content: space-between; | ||
margin-bottom: 20px; | ||
} | ||
|
||
input { | ||
flex: 1; | ||
padding: 12px; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
font-size: 16px; | ||
} | ||
|
||
button { | ||
padding: 12px 20px; | ||
background-color: #007bff; | ||
color: white; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
font-size: 16px; | ||
margin-left: 10px; | ||
transition: background-color 0.3s; | ||
} | ||
|
||
button:hover { | ||
background-color: #0056b3; | ||
} | ||
|
||
ul { | ||
list-style: none; | ||
padding: 0; | ||
} | ||
|
||
li { | ||
padding: 15px; | ||
border-bottom: 1px solid #ddd; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
li button { | ||
background-color: #dc3545; | ||
} | ||
|
||
li button:hover { | ||
background-color: #c82333; | ||
} | ||
|
||
footer { | ||
text-align: center; | ||
margin-top: 20px; | ||
font-size: 14px; | ||
color: #777; | ||
} | ||
|
||
@media (max-width: 600px) { | ||
.input-container { | ||
flex-direction: column; | ||
} | ||
|
||
input { | ||
margin-bottom: 10px; | ||
} | ||
|
||
button { | ||
width: 100%; | ||
} | ||
} |