- Added Terms of Service and Privacy Policy pages with contact info - Implemented Google Analytics with Consent Mode v2 for GDPR compliance - Created sitemap.xml and robots.txt for search engine optimization - Added dynamic meta tags, Open Graph, and structured data (JSON-LD) - Implemented GDPR consent banner with TCF 2.2 compatibility - Enhanced sidebar with category-colored hover states and proper active/inactive styling - Fixed all ESLint warnings for clean deployment - Added comprehensive SEO utilities and privacy-first analytics tracking Ready for production deployment with full legal compliance and SEO optimization.
192 lines
9.7 KiB
JavaScript
192 lines
9.7 KiB
JavaScript
import React, { useState, useEffect } from 'react';
|
|
import { Search, Code, Terminal, Zap, Shield, Cpu } from 'lucide-react';
|
|
import ToolCard from '../components/ToolCard';
|
|
import { TOOLS, SITE_CONFIG } from '../config/tools';
|
|
import { useAnalytics } from '../hooks/useAnalytics';
|
|
|
|
const Home = () => {
|
|
console.log('🏠 NEW Home component loaded - Object Editor should be visible!');
|
|
const [searchTerm, setSearchTerm] = useState('');
|
|
const [mounted, setMounted] = useState(false);
|
|
const { trackSearch } = useAnalytics();
|
|
|
|
useEffect(() => {
|
|
setMounted(true);
|
|
}, []);
|
|
|
|
// Handle search with analytics tracking
|
|
const handleSearchChange = (e) => {
|
|
const value = e.target.value;
|
|
setSearchTerm(value);
|
|
|
|
// Track search after user stops typing (debounced)
|
|
if (value.length > 2) {
|
|
trackSearch(value);
|
|
}
|
|
};
|
|
|
|
const filteredTools = TOOLS.filter(tool =>
|
|
tool.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
tool.description.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
tool.tags.some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase()))
|
|
);
|
|
|
|
return (
|
|
<div className="min-h-screen bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-50 dark:from-slate-900 dark:via-slate-800 dark:to-indigo-900">
|
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
{/* Hero Section */}
|
|
<div className={`text-center pt-16 pb-20 transition-all duration-1000 ${mounted ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8'}`}>
|
|
{/* Terminal-style header */}
|
|
<div className="inline-flex items-center gap-2 px-4 py-2 bg-slate-800 dark:bg-slate-700 rounded-full text-green-400 font-mono text-sm mb-8 shadow-lg">
|
|
<Terminal className="h-4 w-4" />
|
|
<span>~/dewe.dev $</span>
|
|
<span className="animate-pulse">_</span>
|
|
</div>
|
|
|
|
<h1 className="text-5xl md:text-7xl font-bold bg-gradient-to-r from-blue-600 via-purple-600 to-indigo-600 bg-clip-text text-transparent mb-6">
|
|
{SITE_CONFIG.title}
|
|
</h1>
|
|
|
|
<p className="text-xl md:text-2xl text-slate-600 dark:text-slate-300 mb-4 max-w-3xl mx-auto leading-relaxed">
|
|
{SITE_CONFIG.subtitle}
|
|
</p>
|
|
|
|
<p className="text-lg text-slate-500 dark:text-slate-400 mb-12 max-w-2xl mx-auto">
|
|
{SITE_CONFIG.slogan} • {SITE_CONFIG.description}
|
|
</p>
|
|
|
|
{/* Enhanced Search */}
|
|
<div className="relative max-w-lg mx-auto mb-8">
|
|
<div className="absolute inset-0 bg-gradient-to-r from-blue-500 to-purple-500 rounded-2xl blur opacity-20"></div>
|
|
<div className="relative">
|
|
<Search className="absolute left-4 top-1/2 transform -translate-y-1/2 h-5 w-5 text-slate-400" />
|
|
<input
|
|
type="text"
|
|
placeholder="Search tools..."
|
|
value={searchTerm}
|
|
onChange={handleSearchChange}
|
|
className="w-full pl-12 pr-6 py-4 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm border border-slate-200 dark:border-slate-600 rounded-2xl text-slate-900 dark:text-slate-100 placeholder-slate-500 focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-300 shadow-lg"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Stats */}
|
|
<div className="flex justify-center items-center gap-8 text-sm text-slate-500 dark:text-slate-400">
|
|
<div className="flex items-center gap-2">
|
|
<div className="w-2 h-2 bg-green-500 rounded-full animate-pulse"></div>
|
|
<span>{SITE_CONFIG.totalTools} Tools Available</span>
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<div className="w-2 h-2 bg-blue-500 rounded-full"></div>
|
|
<span>100% Client-Side</span>
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<div className="w-2 h-2 bg-purple-500 rounded-full"></div>
|
|
<span>Zero Data Collection</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Tools Grid */}
|
|
<div className={`transition-all duration-1000 delay-300 ${mounted ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8'}`}>
|
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-20">
|
|
{filteredTools.map((tool, index) => (
|
|
<div
|
|
key={index}
|
|
className={`transition-all duration-500 ${mounted ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8'}`}
|
|
style={{ transitionDelay: `${400 + index * 100}ms` }}
|
|
>
|
|
<ToolCard
|
|
icon={tool.icon}
|
|
title={tool.name}
|
|
description={tool.description}
|
|
path={tool.path}
|
|
tags={tool.tags}
|
|
category={tool.category}
|
|
/>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
|
|
{/* No Results */}
|
|
{filteredTools.length === 0 && (
|
|
<div className="text-center py-20">
|
|
<div className="text-6xl mb-4">🔍</div>
|
|
<p className="text-slate-500 dark:text-slate-400 text-xl mb-2">
|
|
No tools found matching "{searchTerm}"
|
|
</p>
|
|
<p className="text-slate-400 dark:text-slate-500">
|
|
Try searching for "editor", "encode", or "format"
|
|
</p>
|
|
</div>
|
|
)}
|
|
|
|
{/* Features Section */}
|
|
<div className={`py-20 transition-all duration-1000 delay-700 ${mounted ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-8'}`}>
|
|
<div className="text-center mb-16">
|
|
<h2 className="text-3xl md:text-4xl font-bold text-slate-800 dark:text-white mb-4">
|
|
Built for Developers
|
|
</h2>
|
|
<p className="text-xl text-slate-600 dark:text-slate-300 max-w-2xl mx-auto">
|
|
Every tool is crafted with developer experience and performance in mind
|
|
</p>
|
|
</div>
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
|
|
<div className="group text-center p-8 rounded-2xl bg-white/50 dark:bg-slate-800/50 backdrop-blur-sm border border-slate-200 dark:border-slate-700 hover:border-blue-300 dark:hover:border-blue-600 transition-all duration-300 hover:shadow-xl hover:shadow-blue-500/10">
|
|
<div className="bg-gradient-to-br from-blue-500 to-blue-600 rounded-2xl w-16 h-16 flex items-center justify-center mx-auto mb-6 group-hover:scale-110 transition-transform duration-300">
|
|
<Zap className="h-8 w-8 text-white" />
|
|
</div>
|
|
<h3 className="text-xl font-bold text-slate-800 dark:text-white mb-3">
|
|
Lightning Fast
|
|
</h3>
|
|
<p className="text-slate-600 dark:text-slate-300 leading-relaxed">
|
|
Optimized algorithms and local processing ensure instant results
|
|
</p>
|
|
</div>
|
|
|
|
<div className="group text-center p-8 rounded-2xl bg-white/50 dark:bg-slate-800/50 backdrop-blur-sm border border-slate-200 dark:border-slate-700 hover:border-purple-300 dark:hover:border-purple-600 transition-all duration-300 hover:shadow-xl hover:shadow-purple-500/10">
|
|
<div className="bg-gradient-to-br from-purple-500 to-purple-600 rounded-2xl w-16 h-16 flex items-center justify-center mx-auto mb-6 group-hover:scale-110 transition-transform duration-300">
|
|
<Shield className="h-8 w-8 text-white" />
|
|
</div>
|
|
<h3 className="text-xl font-bold text-slate-800 dark:text-white mb-3">
|
|
Privacy First
|
|
</h3>
|
|
<p className="text-slate-600 dark:text-slate-300 leading-relaxed">
|
|
Your data never leaves your browser. Zero tracking, zero storage
|
|
</p>
|
|
</div>
|
|
|
|
<div className="group text-center p-8 rounded-2xl bg-white/50 dark:bg-slate-800/50 backdrop-blur-sm border border-slate-200 dark:border-slate-700 hover:border-green-300 dark:hover:border-green-600 transition-all duration-300 hover:shadow-xl hover:shadow-green-500/10">
|
|
<div className="bg-gradient-to-br from-green-500 to-green-600 rounded-2xl w-16 h-16 flex items-center justify-center mx-auto mb-6 group-hover:scale-110 transition-transform duration-300">
|
|
<Cpu className="h-8 w-8 text-white" />
|
|
</div>
|
|
<h3 className="text-xl font-bold text-slate-800 dark:text-white mb-3">
|
|
No Limits
|
|
</h3>
|
|
<p className="text-slate-600 dark:text-slate-300 leading-relaxed">
|
|
Handle massive files and complex data without restrictions
|
|
</p>
|
|
</div>
|
|
|
|
<div className="group text-center p-8 rounded-2xl bg-white/50 dark:bg-slate-800/50 backdrop-blur-sm border border-slate-200 dark:border-slate-700 hover:border-indigo-300 dark:hover:border-indigo-600 transition-all duration-300 hover:shadow-xl hover:shadow-indigo-500/10">
|
|
<div className="bg-gradient-to-br from-indigo-500 to-indigo-600 rounded-2xl w-16 h-16 flex items-center justify-center mx-auto mb-6 group-hover:scale-110 transition-transform duration-300">
|
|
<Code className="h-8 w-8 text-white" />
|
|
</div>
|
|
<h3 className="text-xl font-bold text-slate-800 dark:text-white mb-3">
|
|
Dev Focused
|
|
</h3>
|
|
<p className="text-slate-600 dark:text-slate-300 leading-relaxed">
|
|
Syntax highlighting, shortcuts, and workflows developers love
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Home;
|