Spaces:
Running
Running
Download index.html from uron799/tasktrovepromax: direct link, hf CLI and curl.
- Browser
- Download file 20.9 kB
-
https://huggingface.co/spaces/uron799/tasktrovepromax/resolve/main/index.html
- Command line
-
hf download hf://spaces/uron799/tasktrovepromax/index.html
-
curl -L -o index.html https://huggingface.co/spaces/uron799/tasktrovepromax/resolve/main/index.html
20.9 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>TaskTroveProMax - Ultimate Productivity Suite</title> | |
| <link rel="icon" type="image/x-icon" href="/static/favicon.ico"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <style> | |
| .task-item { | |
| transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| } | |
| .task-item:hover { | |
| transform: translateX(8px); | |
| box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); | |
| } | |
| .completed { | |
| text-decoration: line-through; | |
| opacity: 0.6; | |
| background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); | |
| } | |
| .fade-in { | |
| animation: fadeInSlide 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; | |
| } | |
| @keyframes fadeInSlide { | |
| 0% { | |
| opacity: 0; | |
| transform: translateY(20px) scale(0.95); | |
| } | |
| 100% { | |
| opacity: 1; | |
| transform: translateY(0) scale(1); | |
| } | |
| } | |
| .priority-high { border-left: 4px solid #ef4444; } | |
| .priority-medium { border-left: 4px solid #f59e0b; } | |
| .priority-low { border-left: 4px solid #10b981; } | |
| .stats-card { | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| color: white; | |
| border-radius: 12px; | |
| padding: 1.5rem; | |
| box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3); | |
| } | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| } | |
| .floating-btn { | |
| box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4); | |
| transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| } | |
| .floating-btn:hover { | |
| transform: translateY(-3px) scale(1.05); | |
| box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5); | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen font-sans"> | |
| <div class="max-w-4xl mx-auto px-4 py-8"> | |
| <!-- Header --> | |
| <header class="text-center mb-12"> | |
| <div class="gradient-bg rounded-2xl p-8 mb-6 text-white"> | |
| <h1 class="text-5xl font-bold mb-2">TaskTroveProMax 📊</h1> | |
| <p class="text-blue-100 opacity-90">Ultimate Productivity Suite</p> | |
| <div class="mt-4 flex justify-center gap-4"> | |
| <div class="stats-card"> | |
| <div class="text-2xl font-bold" id="total-tasks">0</div> | |
| <div class="text-sm opacity-90">Total Tasks</div> | |
| </div> | |
| <div class="stats-card"> | |
| <div class="text-2xl font-bold" id="completed-tasks">0</div> | |
| <div class="text-sm opacity-90">Completed</div> | |
| </div> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Navigation Tabs --> | |
| <div class="flex border-b border-gray-200 mb-8"> | |
| <button id="todo-tab" class="px-6 py-3 text-blue-600 font-medium border-b-2 border-blue-600 flex items-center gap-2"> | |
| <i data-feather="list"></i> Todo List | |
| </button> | |
| <button id="history-tab" class="px-6 py-3 text-gray-500 font-medium flex items-center gap-2"> | |
| <i data-feather="clock"></i> History | |
| </button> | |
| <button id="analytics-tab" class="px-6 py-3 text-gray-500 font-medium flex items-center gap-2"> | |
| <i data-feather="bar-chart-2"></i> Analytics | |
| </button> | |
| </div> | |
| <!-- Todo Section --> | |
| <div id="todo-section" class="space-y-6"> | |
| <!-- Add Task Form --> | |
| <div class="bg-white rounded-xl shadow-lg p-6"> | |
| <form id="add-task-form" class="space-y-4"> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-4"> | |
| <input type="text" id="task-input" placeholder="What needs to be done?" | |
| class="col-span-2 px-4 py-3 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"> | |
| <select id="priority-select" class="px-4 py-3 border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| <option value="low">Low Priority</option> | |
| <option value="medium" selected>Medium Priority</option> | |
| <option value="high">High Priority</option> | |
| </select> | |
| </div> | |
| <div class="flex justify-end"> | |
| <button type="submit" class="bg-blue-500 hover:bg-blue-600 text-white px-8 py-3 rounded-xl transition-all duration-300 floating-btn flex items-center gap-2"> | |
| <i data-feather="plus" class="w-5 h-5"></i> Add Task | |
| </button> | |
| </div> | |
| </form> | |
| </div> | |
| <!-- Task List --> | |
| <div id="task-list" class="bg-white rounded-xl shadow-lg divide-y divide-gray-100"> | |
| <!-- Tasks will be dynamically inserted here --> | |
| </div> | |
| </div> | |
| <!-- History Section --> | |
| <div id="history-section" class="hidden space-y-6"> | |
| <div class="bg-white rounded-xl shadow-lg p-6"> | |
| <div class="flex items-center justify-between mb-6"> | |
| <h2 class="text-2xl font-semibold text-gray-800 flex items-center gap-2"> | |
| <i data-feather="clock"></i> Completed Tasks History | |
| </h2> | |
| <button onclick="clearHistory()" class="text-red-400 hover:text-red-600 transition-colors flex items-center gap-2"> | |
| <i data-feather="trash-2" class="w-4 h-4"></i> Clear History | |
| </button> | |
| </div> | |
| <div id="history-list" class="space-y-3"> | |
| <!-- History items will be dynamically inserted here --> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Analytics Section --> | |
| <div id="analytics-section" class="hidden space-y-6"> | |
| <div class="bg-white rounded-xl shadow-lg p-6"> | |
| <h2 class="text-2xl font-semibold text-gray-800 mb-6 flex items-center gap-2"> | |
| <i data-feather="bar-chart-2"></i> Productivity Analytics | |
| </h2> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8"> | |
| <div class="bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-xl"> | |
| <div class="text-3xl font-bold text-blue-600 mb-2" id="analytics-total">0</div> | |
| <div class="text-sm text-blue-600 opacity-80">Total Tasks Created</div> | |
| </div> | |
| <div class="bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-xl"> | |
| <div class="text-3xl font-bold text-green-600 mb-2" id="analytics-completed">0</div> | |
| <div class="text-sm text-green-600 opacity-80">Completion Rate</div> | |
| </div> | |
| <div class="bg-gradient-to-r from-purple-50 to-pink-50 p-6 rounded-xl"> | |
| <div class="text-3xl font-bold text-purple-600 mb-2" id="analytics-avg-time">0h</div> | |
| <div class="text-sm text-purple-600 opacity-80">Avg Completion Time</div> | |
| </div> | |
| </div> | |
| <div class="bg-gray-50 p-6 rounded-xl"> | |
| <h3 class="text-lg font-semibold text-gray-800 mb-4">Priority Distribution</h3> | |
| <div class="grid grid-cols-3 gap-4"> | |
| <div class="text-center"> | |
| <div class="text-2xl font-bold text-red-600" id="high-priority">0</div> | |
| <div class="text-sm text-gray-600">High Priority</div> | |
| </div> | |
| <div class="text-center"> | |
| <div class="text-2xl font-bold text-yellow-600" id="medium-priority">0</div> | |
| <div class="text-sm text-gray-600">Medium Priority</div> | |
| </div> | |
| <div class="text-center"> | |
| <div class="text-2xl font-bold text-green-600" id="low-priority">0</div> | |
| <div class="text-sm text-gray-600">Low Priority</div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Initialize Feather Icons | |
| feather.replace(); | |
| // DOM Elements | |
| const todoTab = document.getElementById('todo-tab'); | |
| const historyTab = document.getElementById('history-tab'); | |
| const analyticsTab = document.getElementById('analytics-tab'); | |
| const todoSection = document.getElementById('todo-section'); | |
| const historySection = document.getElementById('history-section'); | |
| const analyticsSection = document.getElementById('analytics-section'); | |
| const addTaskForm = document.getElementById('add-task-form'); | |
| const taskInput = document.getElementById('task-input'); | |
| const prioritySelect = document.getElementById('priority-select'); | |
| const taskList = document.getElementById('task-list'); | |
| const historyList = document.getElementById('history-list'); | |
| const totalTasksEl = document.getElementById('total-tasks'); | |
| const completedTasksEl = document.getElementById('completed-tasks'); | |
| // State | |
| let tasks = JSON.parse(localStorage.getItem('tasks')) || []; | |
| let history = JSON.parse(localStorage.getItem('history')) || []; | |
| // Tab Navigation | |
| todoTab.addEventListener('click', () => { | |
| todoTab.classList.add('text-blue-600', 'border-blue-600'); | |
| historyTab.classList.remove('text-blue-600', 'border-blue-600'); | |
| analyticsTab.classList.remove('text-blue-600', 'border-blue-600'); | |
| historyTab.classList.add('text-gray-500'); | |
| analyticsTab.classList.add('text-gray-500'); | |
| todoSection.classList.remove('hidden'); | |
| historySection.classList.add('hidden'); | |
| analyticsSection.classList.add('hidden'); | |
| }); | |
| historyTab.addEventListener('click', () => { | |
| historyTab.classList.add('text-blue-600', 'border-blue-600'); | |
| todoTab.classList.remove('text-blue-600', 'border-blue-600'); | |
| analyticsTab.classList.remove('text-blue-600', 'border-blue-600'); | |
| todoTab.classList.add('text-gray-500'); | |
| analyticsTab.classList.add('text-gray-500'); | |
| historySection.classList.remove('hidden'); | |
| todoSection.classList.add('hidden'); | |
| analyticsSection.classList.add('hidden'); | |
| renderHistory(); | |
| }); | |
| analyticsTab.addEventListener('click', () => { | |
| analyticsTab.classList.add('text-blue-600', 'border-blue-600'); | |
| todoTab.classList.remove('text-blue-600', 'border-blue-600'); | |
| historyTab.classList.remove('text-blue-600', 'border-blue-600'); | |
| todoTab.classList.add('text-gray-500'); | |
| historyTab.classList.add('text-gray-500'); | |
| analyticsSection.classList.remove('hidden'); | |
| todoSection.classList.add('hidden'); | |
| historySection.classList.add('hidden'); | |
| renderAnalytics(); | |
| }); | |
| // Add Task | |
| addTaskForm.addEventListener('submit', (e) => { | |
| e.preventDefault(); | |
| const taskText = taskInput.value.trim(); | |
| const priority = prioritySelect.value; | |
| if (taskText) { | |
| const newTask = { | |
| id: Date.now(), | |
| text: taskText, | |
| completed: false, | |
| priority: priority, | |
| createdAt: new Date().toISOString() | |
| }; | |
| tasks.push(newTask); | |
| saveTasks(); | |
| renderTasks(); | |
| updateStats(); | |
| taskInput.value = ''; | |
| taskInput.focus(); | |
| } | |
| }); | |
| // Toggle Task Completion | |
| function toggleTask(id) { | |
| const task = tasks.find(t => t.id === id); | |
| if (task) { | |
| task.completed = !task.completed; | |
| if (task.completed) { | |
| // Calculate completion time | |
| const created = new Date(task.createdAt); | |
| const completed = new Date(); | |
| const completionTime = Math.round((completed - created) / (1000 * 60 * 60)); // hours | |
| // Move to history | |
| history.push({ | |
| ...task, | |
| completedAt: new Date().toISOString(), | |
| completionTime: completionTime | |
| }); | |
| tasks = tasks.filter(t => t.id !== id); | |
| } | |
| saveTasks(); | |
| saveHistory(); | |
| renderTasks(); | |
| updateStats(); | |
| } | |
| } | |
| // Delete Task | |
| function deleteTask(id) { | |
| tasks = tasks.filter(t => t.id !== id); | |
| saveTasks(); | |
| renderTasks(); | |
| updateStats(); | |
| } | |
| // Clear History | |
| function clearHistory() { | |
| if (confirm('Are you sure you want to clear all history? This action cannot be undone.')) { | |
| history = []; | |
| saveHistory(); | |
| renderHistory(); | |
| } | |
| } | |
| // Save to localStorage | |
| function saveTasks() { | |
| localStorage.setItem('tasks', JSON.stringify(tasks)); | |
| } | |
| function saveHistory() { | |
| localStorage.setItem('history', JSON.stringify(history)); | |
| } | |
| // Update Stats | |
| function updateStats() { | |
| totalTasksEl.textContent = tasks.length + history.length; | |
| completedTasksEl.textContent = history.length; | |
| } | |
| // Render Tasks | |
| function renderTasks() { | |
| taskList.innerHTML = ''; | |
| if (tasks.length === 0) { | |
| taskList.innerHTML = ` | |
| <div class="text-center py-12 text-gray-400"> | |
| <i data-feather="check-circle" class="w-16 h-16 mx-auto mb-4 opacity-50"></i> | |
| <p class="text-lg">No tasks yet! Add one above.</p> | |
| <p class="text-sm mt-1">Your organized life starts here</p> | |
| </div> | |
| `; | |
| feather.replace(); | |
| return; | |
| } | |
| // Sort tasks by priority: high -> medium -> low | |
| const sortedTasks = [...tasks].sort((a, b) => { | |
| const priorityOrder = { high: 0, medium: 1, low: 2 }; | |
| return priorityOrder[a.priority] - priorityOrder[b.priority]; | |
| }); | |
| sortedTasks.forEach(task => { | |
| const priorityClass = `priority-${task.priority}`; | |
| const priorityIcons = { | |
| high: 'alert-triangle', | |
| medium: 'alert-circle', | |
| low: 'info' | |
| }; | |
| const taskElement = document.createElement('div'); | |
| taskElement.className = `task-item p-6 flex items-center justify-between fade-in ${task.completed ? 'completed' : ''} ${priorityClass}`; | |
| taskElement.innerHTML = ` | |
| <div class="flex items-center gap-4 flex-1"> | |
| <button onclick="toggleTask(${task.id})" class="w-6 h-6 rounded-full border-2 ${task.completed ? 'bg-teal-500 border-teal-500 text-white' : 'border-gray-300'} flex items-center justify-center transition-all duration-300 hover:scale-110"> | |
| ${task.completed ? '<i data-feather="check" class="w-4 h-4"></i>' : ''} | |
| </button> | |
| <div class="flex-1"> | |
| <span class="${task.completed ? 'text-gray-500' : 'text-gray-800'} text-lg font-medium">${task.text}</span> | |
| <div class="flex items-center gap-2 mt-1"> | |
| <i data-feather="${priorityIcons[task.priority]}" class="w-4 h-4 ${task.priority === 'high' ? 'text-red-500' : task.priority === 'medium' ? 'text-yellow-500' : 'text-green-500'}"></i> | |
| <span class="text-sm ${task.priority === 'high' ? 'text-red-600' : task.priority === 'medium' ? 'text-yellow-600' : 'text-green-600'} capitalize">${task.priority} priority</span> | |
| </div> | |
| </div> | |
| </div> | |
| <button onclick="deleteTask(${task.id})" class="text-red-400 hover:text-red-600 transition-all duration-300 hover:scale-110 ml-4"> | |
| <i data-feather="trash-2" class="w-5 h-5"></i> | |
| </button> | |
| `; | |
| taskList.appendChild(taskElement); | |
| }); | |
| feather.replace(); | |
| } | |
| // Render History | |
| function renderHistory() { | |
| historyList.innerHTML = ''; | |
| if (history.length === 0) { | |
| historyList.innerHTML = ` | |
| <div class="text-center py-12 text-gray-400"> | |
| <i data-feather="clock" class="w-16 h-16 mx-auto mb-4 opacity-50"></i> | |
| <p class="text-lg">No completed tasks yet.</p> | |
| <p class="text-sm mt-1">Complete some tasks to see them here</p> | |
| </div> | |
| `; | |
| feather.replace(); | |
| return; | |
| } | |
| history.slice().reverse().forEach(item => { | |
| const historyElement = document.createElement('div'); | |
| historyElement.className = 'flex items-center justify-between p-4 bg-gradient-to-r from-gray-50 to-blue-50 rounded-xl fade-in'; | |
| historyElement.innerHTML = ` | |
| <div class="flex items-center gap-4"> | |
| <div class="w-8 h-8 rounded-full bg-teal-500 flex items-center justify-center text-white shadow-md"> | |
| <i data-feather="check" class="w-4 h-4"></i> | |
| </div> | |
| <div> | |
| <span class="text-gray-700 font-medium">${item.text}</span> | |
| <div class="text-xs text-gray-500 mt-1"> | |
| Completed in ${item.completionTime || '<1'} hours | |
| </div> | |
| </div> | |
| </div> | |
| <span class="text-sm text-gray-500">${new Date(item.completedAt).toLocaleDateString()}</span> | |
| `; | |
| historyList.appendChild(historyElement); | |
| }); | |
| feather.replace(); | |
| } | |
| // Render Analytics | |
| function renderAnalytics() { | |
| const total = tasks.length + history.length; | |
| const completed = history.length; | |
| const completionRate = total > 0 ? Math.round((completed / total) * 100) : 0; | |
| // Calculate average completion time | |
| const totalCompletionTime = history.reduce((sum, item) => sum + (item.completionTime || 0), 0); | |
| const avgCompletionTime = completed > 0 ? Math.round(totalCompletionTime / completed) : 0; | |
| // Priority distribution | |
| const priorityCounts = { high: 0, medium: 0, low: 0 }; | |
| tasks.concat(history).forEach(task => { | |
| priorityCounts[task.priority]++; | |
| }); | |
| // Update analytics elements | |
| document.getElementById('analytics-total').textContent = total; | |
| document.getElementById('analytics-completed').textContent = completionRate + '%'; | |
| document.getElementById('analytics-avg-time').textContent = avgCompletionTime + 'h'; | |
| document.getElementById('high-priority').textContent = priorityCounts.high; | |
| document.getElementById('medium-priority').textContent = priorityCounts.medium; | |
| document.getElementById('low-priority').textContent = priorityCounts.low; | |
| } | |
| // Initial render | |
| renderTasks(); | |
| updateStats(); | |
| feather.replace(); | |
| </script> | |
| </body> | |
| </html> | |