Victor-AI-Hub/task-agent.html
2025-06-03 12:10:49 +05:30

728 lines
32 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Task Agent - AI Task Management</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
body {
font-family: 'Plus Jakarta Sans', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
}
.card-hover {
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
transform: translateY(-4px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.priority-high { border-left: 4px solid #ef4444; }
.priority-medium { border-left: 4px solid #f59e0b; }
.priority-low { border-left: 4px solid #10b981; }
.task-completed {
background: rgba(16, 185, 129, 0.1);
border-left: 4px solid #10b981;
opacity: 0.7;
}
.task-overdue {
background: rgba(239, 68, 68, 0.1);
border-left: 4px solid #ef4444;
}
.task-due-today {
background: rgba(249, 115, 22, 0.1);
border-left: 4px solid #f97316;
}
.task-upcoming {
background: rgba(59, 130, 246, 0.1);
border-left: 4px solid #3b82f6;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.fade-in {
animation: fadeIn 0.4s ease-out;
}
.custom-scrollbar::-webkit-scrollbar {
width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.1);
border-radius: 2px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.3);
border-radius: 2px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.5);
}
.progress-bar {
background: linear-gradient(90deg, #10b981 0%, #059669 100%);
height: 6px;
border-radius: 3px;
transition: width 0.3s ease;
}
.kanban-column {
min-height: 400px;
}
.task-card {
cursor: pointer;
transition: all 0.2s ease;
}
.task-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body>
<!-- Navigation Header -->
<nav class="bg-white shadow-sm border-b sticky top-0 z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between items-center py-4">
<div class="flex items-center gap-3">
<button onclick="goHome()" class="w-10 h-10 bg-indigo-100 rounded-lg flex items-center justify-center hover:bg-indigo-200 transition-colors">
<i class="fas fa-home text-indigo-600"></i>
</button>
<div class="w-10 h-10 bg-orange-600 rounded-xl flex items-center justify-center shadow-lg">
<i class="fas fa-tasks text-white text-lg"></i>
</div>
<div>
<h1 class="text-lg font-bold text-gray-800">Task Agent</h1>
<p class="text-sm text-gray-500">AI Task Management</p>
</div>
</div>
<div class="hidden md:flex items-center gap-6">
<div class="text-right">
<p class="text-sm text-gray-500">Last update</p>
<p class="font-semibold text-gray-800" id="lastUpdate">Just now</p>
</div>
<div class="flex items-center gap-2">
<div class="w-2 h-2 bg-green-400 rounded-full animate-pulse"></div>
<span class="text-sm text-green-600 font-medium">Active</span>
</div>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6 bg-gray-50 min-h-screen">
<!-- Header Section -->
<div class="text-center mb-8">
<h1 class="text-3xl lg:text-4xl font-bold text-gray-800 mb-4">AI Task Management</h1>
<p class="text-xl text-gray-600 max-w-2xl mx-auto">
Intelligent task prioritization, smart categorization, and productivity insights powered by AI.
</p>
</div>
<!-- Task Command Center -->
<div class="bg-white rounded-2xl p-6 mb-8 shadow-lg border border-gray-200">
<div class="flex items-center gap-3 mb-4">
<div class="w-10 h-10 bg-orange-600 rounded-lg flex items-center justify-center">
<i class="fas fa-brain text-white"></i>
</div>
<h2 class="text-xl font-bold text-gray-800">Task AI Command</h2>
</div>
<div class="flex flex-col sm:flex-row gap-3">
<div class="flex-1">
<input
id="taskCommand"
type="text"
placeholder="Ask AI: 'Create task for project proposal', 'Show overdue tasks', 'Prioritize my tasks by urgency'"
class="w-full px-4 py-3 rounded-xl border border-gray-300 bg-white text-gray-800 placeholder-gray-500 focus:border-orange-400 focus:ring-2 focus:ring-orange-400/50 outline-none transition-all"
/>
</div>
<button
onclick="executeTaskCommand()"
class="w-full sm:w-auto bg-orange-600 hover:bg-orange-700 text-white px-6 py-3 rounded-xl font-semibold transition-all flex items-center justify-center gap-2 min-w-[120px]"
id="taskAiBtn"
>
<i class="fas fa-robot"></i>
<span>Execute</span>
</button>
</div>
<!-- Quick Commands -->
<div class="mt-4 flex flex-wrap gap-2">
<span class="text-sm text-gray-500 mr-2">Quick commands:</span>
<button onclick="setTaskCommand('Show overdue tasks')" class="text-xs bg-orange-100 hover:bg-orange-200 text-orange-700 px-3 py-1 rounded-full transition-colors">
Overdue Tasks
</button>
<button onclick="setTaskCommand('Create daily standup task')" class="text-xs bg-orange-100 hover:bg-orange-200 text-orange-700 px-3 py-1 rounded-full transition-colors">
Create Task
</button>
<button onclick="setTaskCommand('Prioritize by deadline')" class="text-xs bg-orange-100 hover:bg-orange-200 text-orange-700 px-3 py-1 rounded-full transition-colors">
Smart Prioritize
</button>
</div>
</div>
<!-- Stats Dashboard -->
<div class="grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8">
<div class="bg-white rounded-xl p-4 shadow-lg border border-gray-200">
<div class="text-center">
<div class="w-10 h-10 bg-red-100 rounded-lg flex items-center justify-center mx-auto mb-2">
<i class="fas fa-exclamation-triangle text-red-600"></i>
</div>
<div class="text-2xl font-bold text-gray-800" id="overdueCount">3</div>
<div class="text-sm text-gray-500">Overdue</div>
</div>
</div>
<div class="bg-white rounded-xl p-4 shadow-lg border border-gray-200">
<div class="text-center">
<div class="w-10 h-10 bg-orange-100 rounded-lg flex items-center justify-center mx-auto mb-2">
<i class="fas fa-clock text-orange-600"></i>
</div>
<div class="text-2xl font-bold text-gray-800" id="dueTodayCount">4</div>
<div class="text-sm text-gray-500">Due Today</div>
</div>
</div>
<div class="bg-white rounded-xl p-4 shadow-lg border border-gray-200">
<div class="text-center">
<div class="w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center mx-auto mb-2">
<i class="fas fa-list text-blue-600"></i>
</div>
<div class="text-2xl font-bold text-gray-800" id="totalTasks">15</div>
<div class="text-sm text-gray-500">Active</div>
</div>
</div>
<div class="bg-white rounded-xl p-4 shadow-lg border border-gray-200">
<div class="text-center">
<div class="w-10 h-10 bg-green-100 rounded-lg flex items-center justify-center mx-auto mb-2">
<i class="fas fa-check-circle text-green-600"></i>
</div>
<div class="text-2xl font-bold text-gray-800" id="completedToday">8</div>
<div class="text-sm text-gray-500">Completed</div>
</div>
</div>
</div>
<!-- Main Task Interface -->
<div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
<!-- Kanban Board -->
<div class="lg:col-span-3">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<!-- To Do Column -->
<div class="bg-white rounded-2xl p-4 shadow-lg border border-gray-200">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-bold text-gray-800 flex items-center gap-2">
<div class="w-3 h-3 bg-gray-400 rounded-full"></div>
To Do
</h3>
<span class="text-sm text-gray-500 bg-gray-100 px-2 py-1 rounded-full">7</span>
</div>
<div class="space-y-3 kanban-column custom-scrollbar overflow-y-auto">
<!-- High Priority Task -->
<div class="task-card task-overdue bg-red-50 p-4 rounded-lg border border-red-200">
<div class="flex items-start justify-between mb-2">
<h4 class="font-medium text-gray-800 text-sm">Website Security Audit</h4>
<span class="px-2 py-1 bg-red-100 text-red-700 text-xs rounded-full">High</span>
</div>
<p class="text-xs text-gray-600 mb-3">Complete security assessment and vulnerability report</p>
<div class="flex items-center justify-between text-xs text-gray-500">
<span><i class="fas fa-calendar mr-1"></i>2 days overdue</span>
<div class="flex items-center gap-1">
<i class="fas fa-paperclip"></i>
<span>3</span>
</div>
</div>
</div>
<!-- Medium Priority Task -->
<div class="task-card task-due-today bg-orange-50 p-4 rounded-lg border border-orange-200">
<div class="flex items-start justify-between mb-2">
<h4 class="font-medium text-gray-800 text-sm">Update Employee Handbook</h4>
<span class="px-2 py-1 bg-orange-100 text-orange-700 text-xs rounded-full">Medium</span>
</div>
<p class="text-xs text-gray-600 mb-3">Revise policies and procedures section</p>
<div class="flex items-center justify-between text-xs text-gray-500">
<span><i class="fas fa-clock mr-1"></i>Due today</span>
<div class="flex items-center gap-1">
<i class="fas fa-comment"></i>
<span>2</span>
</div>
</div>
</div>
<!-- Low Priority Task -->
<div class="task-card task-upcoming bg-blue-50 p-4 rounded-lg border border-blue-200">
<div class="flex items-start justify-between mb-2">
<h4 class="font-medium text-gray-800 text-sm">Plan Team Building Event</h4>
<span class="px-2 py-1 bg-green-100 text-green-700 text-xs rounded-full">Low</span>
</div>
<p class="text-xs text-gray-600 mb-3">Organize quarterly team activity</p>
<div class="flex items-center justify-between text-xs text-gray-500">
<span><i class="fas fa-calendar mr-1"></i>Due Dec 15</span>
<div class="flex items-center gap-1">
<i class="fas fa-users"></i>
<span>Team</span>
</div>
</div>
</div>
</div>
</div>
<!-- In Progress Column -->
<div class="bg-white rounded-2xl p-4 shadow-lg border border-gray-200">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-bold text-gray-800 flex items-center gap-2">
<div class="w-3 h-3 bg-orange-400 rounded-full"></div>
In Progress
</h3>
<span class="text-sm text-gray-500 bg-gray-100 px-2 py-1 rounded-full">4</span>
</div>
<div class="space-y-3 kanban-column custom-scrollbar overflow-y-auto">
<div class="task-card bg-gray-50 p-4 rounded-lg border border-gray-200">
<div class="flex items-start justify-between mb-2">
<h4 class="font-medium text-gray-800 text-sm">Q4 Financial Report</h4>
<span class="px-2 py-1 bg-orange-100 text-orange-700 text-xs rounded-full">High</span>
</div>
<p class="text-xs text-gray-600 mb-3">Prepare quarterly financial analysis</p>
<div class="w-full bg-gray-200 rounded-full h-2 mb-2">
<div class="progress-bar rounded-full" style="width: 65%"></div>
</div>
<div class="flex items-center justify-between text-xs text-gray-500">
<span>65% complete</span>
<span><i class="fas fa-calendar mr-1"></i>Due Dec 10</span>
</div>
</div>
<div class="task-card bg-gray-50 p-4 rounded-lg border border-gray-200">
<div class="flex items-start justify-between mb-2">
<h4 class="font-medium text-gray-800 text-sm">API Documentation</h4>
<span class="px-2 py-1 bg-blue-100 text-blue-700 text-xs rounded-full">Medium</span>
</div>
<p class="text-xs text-gray-600 mb-3">Document new REST API endpoints</p>
<div class="w-full bg-gray-200 rounded-full h-2 mb-2">
<div class="progress-bar rounded-full" style="width: 30%"></div>
</div>
<div class="flex items-center justify-between text-xs text-gray-500">
<span>30% complete</span>
<span><i class="fas fa-code mr-1"></i>Development</span>
</div>
</div>
</div>
</div>
<!-- Done Column -->
<div class="bg-white rounded-2xl p-4 shadow-lg border border-gray-200">
<div class="flex items-center justify-between mb-4">
<h3 class="text-lg font-bold text-gray-800 flex items-center gap-2">
<div class="w-3 h-3 bg-green-400 rounded-full"></div>
Done
</h3>
<span class="text-sm text-gray-500 bg-gray-100 px-2 py-1 rounded-full">8</span>
</div>
<div class="space-y-3 kanban-column custom-scrollbar overflow-y-auto">
<div class="task-card task-completed bg-green-50 p-4 rounded-lg border border-green-200">
<div class="flex items-start justify-between mb-2">
<h4 class="font-medium text-gray-800 text-sm line-through">Deploy Production Update</h4>
<i class="fas fa-check-circle text-green-600"></i>
</div>
<p class="text-xs text-gray-600 mb-3">Release v2.1.3 to production servers</p>
<div class="flex items-center justify-between text-xs text-gray-500">
<span><i class="fas fa-check mr-1"></i>Completed today</span>
<span>2 hours ago</span>
</div>
</div>
<div class="task-card task-completed bg-green-50 p-4 rounded-lg border border-green-200">
<div class="flex items-start justify-between mb-2">
<h4 class="font-medium text-gray-800 text-sm line-through">Client Presentation</h4>
<i class="fas fa-check-circle text-green-600"></i>
</div>
<p class="text-xs text-gray-600 mb-3">Present Q4 strategy to ABC Corp</p>
<div class="flex items-center justify-between text-xs text-gray-500">
<span><i class="fas fa-check mr-1"></i>Completed</span>
<span>Yesterday</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- AI Actions Panel -->
<div class="space-y-6">
<!-- Quick Actions -->
<div class="bg-white rounded-2xl p-6 shadow-lg border border-gray-200">
<h3 class="text-lg font-bold text-gray-800 mb-4">Quick Actions</h3>
<div class="space-y-3">
<button onclick="createTask()" class="w-full p-3 bg-orange-600 hover:bg-orange-700 rounded-lg text-white font-medium transition-colors flex items-center gap-3">
<i class="fas fa-plus"></i>
<span>Create Task</span>
</button>
<button onclick="prioritizeTasks()" class="w-full p-3 bg-purple-600 hover:bg-purple-700 rounded-lg text-white font-medium transition-colors flex items-center gap-3">
<i class="fas fa-sort-amount-down"></i>
<span>AI Prioritize</span>
</button>
<button onclick="bulkUpdate()" class="w-full p-3 bg-blue-600 hover:bg-blue-700 rounded-lg text-white font-medium transition-colors flex items-center gap-3">
<i class="fas fa-edit"></i>
<span>Bulk Update</span>
</button>
<button onclick="generateReport()" class="w-full p-3 bg-green-600 hover:bg-green-700 rounded-lg text-white font-medium transition-colors flex items-center gap-3">
<i class="fas fa-chart-bar"></i>
<span>Progress Report</span>
</button>
</div>
</div>
<!-- Productivity Insights -->
<div class="bg-white rounded-2xl p-6 shadow-lg border border-gray-200">
<h3 class="text-lg font-bold text-gray-800 mb-4">Productivity Insights</h3>
<div class="space-y-4">
<div class="bg-green-50 rounded-lg p-3 border border-green-200">
<h4 class="font-medium text-green-700 mb-1">Completion Rate</h4>
<div class="w-full bg-gray-200 rounded-full h-2 mb-1">
<div class="bg-green-500 h-2 rounded-full" style="width: 87%"></div>
</div>
<p class="text-sm text-green-600">87% (Above average)</p>
</div>
<div class="bg-blue-50 rounded-lg p-3 border border-blue-200">
<h4 class="font-medium text-blue-700 mb-1">Focus Score</h4>
<div class="text-2xl font-bold text-blue-600">8.2/10</div>
<p class="text-sm text-blue-600">Excellent focus</p>
</div>
<div class="bg-orange-50 rounded-lg p-3 border border-orange-200">
<h4 class="font-medium text-orange-700 mb-1">Avg Task Time</h4>
<p class="text-lg font-bold text-orange-600">2.3 days</p>
<p class="text-sm text-orange-600">15% faster this week</p>
</div>
</div>
</div>
<!-- AI Recommendations -->
<div class="bg-white rounded-2xl p-6 shadow-lg border border-gray-200">
<h3 class="text-lg font-bold text-gray-800 mb-4">AI Recommendations</h3>
<div class="space-y-3">
<div class="bg-red-50 border border-red-200 rounded-lg p-3">
<h4 class="font-medium text-red-700 mb-1">🚨 Urgent Action</h4>
<p class="text-sm text-red-600">Security audit is 2 days overdue</p>
</div>
<div class="bg-blue-50 border border-blue-200 rounded-lg p-3">
<h4 class="font-medium text-blue-700 mb-1">💡 Suggestion</h4>
<p class="text-sm text-blue-600">Break large tasks into smaller chunks</p>
</div>
<div class="bg-green-50 border border-green-200 rounded-lg p-3">
<h4 class="font-medium text-green-700 mb-1">✨ Optimization</h4>
<p class="text-sm text-green-600">Batch similar tasks for efficiency</p>
</div>
</div>
</div>
<!-- Recent AI Actions -->
<div class="bg-white rounded-2xl p-6 shadow-lg border border-gray-200">
<h3 class="text-lg font-bold text-gray-800 mb-4">Recent AI Actions</h3>
<div class="space-y-3 custom-scrollbar max-h-48 overflow-y-auto">
<div class="flex items-start gap-3 p-2 bg-gray-50 rounded-lg">
<div class="w-6 h-6 bg-orange-100 rounded flex items-center justify-center flex-shrink-0 mt-1">
<i class="fas fa-sort text-orange-600 text-xs"></i>
</div>
<div class="flex-1 min-w-0">
<p class="text-sm text-gray-800">Auto-prioritized 5 tasks</p>
<p class="text-xs text-gray-500">3 minutes ago</p>
</div>
</div>
<div class="flex items-start gap-3 p-2 bg-gray-50 rounded-lg">
<div class="w-6 h-6 bg-green-100 rounded flex items-center justify-center flex-shrink-0 mt-1">
<i class="fas fa-check text-green-600 text-xs"></i>
</div>
<div class="flex-1 min-w-0">
<p class="text-sm text-gray-800">Marked deployment complete</p>
<p class="text-xs text-gray-500">2 hours ago</p>
</div>
</div>
<div class="flex items-start gap-3 p-2 bg-gray-50 rounded-lg">
<div class="w-6 h-6 bg-blue-100 rounded flex items-center justify-center flex-shrink-0 mt-1">
<i class="fas fa-plus text-blue-600 text-xs"></i>
</div>
<div class="flex-1 min-w-0">
<p class="text-sm text-gray-800">Created 3 subtasks</p>
<p class="text-xs text-gray-500">4 hours ago</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- AI Response Modal -->
<div id="aiModal" class="hidden fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-4">
<div class="bg-white rounded-2xl max-w-2xl w-full max-h-[80vh] overflow-hidden">
<div class="p-6 border-b border-gray-200">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-10 h-10 bg-orange-100 rounded-lg flex items-center justify-center">
<i class="fas fa-robot text-orange-600"></i>
</div>
<h3 class="text-lg font-bold text-gray-800">Task AI Response</h3>
</div>
<button onclick="closeAIModal()" class="text-gray-400 hover:text-gray-600">
<i class="fas fa-times"></i>
</button>
</div>
</div>
<div class="p-6 overflow-y-auto custom-scrollbar" id="aiResponse">
<!-- AI response content will be loaded here -->
</div>
</div>
</div>
<script>
// Navigation function
function goHome() {
if (confirm('Return to AI Services Hub?')) {
alert('Navigating to AI Services Hub...\n\nIn production, this would load: index.html');
}
}
// Initialize
document.addEventListener('DOMContentLoaded', function() {
updateLastUpdate();
initializeEventListeners();
});
function initializeEventListeners() {
document.getElementById('taskCommand').addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
executeTaskCommand();
}
});
}
function updateLastUpdate() {
document.getElementById('lastUpdate').textContent = new Date().toLocaleTimeString();
}
function setTaskCommand(command) {
document.getElementById('taskCommand').value = command;
executeTaskCommand();
}
async function executeTaskCommand() {
const command = document.getElementById('taskCommand').value.trim();
if (!command) {
alert('Please enter a command');
return;
}
const btn = document.getElementById('taskAiBtn');
btn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Processing...';
btn.disabled = true;
try {
// Simulate AI processing
await new Promise(resolve => setTimeout(resolve, 1500));
const response = generateTaskAIResponse(command);
showAIModal(response);
// Update stats
updateTaskStats();
updateLastUpdate();
} catch (error) {
alert('Error processing command: ' + error.message);
} finally {
btn.innerHTML = '<i class="fas fa-robot"></i> <span>Execute</span>';
btn.disabled = false;
document.getElementById('taskCommand').value = '';
}
}
function generateTaskAIResponse(command) {
const lowerCommand = command.toLowerCase();
if (lowerCommand.includes('overdue')) {
return `
<div class="space-y-4">
<h4 class="text-lg font-semibold text-gray-800">⚠️ Overdue Tasks Analysis</h4>
<div class="space-y-3">
<div class="border-l-4 border-red-500 bg-red-50 p-4 rounded-r-lg">
<div class="flex justify-between items-start">
<div>
<h5 class="font-medium text-red-800">Website Security Audit</h5>
<p class="text-sm text-red-600">Complete security assessment and report</p>
<div class="flex items-center gap-4 mt-2 text-xs text-red-700">
<span><i class="fas fa-calendar mr-1"></i>2 days overdue</span>
<span><i class="fas fa-exclamation-triangle mr-1"></i>High Priority</span>
</div>
</div>
</div>
</div>
<div class="border-l-4 border-orange-500 bg-orange-50 p-4 rounded-r-lg">
<div class="flex justify-between items-start">
<div>
<h5 class="font-medium text-orange-800">Update Employee Handbook</h5>
<p class="text-sm text-orange-600">Revise policies and procedures</p>
<div class="flex items-center gap-4 mt-2 text-xs text-orange-700">
<span><i class="fas fa-calendar mr-1"></i>1 day overdue</span>
<span><i class="fas fa-clock mr-1"></i>Medium Priority</span>
</div>
</div>
</div>
</div>
</div>
<div class="bg-blue-50 border border-blue-200 p-4 rounded-lg">
<h5 class="font-medium text-blue-800 mb-2">🤖 AI Recommendations</h5>
<ul class="text-sm text-blue-700 space-y-1">
<li>• Immediately allocate 4 hours for security audit completion</li>
<li>• Break handbook update into 30-minute daily chunks</li>
<li>• Set up automated reminders 1 day before deadlines</li>
<li>• Consider delegating non-critical sections</li>
</ul>
</div>
<div class="flex gap-3">
<button class="flex-1 bg-red-600 text-white py-2 px-4 rounded-lg hover:bg-red-700 transition-colors">Mark as Priority</button>
<button class="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">Reschedule</button>
</div>
</div>
`;
}
return `
<div class="space-y-4">
<h4 class="text-lg font-semibold text-gray-800">🤖 Task AI Response</h4>
<div class="bg-orange-50 border border-orange-200 p-4 rounded-lg">
<p class="text-orange-700">Processing your request: "<em>${command}</em>"</p>
<p class="text-sm text-orange-600 mt-2">I can help you with:</p>
<ul class="mt-3 space-y-1 text-sm text-orange-700">
<li>• Smart task creation and categorization</li>
<li>• Priority scoring and optimization</li>
<li>• Deadline management and reminders</li>
<li>• Progress tracking and analytics</li>
<li>• Workload balancing and delegation</li>
</ul>
</div>
</div>
`;
}
function showAIModal(content) {
document.getElementById('aiResponse').innerHTML = content;
document.getElementById('aiModal').classList.remove('hidden');
}
function closeAIModal() {
document.getElementById('aiModal').classList.add('hidden');
}
function updateTaskStats() {
const completedToday = document.getElementById('completedToday');
const current = parseInt(completedToday.textContent);
completedToday.textContent = current + 1;
}
// Quick action functions
function createTask() {
showAIModal(`
<div class="space-y-4">
<h4 class="text-lg font-semibold text-gray-800"> Quick Task Creation</h4>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Task Title:</label>
<input type="text" class="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-orange-500 focus:border-orange-500" placeholder="Enter task description">
</div>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Priority:</label>
<select class="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-orange-500 focus:border-orange-500">
<option value="low">Low</option>
<option value="medium" selected>Medium</option>
<option value="high">High</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Due Date:</label>
<input type="date" class="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-orange-500 focus:border-orange-500">
</div>
</div>
<div class="bg-orange-50 border border-orange-200 p-4 rounded-lg">
<h5 class="font-medium text-orange-800 mb-2">🤖 AI Assistance</h5>
<ul class="text-sm text-orange-700 space-y-1">
<li>• Auto-categorization based on description</li>
<li>• Smart deadline suggestions</li>
<li>• Related task recommendations</li>
<li>• Optimal time slot suggestions</li>
</ul>
</div>
<button class="w-full bg-orange-600 text-white py-3 px-4 rounded-lg hover:bg-orange-700 transition-colors font-medium">
Create Task
</button>
</div>
</div>
`);
}
function prioritizeTasks() {
if (confirm('Let AI re-prioritize all tasks based on urgency, impact, and deadlines?')) {
updateTaskStats();
alert('🎯 Tasks prioritized! AI algorithm ranked 15 tasks by optimal completion order. Security audit moved to top priority.');
}
}
function bulkUpdate() {
updateTaskStats();
alert('📝 Bulk update completed! Modified 8 tasks with new deadlines and priorities.');
}
function generateReport() {
updateTaskStats();
alert('📊 Progress report generated! 87% completion rate this week, 15% faster than average.');
}
// Task interaction functions
function markTaskComplete(taskId) {
updateTaskStats();
alert('✅ Task marked as complete!');
}
function editTask(taskId) {
alert('📝 Opening task editor...');
}
function deleteTask(taskId) {
if (confirm('Are you sure you want to delete this task?')) {
alert('🗑️ Task deleted successfully');
}
}
</script>
</body>
</html>