anycoder-2074e21c / index.html
HI7RAI's picture
Upload folder using huggingface_hub
cd8cd62 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TaskFlow - Productivity App</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
--primary: #6366f1;
--primary-dark: #4f46e5;
--primary-light: #818cf8;
--secondary: #10b981;
--danger: #ef4444;
--warning: #f59e0b;
--background: #0f172a;
--surface: #1e293b;
--surface-light: #334155;
--text: #f8fafc;
--text-muted: #94a3b8;
--border: #475569;
--shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: var(--background);
color: var(--text);
min-height: 100vh;
line-height: 1.6;
}
/* Animated background */
.bg-pattern {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
overflow: hidden;
}
.bg-pattern::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background:
radial-gradient(ellipse at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
radial-gradient(ellipse at 80% 70%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
animation: float 20s ease-in-out infinite;
}
@keyframes float {
0%, 100% { transform: translate(0, 0) rotate(0deg); }
33% { transform: translate(2%, 2%) rotate(1deg); }
66% { transform: translate(-1%, 1%) rotate(-1deg); }
}
/* Header */
header {
background: rgba(30, 41, 59, 0.8);
backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border);
padding: 1rem 2rem;
position: sticky;
top: 0;
z-index: 100;
}
.header-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
display: flex;
align-items: center;
gap: 0.75rem;
font-size: 1.5rem;
font-weight: 700;
color: var(--text);
text-decoration: none;
}
.logo-icon {
width: 40px;
height: 40px;
background: linear-gradient(135deg, var(--primary), var(--primary-light));
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.25rem;
}
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
}
.nav-links a {
color: var(--text-muted);
text-decoration: none;
font-weight: 500;
transition: color 0.3s;
}
.nav-links a:hover {
color: var(--text);
}
/* Main content */
main {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
}
/* Stats cards */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.5rem;
margin-bottom: 2rem;
}
.stat-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
padding: 1.5rem;
transition: all 0.3s;
}
.stat-card:hover {
transform: translateY(-4px);
border-color: var(--primary);
box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}
.stat-icon {
width: 48px;
height: 48px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
margin-bottom: 1rem;
}
.stat-icon.primary { background: rgba(99, 102, 241, 0.2); }
.stat-icon.success { background: rgba(16, 185, 129, 0.2); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.2); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.2); }
.stat-value {
font-size: 2rem;
font-weight: 700;
margin-bottom: 0.25rem;
}
.stat-label {
color: var(--text-muted);
font-size: 0.875rem;
}
/* Task input */
.task-input-section {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
padding: 1.5rem;
margin-bottom: 2rem;
}
.task-input-wrapper {
display: flex;
gap: 1rem;
flex-wrap: wrap;
}
.task-input {
flex: 1;
min-width: 250px;
padding: 1rem 1.25rem;
background: var(--background);
border: 2px solid var(--border);
border-radius: 12px;
color: var(--text);
font-size: 1rem;
font-family: inherit;
transition: all 0.3s;
}
.task-input:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.task-input::placeholder {
color: var(--text-muted);
}
.priority-select {
padding: 1rem 1.25rem;
background: var(--background);
border: 2px solid var(--border);
border-radius: 12px;
color: var(--text);
font-size: 1rem;
font-family: inherit;
cursor: pointer;
transition: all 0.3s;
}
.priority-select:focus {
outline: none;
border-color: var(--primary);
}
.add-btn {
padding: 1rem 2rem;
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
border: none;
border-radius: 12px;
color: white;
font-size: 1rem;
font-weight: 600;
font-family: inherit;
cursor: pointer;
transition: all 0.3s;
display: flex;
align-items: center;
gap: 0.5rem;
}
.add-btn:hover {
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}
/* Task list */
.tasks-section {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
padding: 1.5rem;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}
.section-title {
font-size: 1.25rem;
font-weight: 600;
}
.filter-btns {
display: flex;
gap: 0.5rem;
}
.filter-btn {
padding: 0.5rem 1rem;
background: transparent;
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text-muted);
font-size: 0.875rem;
font-family: inherit;
cursor: pointer;
transition: all 0.3s;
}
.filter-btn.active, .filter-btn:hover {
background: var(--primary);
border-color: var(--primary);
color: white;
}
.task-list {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.task-item {
display: flex;
align-items: center;
gap: 1rem;
padding: 1rem 1.25rem;
background: var(--background);
border: 1px solid var(--border);
border-radius: 12px;
transition: all 0.3s;
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateX(-20px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
.task-item:hover {
border-color: var(--surface-light);
}
.task-item.completed {
opacity: 0.6;
}
.task-item.completed .task-text {
text-decoration: line-through;
}
.task-checkbox {
width: 24px;
height: 24px;
border: 2px solid var(--border);
border-radius: 6px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s;
flex-shrink: 0;
}
.task-checkbox:hover {
border-color: var(--primary);
}
.task-checkbox.checked {
background: var(--secondary);
border-color: var(--secondary);
}
.task-content {
flex: 1;
min-width: 0;
}
.task-text {
font-weight: 500;
margin-bottom: 0.25rem;
word-break: break-word;
}
.task-meta {
display: flex;
gap: 1rem;
font-size: 0.75rem;
color: var(--text-muted);
}
.priority-badge {
padding: 0.25rem 0.75rem;
border-radius: 20px;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
}
.priority-badge.high {
background: rgba(239, 68, 68, 0.2);
color: #f87171;
}
.priority-badge.medium {
background: rgba(245, 158, 11, 0.2);
color: #fbbf24;
}
.priority-badge.low {
background: rgba(16, 185, 129, 0.2);
color: #34d399;
}
.delete-btn {
padding: 0.5rem;
background: transparent;
border: none;
color: var(--text-muted);
cursor: pointer;
border-radius: 8px;
transition: all 0.3s;
font-size: 1.25rem;
}
.delete-btn:hover {
background: rgba(239, 68, 68, 0.2);
color: var(--danger);
}
/* Empty state */
.empty-state {
text-align: center;
padding: 3rem;
color: var(--text-muted);
}
.empty-icon {
font-size: 4rem;
margin-bottom: 1rem;
opacity: 0.5;
}
/* Progress bar */
.progress-section {
margin-top: 2rem;
padding: 1.5rem;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
}
.progress-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.progress-bar {
height: 12px;
background: var(--background);
border-radius: 6px;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--primary), var(--secondary));
border-radius: 6px;
transition: width 0.5s ease;
}
/* Footer */
footer {
text-align: center;
padding: 2rem;
color: var(--text-muted);
font-size: 0.875rem;
}
footer a {
color: var(--primary-light);
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
/* Responsive */
@media (max-width: 768px) {
.header-content {
flex-direction: column;
gap: 1rem;
}
.nav-links {
gap: 1rem;
}
main {
padding: 1rem;
}
.task-input-wrapper {
flex-direction: column;
}
.task-input, .priority-select, .add-btn {
width: 100%;
}
.filter-btns {
flex-wrap: wrap;
}
}
/* Notification toast */
.toast {
position: fixed;
bottom: 2rem;
right: 2rem;
padding: 1rem 1.5rem;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
box-shadow: var(--shadow);
animation: slideUp 0.3s ease-out;
z-index: 1000;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.toast.success {
border-color: var(--secondary);
}
.toast.error {
border-color: var(--danger);
}
</style>
</head>
<body>
<div class="bg-pattern"></div>
<header>
<div class="header-content">
<a href="#" class="logo">
<div class="logo-icon"></div>
<span>TaskFlow</span>
</a>
<nav>
<ul class="nav-links">
<li><a href="#" onclick="filterTasks('all')">All Tasks</a></li>
<li><a href="#" onclick="filterTasks('active')">Active</a></li>
<li><a href="#" onclick="filterTasks('completed')">Completed</a></li>
</ul>
</nav>
</div>
</header>
<main>
<!-- Stats Grid -->
<div class="stats-grid">
<div class="stat-card">
<div class="stat-icon primary">📋</div>
<div class="stat-value" id="totalTasks">0</div>
<div class="stat-label">Total Tasks</div>
</div>
<div class="stat-card">
<div class="stat-icon success"></div>
<div class="stat-value" id="completedTasks">0</div>
<div class="stat-label">Completed</div>
</div>
<div class="stat-card">
<div class="stat-icon warning"></div>
<div class="stat-value" id="pendingTasks">0</div>
<div class="stat-label">Pending</div>
</div>
<div class="stat-card">
<div class="stat-icon danger">🔥</div>
<div class="stat-value" id="highPriorityTasks">0</div>
<div class="stat-label">High Priority</div>
</div>
</div>
<!-- Task Input -->
<div class="task-input-section">
<div class="task-input-wrapper">
<input type="text" class="task-input" id="taskInput" placeholder="What needs to be done?" onkeypress="handleEnter(event)">
<select class="priority-select" id="prioritySelect">
<option value="low">Low Priority</option>
<option value="medium" selected>Medium Priority</option>
<option value="high">High Priority</option>
</select>
<button class="add-btn" onclick="addTask()">
<span>+</span> Add Task
</button>
</div>
</div>
<!-- Task List -->
<div class="tasks-section">
<div class="section-header">
<h2 class="section-title">Your Tasks</h2>
<div class="filter-btns">
<button class="filter-btn active" onclick="filterTasks('all')">All</button>
<button class="filter-btn" onclick="filterTasks('active')">Active</button>
<button class="filter-btn" onclick="filterTasks('completed')">Completed</button>
</div>
</div>
<div class="task-list" id="taskList">
<div class="empty-state">
<div class="empty-icon">📝</div>
<p>No tasks yet. Add your first task above!</p>
</div>
</div>
</div>
<!-- Progress -->
<div class="progress-section">
<div class="progress-header">
<span class="section-title">Progress</span>
<span id="progressText">0% Complete</span>
</div>
<div class="progress-bar">
<div class="progress-fill" id="progressFill" style="width: 0%"></div>
</div>
</div>
</main>
<footer>
<p>Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a> - AI-Powered Code Generation</p>
</footer>
<script>
// Task storage
let tasks = JSON.parse(localStorage.getItem('tasks')) || [];
let currentFilter = 'all';
// Initialize
document.addEventListener('DOMContentLoaded', () => {
renderTasks();
updateStats();
});
// Add task
function addTask() {
const input = document.getElementById('taskInput');
const priority = document.getElementById('prioritySelect');
const text = input.value.trim();
if (!text) {
showToast('Please enter a task!', 'error');
return;
}
const task = {
id: Date.now(),
text: text,
priority: priority.value,
completed: false,
createdAt: new Date().toLocaleDateString()
};
tasks.push(task);
saveTasks();
renderTasks();
updateStats();
input.value = '';
input.focus();
showToast('Task added successfully!', 'success');
}
// Handle Enter key
function handleEnter(event) {
if (event.key === 'Enter') {
addTask();
}
}
// Toggle task completion
function toggleTask(id) {
tasks = tasks.map(task => {
if (task.id === id) {
return { ...task, completed: !task.completed };
}
return task;
});
saveTasks();
renderTasks();
updateStats();
}
// Delete task
function deleteTask(id) {
tasks = tasks.filter(task => task.id !== id);
saveTasks();
renderTasks();
updateStats();
showToast('Task deleted!', 'success');
}
// Filter tasks
function filterTasks(filter) {
currentFilter = filter;
// Update button states
document.querySelectorAll('.filter-btn').forEach(btn => {
btn.classList.remove('active');
if (btn.textContent.toLowerCase().includes(filter === 'all' ? 'all' : filter)) {
btn.classList.add('active');
}
});
renderTasks();
}
// Render tasks
function renderTasks() {
const taskList = document.getElementById('taskList');
let filteredTasks = tasks;
if (currentFilter === 'active') {
filteredTasks = tasks.filter(task => !task.completed);
} else if (currentFilter === 'completed') {
filteredTasks = tasks.filter(task => task.completed);
}
if (filteredTasks.length === 0) {
taskList.innerHTML = `
<div class="empty-state">
<div class="empty-icon">${currentFilter === 'completed' ? '🎉' : '📝'}</div>
<p>${currentFilter === 'completed' ? 'No completed tasks yet!' : 'No tasks found. Add your first task!'}</p>
</div>
`;
return;
}
taskList.innerHTML = filteredTasks.map(task => `
<div class="task-item ${task.completed ? 'completed' : ''}">
<div class="task-checkbox ${task.completed ? 'checked' : ''}" onclick="toggleTask(${task.id})">
${task.completed ? '✓' : ''}
</div>
<div class="task-content">
<div class="task-text">${escapeHtml(task.text)}</div>
<div class="task-meta">
<span class="priority-badge ${task.priority}">${task.priority}</span>
<span>${task.createdAt}</span>
</div>
</div>
<button class="delete-btn" onclick="deleteTask(${task.id})" title="Delete task">×</button>
</div>
`).join('');
}
// Update statistics
function updateStats() {
const total = tasks.length;
const completed = tasks.filter(t => t.completed).length;
const pending = total - completed;
const highPriority = tasks.filter(t => t.priority === 'high' && !t.completed).length;
document.getElementById('totalTasks').textContent = total;
document.getElementById('completedTasks').textContent = completed;
document.getElementById('pendingTasks').textContent = pending;
document.getElementById('highPriorityTasks').textContent = highPriority;
// Update progress
const percentage = total > 0 ? Math.round((completed / total) * 100) : 0;
document.getElementById('progressFill').style.width = percentage + '%';
document.getElementById('progressText').textContent = percentage + '% Complete';
}
// Save to localStorage
function saveTasks() {
localStorage.setItem('tasks', JSON.stringify(tasks));
}
// Show toast notification
function showToast(message, type) {
const existingToast = document.querySelector('.toast');
if (existingToast) {
existingToast.remove();
}
const toast = document.createElement('div');
toast.className = `toast ${type}`;
toast.textContent = message;
document.body.appendChild(toast);
setTimeout(() => {
toast.remove();
}, 3000);
}
// Escape HTML to prevent XSS
function escapeHtml(text) {
const div = document.createElement('div');
div.textContent = text;
return div.innerHTML;
}
</script>
</body>
</html>