Let me create a visually striking, modern to-do app that doesn't look like a generic template. I'll focus on:
Let me design this with a brutalist/technical aesthetic that feels intentional and modern.
A sleek, brutalist-inspired task manager with drag-and-drop reordering and persistent local storage.
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TASKS — Minimal Todo</title>
<script src="https://cdn.tailwindcss.com"></script>
<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=DM+Sans:wght@400;500;600&family=Space+Grotesk:wght@400;500;700&display=swap" rel="stylesheet">
<style>
:root {
--bg: #08080c;
--surface: #111118;
--card: #18181f;
--border: #2a2a35;
--fg: #f0f0f5;
--muted: #6b6b7b;
--accent: #00ffd5;
--accent-dim: rgba(0, 255, 213, 0.1);
--danger: #ff4757;
}
* {
box-sizing: border-box;
}
body {
font-family: 'DM Sans', sans-serif;
background: var(--bg);
color: var(--fg);
min-height: 100vh;
}
.font-display {
font-family: 'Space Grotesk', sans-serif;
}
/* Background atmosphere */
.bg-atmosphere {
position: fixed;
inset: 0;
pointer-events: none;
background:
radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 255, 213, 0.08), transparent),
radial-gradient(ellipse 60% 40% at 100% 100%, rgba(0, 255, 213, 0.04), transparent);
z-index: -1;
}
.noise-overlay {
position: fixed;
inset: 0;
pointer-events: none;
opacity: 0.03;
z-index: -1;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}
/* Task item animations */
.task-item {
transform: translateY(0);
transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.task-item.dragging {
opacity: 0.5;
transform: scale(1.02);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.task-item.drag-over {
border-color: var(--accent);
background: var(--accent-dim);
}
.task-item.entering {
animation: slideIn 0.3s ease forwards;
}
.task-item.leaving {
animation: slideOut 0.3s ease forwards;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideOut {
to {
opacity: 0;
transform: translateX(30px);
}
}
/* Staggered entrance */
.stagger-item {
opacity: 0;
transform: translateY(20px);
}
.stagger-item.visible {
animation: fadeUp 0.5s ease forwards;
}
@keyframes fadeUp {
to {
opacity: 1;
transform: translateY(0);
}
}
/* Custom checkbox */
.custom-checkbox {
position: relative;
width: 22px;
height: 22px;
border: 2px solid var(--border);
border-radius: 6px;
cursor: pointer;
transition: all 0.2s ease;
flex-shrink: 0;
}
.custom-checkbox:hover {
border-color: var(--accent);
}
.custom-checkbox.checked {
background: var(--accent);
border-color: var(--accent);
}
.custom-checkbox.checked::after {
content: '';
position: absolute;
left: 6px;
top: 2px;
width: 6px;
height: 12px;
border: solid var(--bg);
border-width: 0 2px 2px 0;
transform: rotate(45deg);
animation: checkPop 0.2s ease;
}
@keyframes checkPop {
0% {
transform: rotate(45deg) scale(0);
}
50% {
transform: rotate(45deg) scale(1.2);
}
100% {
transform: rotate(45deg) scale(1);
}
}
/* Task text completed state */
.task-text.completed {
text-decoration: line-through;
color: var(--muted);
}
/* Focus states */
input:focus-visible, button:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* Scrollbar */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: var(--surface);
}
::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--muted);
}
/* Button hover effects */
.btn-primary {
position: relative;
overflow: hidden;
}
.btn-primary::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
transform: translateX(-100%);
transition: transform 0.5s ease;
}
.btn-primary:hover::before {
transform: translateX(100%);
}
/* Delete button */
.delete-btn {
opacity: 0;
transform: scale(0.8);
transition: all 0.2s ease;
}
.task-item:hover .delete-btn {
opacity: 1;
transform: scale(1);
}
/* Filter tabs */
.filter-tab {
position: relative;
transition: color 0.2s ease;
}
.filter-tab::after {
content: '';
position: absolute;
bottom: -2px;
left: 0;
right: 0;
height: 2px;
background: var(--accent);
transform: scaleX(0);
transition: transform 0.2s ease;
}
.filter-tab.active::after {
transform: scaleX(1);
}
.filter-tab.active {
color: var(--accent);
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
</style>
</head>
<body class="antialiased">
<div class="bg-atmosphere"></div>
<div class="noise-overlay"></div>
<main class="min-h-screen py-8 px-4 sm:py-12 sm:px-6">
<div class="max-w-xl mx-auto">
<!-- Header -->
<header class="mb-8 stagger-item" style="--delay: 0">
<div class="flex items-end justify-between mb-2">
<h1 class="font-display text-4xl sm:text-5xl font-bold tracking-tight">
TASKS
</h1>
<div class="text-right">
<p class="text-xs uppercase tracking-widest" style="color: var(--muted)">Progress</p>
<p class="font-display text-2xl font-bold" style="color: var(--accent)" id="progressText">0%</p>
</div>
</div>
<div class="h-1 rounded-full overflow-hidden" style="background: var(--surface)">
<div id="progressBar" class="h-full rounded-full transition-all duration-500" style="background: var(--accent); width: 0%"></div>
</div>
</header>
<!-- Input Section -->
<div class="mb-6 stagger-item" style="--delay: 1">
<form id="taskForm" class="flex gap-3">
<input
type="text"
id="taskInput"
placeholder="Add a new task..."
autocomplete="off"
class="flex-1 px-4 py-3 rounded-lg text-base transition-all duration-200"
style="background: var(--card); border: 1px solid var(--border); color: var(--fg);"
aria-label="New task input"
>
<button
type="submit"
class="btn-primary px-5 py-3 rounded-lg font-display font-medium text-base transition-all duration-200"
style="background: var(--accent); color: var(--bg);"
aria-label="Add task"
>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
</form>
</div>
<!-- Filter Tabs -->
<div class="flex gap-6 mb-5 border-b pb-3 stagger-item" style="--delay: 2; border-color: var(--border)">
<button class="filter-tab active font-medium text-sm py-1" data-filter="all">All</button>
<button class="filter-tab font-medium text-sm py-1" style="color: var(--muted)" data-filter="active">Active</button>
<button class="filter-tab font-medium text-sm py-1" style="color: var(--muted)" data-filter="completed">Completed</button>
</div>
<!-- Task List -->
<div id="taskList" class="space-y-3 stagger-item" style="--delay: 3">
<!-- Tasks will be rendered here -->
</div>
<!-- Empty State -->
<div id="emptyState" class="text-center py-16 hidden">
<div class="inline-flex items-center justify-center w-16 h-16 rounded-2xl mb-4" style="background: var(--card)">
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" style="color: var(--muted)">
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path>
<rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect>
</svg>
</div>
<p class="font-display text-lg font-medium mb-1">No tasks yet</p>
<p class="text-sm" style="color: var(--muted)">Add your first task to get started</p>
</div>
<!-- Clear Completed -->
<div class="mt-6 pt-4 flex justify-between items-center stagger-item" style="--delay: 4; border-top: 1px solid var(--border)">
<p class="text-sm" style="color: var(--muted)">
<span id="taskCount">0</span> tasks remaining
</p>
<button
id="clearCompleted"
class="text-sm font-medium transition-colors duration-200 hover:opacity-80"
style="color: var(--danger)"
aria-label="Clear completed tasks"
>
Clear Completed
</button>
</div>
</div>
</main>
<script>
// Initialize data structures first
const STORAGE_KEY = 'minimal-tasks-v1';
let tasks = [];
let currentFilter = 'all';
let draggedItem = null;
// DOM Elements (initialized after DOM ready check not needed with defer-like pattern)
const taskForm = document.getElementById('taskForm');
const taskInput = document.getElementById('taskInput');
const taskList = document.getElementById('taskList');
const emptyState = document.getElementById('emptyState');
const progressBar = document.getElementById('progressBar');
const progressText = document.getElementById('progressText');
const taskCount = document.getElementById('taskCount');
const clearCompletedBtn = document.getElementById('clearCompleted');
const filterTabs = document.querySelectorAll('.filter-tab');
// Load tasks from localStorage
function loadTasks() {
try {
const stored = localStorage.getItem(STORAGE_KEY);
if (stored) {
tasks = JSON.parse(stored);
}
} catch (e) {
console.error('Failed to load tasks:', e);
tasks = [];
}
}
// Save tasks to localStorage
function saveTasks() {
try {
localStorage.setItem(STORAGE_KEY, JSON.stringify(tasks));
} catch (e) {
console.error('Failed to save tasks:', e);
}
}
// Generate unique ID
function generateId() {
return Date.now().toString(36) + Math.random().toString(36).substring(2);
}
// Calculate progress
function updateProgress() {
const total = tasks.length;
const completed = tasks.filter(t => t.completed).length;
const percentage = total > 0 ? Math.round((completed / total) * 100) : 0;
progressBar.style.width = percentage + '%';
progressText.textContent = percentage + '%';
const activeCount = total - completed;
taskCount.textContent = activeCount;
}
// Create task element
function createTaskElement(task, index) {
const div = document.createElement('div');
div.className = 'task-item p-4 rounded-xl cursor-grab active:cursor-grabbing entering';
div.style.cssText = `background: var(--card); border: 1px solid var(--border);`;
div.dataset.id = task.id;
div.draggable = true;
div.style.animationDelay = `${index * 0.05}s`;
div.innerHTML = `
<div class="flex items-center gap-3">
<div
class="custom-checkbox ${task.completed ? 'checked' : ''}"
role="checkbox"
aria-checked="${task.completed}"
tabindex="0"
aria-label="Mark task as ${task.completed ? 'incomplete' : 'complete'}"
></div>
<span class="task-text flex-1 ${task.completed ? 'completed' : ''}">${escapeHtml(task.text)}</span>
<button
class="delete-btn p-2 rounded-lg transition-colors duration-200"
style="color: var(--muted)"
aria-label="Delete task"
>
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
`;
// Checkbox click handler
const checkbox = div.querySelector('.custom-checkbox');
checkbox.addEventListener('click', () => toggleTask(task.id));
checkbox.addEventListener('keydown', (e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
toggleTask(task.id);
}
});
// Delete click handler
const deleteBtn = div.querySelector('.delete-btn');
deleteBtn.addEventListener('click', (e) => {
e.stopPropagation();
deleteTask(task.id, div);
});
deleteBtn.addEventListener('mouseenter', () => {
deleteBtn.style.color = 'var(--danger)';
});
deleteBtn.addEventListener('mouseleave', () => {
deleteBtn.style.color = 'var(--muted)';
});
// Drag handlers
div.addEventListener('dragstart', handleDragStart);
div.addEventListener('dragend', handleDragEnd);
div.addEventListener('dragover', handleDragOver);
div.addEventListener('dragleave', handleDragLeave);
div.addEventListener('drop', handleDrop);
return div;
}
// Escape HTML to prevent XSS
function escapeHtml(text) {
const div = document.createElement('div');
div.textContent = text;
return div.innerHTML;
}
// Render tasks
function renderTasks() {
taskList.innerHTML = '';
let filteredTasks = tasks;
if (currentFilter === 'active') {
filteredTasks = tasks.filter(t => !t.completed);
} else if (currentFilter === 'completed') {
filteredTasks = tasks.filter(t => t.completed);
}
if (filteredTasks.length === 0) {
emptyState.classList.remove('hidden');
taskList.classList.add('hidden');
} else {
emptyState.classList.add('hidden');
taskList.classList.remove('hidden');
filteredTasks.forEach((task, index) => {
const element = createTaskElement(task, index);
taskList.appendChild(element);
});
}
updateProgress();
}
// Add new task
function addTask(text) {
const trimmed = text.trim();
if (!trimmed) return;
const task = {
id: generateId(),
text: trimmed,
completed: false,
createdAt: Date.now()
};
tasks.unshift(task);
saveTasks();
renderTasks();
}
// Toggle task completion
function toggleTask(id) {
const task = tasks.find(t => t.id === id);
if (task) {
task.completed = !task.completed;
saveTasks();
renderTasks();
}
}
// Delete task
function deleteTask(id, element) {
element.classList.remove('entering');
element.classList.add('leaving');
setTimeout(() => {
tasks = tasks.filter(t => t.id !== id);
saveTasks();
renderTasks();
}, 300);
}
// Drag and Drop handlers
function handleDragStart(e) {
draggedItem = this;
this.classList.add('dragging');
e.dataTransfer.effectAllowed = 'move';
e.dataTransfer.setData('text/plain', this.dataset.id);
}
function handleDragEnd() {
this.classList.remove('dragging');
document.querySelectorAll('.task-item').forEach(item => {
item.classList.remove('drag-over');
});
draggedItem = null;
}
function handleDragOver(e) {
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
if (this !== draggedItem) {
this.classList.add('drag-over');
}
}
function handleDragLeave() {
this.classList.remove('drag-over');
}
function handleDrop(e) {
e.preventDefault();
this.classList.remove('drag-over');
if (draggedItem && this !== draggedItem) {
const draggedId = draggedItem.dataset.id;
const targetId = this.dataset.id;
const draggedIndex = tasks.findIndex(t => t.id === draggedId);
const targetIndex = tasks.findIndex(t => t.id === targetId);
if (draggedIndex !== -1 && targetIndex !== -1) {
const [removed] = tasks.splice(draggedIndex, 1);
tasks.splice(targetIndex, 0, removed);
saveTasks();
renderTasks();
}
}
}
// Clear completed tasks
function clearCompleted() {
const completedItems = document.querySelectorAll('.task-item');
completedItems.forEach(item => {
const task = tasks.find(t => t.id === item.dataset.id);
if (task && task.completed) {
item.classList.add('leaving');
}
});
setTimeout(() => {
tasks = tasks.filter(t => !t.completed);
saveTasks();
renderTasks();
}, 300);
}
// Set filter
function setFilter(filter) {
currentFilter = filter;
filterTabs.forEach(tab => {
const isActive = tab.dataset.filter === filter;
tab.classList.toggle('active', isActive);
tab.style.color = isActive ? '' : 'var(--muted)';
});
renderTasks();
}
// Staggered entrance animation
function animateEntrance() {
const items = document.querySelectorAll('.stagger-item');
items.forEach((item, index) => {
setTimeout(() => {
item.classList.add('visible');
}, index * 100);
});
}
// Event Listeners
taskForm.addEventListener('submit', (e) => {
e.preventDefault();
addTask(taskInput.value);
taskInput.value = '';
taskInput.focus();
});
filterTabs.forEach(tab => {
tab.addEventListener('click', () => setFilter(tab.dataset.filter));
});
clearCompletedBtn.addEventListener('click', clearCompleted);
// Input focus effect
taskInput.addEventListener('focus', () => {
taskInput.style.borderColor = 'var(--accent)';
taskInput.style.boxShadow = '0 0 0 3px var(--accent-dim)';
});
taskInput.addEventListener('blur', () => {
taskInput.style.borderColor = 'var(--border)';
taskInput.style.boxShadow = 'none';
});
// Initialize
loadTasks();
renderTasks();
// Trigger entrance animation
requestAnimationFrame(() => {
animateEntrance();
});
</script>
</body>
</html>