Spaces:
Running
Running
Download todo.html from Tortullah/ai-taskmaster-pro: direct link, hf CLI and curl.
- Browser
- Download file 4.48 kB
-
https://huggingface.co/spaces/Tortullah/ai-taskmaster-pro/resolve/main/todo.html
- Command line
-
hf download hf://spaces/Tortullah/ai-taskmaster-pro/todo.html
-
curl -L -o todo.html https://huggingface.co/spaces/Tortullah/ai-taskmaster-pro/resolve/main/todo.html
4.48 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>AI TaskMaster Pro - To-Do List</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| </head> | |
| <body class="bg-gray-50"> | |
| <custom-navbar></custom-navbar> | |
| <main class="container mx-auto px-4 py-8"> | |
| <div class="max-w-2xl mx-auto"> | |
| <h1 class="text-3xl font-bold text-amber-500 mb-6">My Tasks</h1> | |
| <div class="bg-white rounded-lg shadow-md p-6 mb-6"> | |
| <div class="flex items-center space-x-2"> | |
| <input type="text" id="newTaskInput" placeholder="Add a new task..." | |
| class="flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-amber-500"> | |
| <button id="addTaskBtn" class="bg-amber-500 hover:bg-amber-600 text-white px-4 py-2 rounded-lg transition"> | |
| <i data-feather="plus"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow-md overflow-hidden"> | |
| <div class="p-4 border-b border-gray-200 bg-amber-50"> | |
| <h2 class="text-xl font-semibold text-amber-800">Today's Tasks</h2> | |
| </div> | |
| <ul id="taskList" class="divide-y divide-gray-200"> | |
| <!-- Tasks will be added here dynamically --> | |
| </ul> | |
| </div> | |
| </div> | |
| </main> | |
| <custom-footer></custom-footer> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/footer.js"></script> | |
| <script src="script.js"></script> | |
| <script> | |
| feather.replace(); | |
| // To-Do List functionality | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const taskInput = document.getElementById('newTaskInput'); | |
| const addTaskBtn = document.getElementById('addTaskBtn'); | |
| const taskList = document.getElementById('taskList'); | |
| // Add task function | |
| function addTask(taskText) { | |
| if (taskText.trim() === '') return; | |
| const taskItem = document.createElement('li'); | |
| taskItem.className = 'p-4 flex items-center justify-between'; | |
| taskItem.innerHTML = ` | |
| <div class="flex items-center space-x-3"> | |
| <input type="checkbox" class="h-5 w-5 text-amber-500 rounded focus:ring-amber-500"> | |
| <span class="task-text">${taskText}</span> | |
| </div> | |
| <button class="delete-btn text-gray-400 hover:text-red-500 transition"> | |
| <i data-feather="trash-2"></i> | |
| </button> | |
| `; | |
| taskList.appendChild(taskItem); | |
| feather.replace(); | |
| // Add event listeners for the new task | |
| const checkbox = taskItem.querySelector('input[type="checkbox"]'); | |
| const deleteBtn = taskItem.querySelector('.delete-btn'); | |
| checkbox.addEventListener('change', function() { | |
| const taskTextElement = taskItem.querySelector('.task-text'); | |
| if (this.checked) { | |
| taskTextElement.classList.add('line-through', 'text-gray-400'); | |
| } else { | |
| taskTextElement.classList.remove('line-through', 'text-gray-400'); | |
| } | |
| }); | |
| deleteBtn.addEventListener('click', function() { | |
| taskList.removeChild(taskItem); | |
| }); | |
| taskInput.value = ''; | |
| } | |
| // Add task on button click | |
| addTaskBtn.addEventListener('click', function() { | |
| addTask(taskInput.value); | |
| }); | |
| // Add task on Enter key | |
| taskInput.addEventListener('keypress', function(e) { | |
| if (e.key === 'Enter') { | |
| addTask(taskInput.value); | |
| } | |
| }); | |
| }); | |
| </script> | |
| </body> | |
| </html> |