Spaces:
Running
Running
la sna verdiklerime kodla to do list kodla
Browse files- components/navbar.js +10 -1
- style.css +12 -0
- todo.html +106 -0
components/navbar.js
CHANGED
|
@@ -36,4 +36,13 @@ class CustomNavbar extends HTMLElement {
|
|
| 36 |
<i data-feather="cpu"></i>
|
| 37 |
<span>AI TaskMaster Pro</span>
|
| 38 |
</a>
|
| 39 |
-
<div class="flex items-center space-x-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
<i data-feather="cpu"></i>
|
| 37 |
<span>AI TaskMaster Pro</span>
|
| 38 |
</a>
|
| 39 |
+
<div class="flex items-center space-x-6">
|
| 40 |
+
<a href="/" class="nav-link flex items-center space-x-1">
|
| 41 |
+
<i data-feather="home" class="nav-icon"></i>
|
| 42 |
+
<span>Home</span>
|
| 43 |
+
</a>
|
| 44 |
+
<a href="/todo.html" class="nav-link flex items-center space-x-1">
|
| 45 |
+
<i data-feather="check-square" class="nav-icon"></i>
|
| 46 |
+
<span>To-Do</span>
|
| 47 |
+
</a>
|
| 48 |
+
</div>
|
style.css
CHANGED
|
@@ -19,6 +19,18 @@ input[type="checkbox"]:checked {
|
|
| 19 |
transform: translateY(-2px);
|
| 20 |
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 21 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
/* Custom scrollbar */
|
| 24 |
::-webkit-scrollbar {
|
|
|
|
| 19 |
transform: translateY(-2px);
|
| 20 |
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
| 21 |
}
|
| 22 |
+
/* To-Do List Styles */
|
| 23 |
+
#taskList li {
|
| 24 |
+
transition: all 0.2s ease;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
#taskList li:hover {
|
| 28 |
+
background-color: #f8fafc;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.task-text {
|
| 32 |
+
transition: all 0.2s ease;
|
| 33 |
+
}
|
| 34 |
|
| 35 |
/* Custom scrollbar */
|
| 36 |
::-webkit-scrollbar {
|
todo.html
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>AI TaskMaster Pro - To-Do List</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
</head>
|
| 11 |
+
<body class="bg-gray-50">
|
| 12 |
+
<custom-navbar></custom-navbar>
|
| 13 |
+
|
| 14 |
+
<main class="container mx-auto px-4 py-8">
|
| 15 |
+
<div class="max-w-2xl mx-auto">
|
| 16 |
+
<h1 class="text-3xl font-bold text-amber-500 mb-6">My Tasks</h1>
|
| 17 |
+
|
| 18 |
+
<div class="bg-white rounded-lg shadow-md p-6 mb-6">
|
| 19 |
+
<div class="flex items-center space-x-2">
|
| 20 |
+
<input type="text" id="newTaskInput" placeholder="Add a new task..."
|
| 21 |
+
class="flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-amber-500">
|
| 22 |
+
<button id="addTaskBtn" class="bg-amber-500 hover:bg-amber-600 text-white px-4 py-2 rounded-lg transition">
|
| 23 |
+
<i data-feather="plus"></i>
|
| 24 |
+
</button>
|
| 25 |
+
</div>
|
| 26 |
+
</div>
|
| 27 |
+
|
| 28 |
+
<div class="bg-white rounded-lg shadow-md overflow-hidden">
|
| 29 |
+
<div class="p-4 border-b border-gray-200 bg-amber-50">
|
| 30 |
+
<h2 class="text-xl font-semibold text-amber-800">Today's Tasks</h2>
|
| 31 |
+
</div>
|
| 32 |
+
<ul id="taskList" class="divide-y divide-gray-200">
|
| 33 |
+
<!-- Tasks will be added here dynamically -->
|
| 34 |
+
</ul>
|
| 35 |
+
</div>
|
| 36 |
+
</div>
|
| 37 |
+
</main>
|
| 38 |
+
|
| 39 |
+
<custom-footer></custom-footer>
|
| 40 |
+
|
| 41 |
+
<script src="components/navbar.js"></script>
|
| 42 |
+
<script src="components/footer.js"></script>
|
| 43 |
+
<script src="script.js"></script>
|
| 44 |
+
<script>
|
| 45 |
+
feather.replace();
|
| 46 |
+
|
| 47 |
+
// To-Do List functionality
|
| 48 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 49 |
+
const taskInput = document.getElementById('newTaskInput');
|
| 50 |
+
const addTaskBtn = document.getElementById('addTaskBtn');
|
| 51 |
+
const taskList = document.getElementById('taskList');
|
| 52 |
+
|
| 53 |
+
// Add task function
|
| 54 |
+
function addTask(taskText) {
|
| 55 |
+
if (taskText.trim() === '') return;
|
| 56 |
+
|
| 57 |
+
const taskItem = document.createElement('li');
|
| 58 |
+
taskItem.className = 'p-4 flex items-center justify-between';
|
| 59 |
+
taskItem.innerHTML = `
|
| 60 |
+
<div class="flex items-center space-x-3">
|
| 61 |
+
<input type="checkbox" class="h-5 w-5 text-amber-500 rounded focus:ring-amber-500">
|
| 62 |
+
<span class="task-text">${taskText}</span>
|
| 63 |
+
</div>
|
| 64 |
+
<button class="delete-btn text-gray-400 hover:text-red-500 transition">
|
| 65 |
+
<i data-feather="trash-2"></i>
|
| 66 |
+
</button>
|
| 67 |
+
`;
|
| 68 |
+
|
| 69 |
+
taskList.appendChild(taskItem);
|
| 70 |
+
feather.replace();
|
| 71 |
+
|
| 72 |
+
// Add event listeners for the new task
|
| 73 |
+
const checkbox = taskItem.querySelector('input[type="checkbox"]');
|
| 74 |
+
const deleteBtn = taskItem.querySelector('.delete-btn');
|
| 75 |
+
|
| 76 |
+
checkbox.addEventListener('change', function() {
|
| 77 |
+
const taskTextElement = taskItem.querySelector('.task-text');
|
| 78 |
+
if (this.checked) {
|
| 79 |
+
taskTextElement.classList.add('line-through', 'text-gray-400');
|
| 80 |
+
} else {
|
| 81 |
+
taskTextElement.classList.remove('line-through', 'text-gray-400');
|
| 82 |
+
}
|
| 83 |
+
});
|
| 84 |
+
|
| 85 |
+
deleteBtn.addEventListener('click', function() {
|
| 86 |
+
taskList.removeChild(taskItem);
|
| 87 |
+
});
|
| 88 |
+
|
| 89 |
+
taskInput.value = '';
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
// Add task on button click
|
| 93 |
+
addTaskBtn.addEventListener('click', function() {
|
| 94 |
+
addTask(taskInput.value);
|
| 95 |
+
});
|
| 96 |
+
|
| 97 |
+
// Add task on Enter key
|
| 98 |
+
taskInput.addEventListener('keypress', function(e) {
|
| 99 |
+
if (e.key === 'Enter') {
|
| 100 |
+
addTask(taskInput.value);
|
| 101 |
+
}
|
| 102 |
+
});
|
| 103 |
+
});
|
| 104 |
+
</script>
|
| 105 |
+
</body>
|
| 106 |
+
</html>
|