Files

280 lines
9.7 KiB
TypeScript
Raw Permalink Normal View History

'use client';
import * as React from 'react';
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
import Fuse from 'fuse.js';
import { Input } from '@/components/ui/Input';
import { Card } from '@/components/ui/Card';
import { EmptyState } from '@/components/ui/EmptyState';
import { Search, X, Heart, Clock, List, Shuffle, Plus, Check } from 'lucide-react';
import { cn } from '@/lib/utils/cn';
feat: add toast notifications, random font, and font info display Major UX enhancements for better user feedback and discovery: **Toast Notification System** - Beautiful toast notifications with 3 types (success/error/info) - Auto-dismiss after 3 seconds - Slide-in animation from right - Color-coded by type (green/red/blue) - Dark mode support - Close button for manual dismiss - ToastProvider context for global access - Non-blocking UI overlay **Random Font Discovery** - Shuffle button in font selector - One-click random font selection - Toast notification shows selected font - Perfect for discovering new fonts - Located next to "Select Font" header **Enhanced Font Preview** - Font name badge display - Character count statistics - Line count statistics - Better visual hierarchy - Responsive stat display **Improved Feedback** - Toast on copy: "Copied to clipboard!" - Toast on share: "Shareable URL copied!" - Toast on random: "Random font: FontName" - Error toasts for failed operations - Removed temporary text replacement **Smooth Animations** - Slide-in animation for toasts - Fade-in animation class - Custom keyframe animations - CSS utility classes - Smooth transitions throughout **Technical Improvements** - useToast custom hook - Context-based state management - Auto-cleanup with setTimeout - Unique toast IDs - TypeScript types for toast system - Proper event propagation **Better UX** - No more jarring text replacements - Non-intrusive notifications - Professional feedback system - Discoverable random feature - Informative preview stats The app now feels polished and professional with proper user feedback! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 13:21:13 +01:00
import { Button } from '@/components/ui/Button';
import type { FigletFont } from '@/types/figlet';
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
import { getFavorites, getRecentFonts, toggleFavorite, isFavorite } from '@/lib/storage/favorites';
export interface FontSelectorProps {
fonts: FigletFont[];
selectedFont: string;
onSelectFont: (fontName: string) => void;
feat: add toast notifications, random font, and font info display Major UX enhancements for better user feedback and discovery: **Toast Notification System** - Beautiful toast notifications with 3 types (success/error/info) - Auto-dismiss after 3 seconds - Slide-in animation from right - Color-coded by type (green/red/blue) - Dark mode support - Close button for manual dismiss - ToastProvider context for global access - Non-blocking UI overlay **Random Font Discovery** - Shuffle button in font selector - One-click random font selection - Toast notification shows selected font - Perfect for discovering new fonts - Located next to "Select Font" header **Enhanced Font Preview** - Font name badge display - Character count statistics - Line count statistics - Better visual hierarchy - Responsive stat display **Improved Feedback** - Toast on copy: "Copied to clipboard!" - Toast on share: "Shareable URL copied!" - Toast on random: "Random font: FontName" - Error toasts for failed operations - Removed temporary text replacement **Smooth Animations** - Slide-in animation for toasts - Fade-in animation class - Custom keyframe animations - CSS utility classes - Smooth transitions throughout **Technical Improvements** - useToast custom hook - Context-based state management - Auto-cleanup with setTimeout - Unique toast IDs - TypeScript types for toast system - Proper event propagation **Better UX** - No more jarring text replacements - Non-intrusive notifications - Professional feedback system - Discoverable random feature - Informative preview stats The app now feels polished and professional with proper user feedback! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 13:21:13 +01:00
onRandomFont?: () => void;
isComparisonMode?: boolean;
comparisonFonts?: string[];
onAddToComparison?: (fontName: string) => void;
className?: string;
}
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
type FilterType = 'all' | 'favorites' | 'recent';
export function FontSelector({
fonts,
selectedFont,
onSelectFont,
onRandomFont,
isComparisonMode = false,
comparisonFonts = [],
onAddToComparison,
className
}: FontSelectorProps) {
const [searchQuery, setSearchQuery] = React.useState('');
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
const [filter, setFilter] = React.useState<FilterType>('all');
const [favorites, setFavorites] = React.useState<string[]>([]);
const [recentFonts, setRecentFonts] = React.useState<string[]>([]);
feat: add keyboard shortcuts, Docker deployment, and production build Major improvements for production deployment and UX: **Keyboard Shortcuts System** - `/` - Focus font search instantly - `Esc` - Clear search and close dialogs - `Ctrl/Cmd + D` - Toggle dark/light mode - `Shift + ?` - Show keyboard shortcuts help dialog - Floating keyboard icon button for discoverability - Beautiful modal with all shortcuts listed - Global event listeners with proper cleanup **Enhanced Search UX** - Updated placeholder: "Search fonts... (Press / to focus)" - Auto-focus on `/` keypress - Auto-clear and blur on `Escape` - Ref-based input focusing for reliability **Docker Deployment** - Multi-stage Dockerfile (deps, builder, nginx runner) - Based on node:22-alpine for minimal size - Static export served via nginx:alpine - Built-in health check endpoint (/health) - Optimized for production **Nginx Configuration** - Gzip compression for all text assets - Aggressive caching for static assets (1 year) - Security headers (X-Frame-Options, CSP, etc.) - SPA routing support (try_files) - Health check endpoint - Performance tuning (sendfile, tcp_nopush) **Documentation Updates** - Corrected font count to accurate 373 fonts - Updated README and IMPLEMENTATION_PLAN - Added Docker deployment instructions - Clarified .flf vs .tlf vs .flc formats **Production Build** - Tested static export build - Total size: 8.0MB (including all fonts!) - 4.7s build time with Turbopack - All routes pre-rendered successfully - Ready for CDN/static hosting **Technical Highlights** - useKeyboardShortcuts custom hook - Event listener cleanup on unmount - Ref forwarding for input focus - Modal dialog with backdrop blur - Keyboard-first navigation The app is now production-ready with professional keyboard shortcuts and Docker deployment support! 🎉 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:42:40 +01:00
const searchInputRef = React.useRef<HTMLInputElement>(null);
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
// Load favorites and recent fonts
React.useEffect(() => {
setFavorites(getFavorites());
setRecentFonts(getRecentFonts());
}, []);
feat: add keyboard shortcuts, Docker deployment, and production build Major improvements for production deployment and UX: **Keyboard Shortcuts System** - `/` - Focus font search instantly - `Esc` - Clear search and close dialogs - `Ctrl/Cmd + D` - Toggle dark/light mode - `Shift + ?` - Show keyboard shortcuts help dialog - Floating keyboard icon button for discoverability - Beautiful modal with all shortcuts listed - Global event listeners with proper cleanup **Enhanced Search UX** - Updated placeholder: "Search fonts... (Press / to focus)" - Auto-focus on `/` keypress - Auto-clear and blur on `Escape` - Ref-based input focusing for reliability **Docker Deployment** - Multi-stage Dockerfile (deps, builder, nginx runner) - Based on node:22-alpine for minimal size - Static export served via nginx:alpine - Built-in health check endpoint (/health) - Optimized for production **Nginx Configuration** - Gzip compression for all text assets - Aggressive caching for static assets (1 year) - Security headers (X-Frame-Options, CSP, etc.) - SPA routing support (try_files) - Health check endpoint - Performance tuning (sendfile, tcp_nopush) **Documentation Updates** - Corrected font count to accurate 373 fonts - Updated README and IMPLEMENTATION_PLAN - Added Docker deployment instructions - Clarified .flf vs .tlf vs .flc formats **Production Build** - Tested static export build - Total size: 8.0MB (including all fonts!) - 4.7s build time with Turbopack - All routes pre-rendered successfully - Ready for CDN/static hosting **Technical Highlights** - useKeyboardShortcuts custom hook - Event listener cleanup on unmount - Ref forwarding for input focus - Modal dialog with backdrop blur - Keyboard-first navigation The app is now production-ready with professional keyboard shortcuts and Docker deployment support! 🎉 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:42:40 +01:00
// Keyboard shortcuts
React.useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
// "/" to focus search
if (e.key === '/' && !e.ctrlKey && !e.metaKey) {
e.preventDefault();
searchInputRef.current?.focus();
}
// "Esc" to clear search
if (e.key === 'Escape' && searchQuery) {
e.preventDefault();
setSearchQuery('');
searchInputRef.current?.blur();
}
};
window.addEventListener('keydown', handleKeyDown);
return () => window.removeEventListener('keydown', handleKeyDown);
}, [searchQuery]);
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
// Initialize Fuse.js for fuzzy search
const fuse = React.useMemo(() => {
return new Fuse(fonts, {
keys: ['name', 'fileName'],
threshold: 0.3,
includeScore: true,
});
}, [fonts]);
const filteredFonts = React.useMemo(() => {
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
let fontsToFilter = fonts;
// Apply category filter
if (filter === 'favorites') {
fontsToFilter = fonts.filter(f => favorites.includes(f.name));
} else if (filter === 'recent') {
fontsToFilter = fonts.filter(f => recentFonts.includes(f.name));
// Sort by recent order
fontsToFilter.sort((a, b) => {
return recentFonts.indexOf(a.name) - recentFonts.indexOf(b.name);
});
}
// Apply search query
if (!searchQuery) return fontsToFilter;
const results = fuse.search(searchQuery);
const searchResults = results.map(result => result.item);
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
// Filter search results by category
if (filter === 'favorites') {
return searchResults.filter(f => favorites.includes(f.name));
} else if (filter === 'recent') {
return searchResults.filter(f => recentFonts.includes(f.name));
}
return searchResults;
}, [fonts, searchQuery, fuse, filter, favorites, recentFonts]);
const handleToggleFavorite = (fontName: string, e: React.MouseEvent) => {
e.stopPropagation();
toggleFavorite(fontName);
setFavorites(getFavorites());
};
return (
<Card className={className}>
<div className="p-6">
feat: add toast notifications, random font, and font info display Major UX enhancements for better user feedback and discovery: **Toast Notification System** - Beautiful toast notifications with 3 types (success/error/info) - Auto-dismiss after 3 seconds - Slide-in animation from right - Color-coded by type (green/red/blue) - Dark mode support - Close button for manual dismiss - ToastProvider context for global access - Non-blocking UI overlay **Random Font Discovery** - Shuffle button in font selector - One-click random font selection - Toast notification shows selected font - Perfect for discovering new fonts - Located next to "Select Font" header **Enhanced Font Preview** - Font name badge display - Character count statistics - Line count statistics - Better visual hierarchy - Responsive stat display **Improved Feedback** - Toast on copy: "Copied to clipboard!" - Toast on share: "Shareable URL copied!" - Toast on random: "Random font: FontName" - Error toasts for failed operations - Removed temporary text replacement **Smooth Animations** - Slide-in animation for toasts - Fade-in animation class - Custom keyframe animations - CSS utility classes - Smooth transitions throughout **Technical Improvements** - useToast custom hook - Context-based state management - Auto-cleanup with setTimeout - Unique toast IDs - TypeScript types for toast system - Proper event propagation **Better UX** - No more jarring text replacements - Non-intrusive notifications - Professional feedback system - Discoverable random feature - Informative preview stats The app now feels polished and professional with proper user feedback! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 13:21:13 +01:00
<div className="flex items-center justify-between mb-4">
<h3 className="text-sm font-medium">Select Font</h3>
{onRandomFont && (
<Button
variant="outline"
size="sm"
onClick={onRandomFont}
title="Random font"
>
<Shuffle className="h-4 w-4" />
Random
</Button>
)}
</div>
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
{/* Filter Tabs */}
<div className="flex gap-1 mb-4 p-1 bg-muted rounded-lg">
<button
onClick={() => setFilter('all')}
className={cn(
'flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors',
filter === 'all' ? 'bg-background shadow-sm' : 'hover:bg-background/50'
)}
>
<List className="inline-block h-3 w-3 mr-1" />
All
</button>
<button
onClick={() => setFilter('favorites')}
className={cn(
'flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors',
filter === 'favorites' ? 'bg-background shadow-sm' : 'hover:bg-background/50'
)}
>
<Heart className="inline-block h-3 w-3 mr-1" />
Favorites
</button>
<button
onClick={() => setFilter('recent')}
className={cn(
'flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors',
filter === 'recent' ? 'bg-background shadow-sm' : 'hover:bg-background/50'
)}
>
<Clock className="inline-block h-3 w-3 mr-1" />
Recent
</button>
</div>
{/* Search Input */}
<div className="relative mb-4">
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none" />
<Input
feat: add keyboard shortcuts, Docker deployment, and production build Major improvements for production deployment and UX: **Keyboard Shortcuts System** - `/` - Focus font search instantly - `Esc` - Clear search and close dialogs - `Ctrl/Cmd + D` - Toggle dark/light mode - `Shift + ?` - Show keyboard shortcuts help dialog - Floating keyboard icon button for discoverability - Beautiful modal with all shortcuts listed - Global event listeners with proper cleanup **Enhanced Search UX** - Updated placeholder: "Search fonts... (Press / to focus)" - Auto-focus on `/` keypress - Auto-clear and blur on `Escape` - Ref-based input focusing for reliability **Docker Deployment** - Multi-stage Dockerfile (deps, builder, nginx runner) - Based on node:22-alpine for minimal size - Static export served via nginx:alpine - Built-in health check endpoint (/health) - Optimized for production **Nginx Configuration** - Gzip compression for all text assets - Aggressive caching for static assets (1 year) - Security headers (X-Frame-Options, CSP, etc.) - SPA routing support (try_files) - Health check endpoint - Performance tuning (sendfile, tcp_nopush) **Documentation Updates** - Corrected font count to accurate 373 fonts - Updated README and IMPLEMENTATION_PLAN - Added Docker deployment instructions - Clarified .flf vs .tlf vs .flc formats **Production Build** - Tested static export build - Total size: 8.0MB (including all fonts!) - 4.7s build time with Turbopack - All routes pre-rendered successfully - Ready for CDN/static hosting **Technical Highlights** - useKeyboardShortcuts custom hook - Event listener cleanup on unmount - Ref forwarding for input focus - Modal dialog with backdrop blur - Keyboard-first navigation The app is now production-ready with professional keyboard shortcuts and Docker deployment support! 🎉 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:42:40 +01:00
ref={searchInputRef}
type="text"
feat: add keyboard shortcuts, Docker deployment, and production build Major improvements for production deployment and UX: **Keyboard Shortcuts System** - `/` - Focus font search instantly - `Esc` - Clear search and close dialogs - `Ctrl/Cmd + D` - Toggle dark/light mode - `Shift + ?` - Show keyboard shortcuts help dialog - Floating keyboard icon button for discoverability - Beautiful modal with all shortcuts listed - Global event listeners with proper cleanup **Enhanced Search UX** - Updated placeholder: "Search fonts... (Press / to focus)" - Auto-focus on `/` keypress - Auto-clear and blur on `Escape` - Ref-based input focusing for reliability **Docker Deployment** - Multi-stage Dockerfile (deps, builder, nginx runner) - Based on node:22-alpine for minimal size - Static export served via nginx:alpine - Built-in health check endpoint (/health) - Optimized for production **Nginx Configuration** - Gzip compression for all text assets - Aggressive caching for static assets (1 year) - Security headers (X-Frame-Options, CSP, etc.) - SPA routing support (try_files) - Health check endpoint - Performance tuning (sendfile, tcp_nopush) **Documentation Updates** - Corrected font count to accurate 373 fonts - Updated README and IMPLEMENTATION_PLAN - Added Docker deployment instructions - Clarified .flf vs .tlf vs .flc formats **Production Build** - Tested static export build - Total size: 8.0MB (including all fonts!) - 4.7s build time with Turbopack - All routes pre-rendered successfully - Ready for CDN/static hosting **Technical Highlights** - useKeyboardShortcuts custom hook - Event listener cleanup on unmount - Ref forwarding for input focus - Modal dialog with backdrop blur - Keyboard-first navigation The app is now production-ready with professional keyboard shortcuts and Docker deployment support! 🎉 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:42:40 +01:00
placeholder="Search fonts... (Press / to focus)"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
className="pl-9 pr-9"
/>
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
{searchQuery && (
<button
onClick={() => setSearchQuery('')}
className="absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground"
aria-label="Clear search"
>
<X className="h-4 w-4" />
</button>
)}
</div>
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
{/* Font List */}
<div className="max-h-[400px] overflow-y-auto space-y-1 pr-2">
{filteredFonts.length === 0 ? (
<EmptyState
icon={filter === 'favorites' ? Heart : (filter === 'recent' ? Clock : Search)}
title={
filter === 'favorites'
? 'No favorite fonts yet'
: filter === 'recent'
? 'No recent fonts'
: 'No fonts found'
}
description={
filter === 'favorites'
? 'Click the heart icon on any font to add it to your favorites'
: filter === 'recent'
? 'Fonts you use will appear here'
: searchQuery
? 'Try a different search term'
: 'Loading fonts...'
}
className="py-8"
/>
) : (
filteredFonts.map((font) => {
const isInComparison = comparisonFonts.includes(font.name);
return (
<div
key={font.name}
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
className={cn(
'group flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors',
'hover:bg-accent hover:text-accent-foreground',
selectedFont === font.name && 'bg-accent text-accent-foreground font-medium'
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
)}
>
<button
onClick={() => onSelectFont(font.name)}
className="flex-1 text-left"
>
{font.name}
</button>
{isComparisonMode && onAddToComparison && (
<button
onClick={(e) => {
e.stopPropagation();
onAddToComparison(font.name);
}}
className={cn(
'opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded',
isInComparison && 'opacity-100 bg-primary/10'
)}
aria-label={isInComparison ? 'In comparison' : 'Add to comparison'}
disabled={isInComparison}
>
{isInComparison ? (
<Check className="h-4 w-4 text-primary" />
) : (
<Plus className="h-4 w-4 text-muted-foreground hover:text-primary" />
)}
</button>
)}
<button
onClick={(e) => handleToggleFavorite(font.name, e)}
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
className={cn(
'opacity-0 group-hover:opacity-100 transition-opacity',
isFavorite(font.name) && 'opacity-100'
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
)}
aria-label={isFavorite(font.name) ? 'Remove from favorites' : 'Add to favorites'}
>
<Heart
className={cn(
'h-4 w-4 transition-colors',
isFavorite(font.name) ? 'fill-red-500 text-red-500' : 'text-muted-foreground hover:text-red-500'
)}
/>
</button>
</div>
);
})
)}
</div>
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
{/* Stats */}
<div className="mt-4 pt-4 border-t text-xs text-muted-foreground">
feat: add dark mode, fuzzy search, favorites, and URL sharing Implemented Phases 5-7 of the implementation plan with major UX enhancements: **Dark Mode (Phase 9)** - Added ThemeToggle component with localStorage persistence - System preference detection - Smooth theme transitions - Moon/Sun icon toggle in header **Fuzzy Search with Fuse.js (Phase 5)** - Integrated Fuse.js for intelligent font search - 30% threshold for flexible matching - Search by font name and filename - Clear button for search input - Much better than simple string matching **Favorites & Recent Fonts System (Phase 7)** - localStorage-based favorites with heart icon toggle - Auto-tracking of recently used fonts (max 10) - Filter tabs: All / Favorites / Recent - Favorite hearts visible on hover - Red filled heart for favorited fonts - Stats showing favorite and recent counts **Shareable URLs (Phase 6)** - Encode text + font in URL parameters - Auto-load from URL on page load - Share button copies URL to clipboard - Clean URL updates without page reload - Perfect for sharing ASCII art creations **Enhanced Font Selector** - 3-tab filter system (All/Favorites/Recent) - Visual feedback for selected fonts - Empty states for each filter - Font count statistics - Heart icon for quick favoriting - Recent fonts sorted by usage order **UX Improvements** - Copy feedback ("Copied to clipboard! ✓") - Share feedback ("URL copied to clipboard! ✓") - Responsive button layout - Better empty states - Improved accessibility with aria-labels **Tech Highlights** - Client-side localStorage management - URL encoding/decoding utilities - React hooks for state management - Fuse.js fuzzy search integration - Theme persistence across sessions The app now has professional-grade features rivaling any modern web app! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 12:28:27 +01:00
{filteredFonts.length} font{filteredFonts.length !== 1 ? 's' : ''}
{filter === 'favorites' && `${favorites.length} total favorites`}
{filter === 'recent' && `${recentFonts.length} recent`}
</div>
</div>
</Card>
);
}