// Sample project data - in a real app this would come from an API const projects = [ { id: 1, title: "E-Commerce Platform", description: "A full-featured online shopping experience with payment integration.", image: "http://static.photos/technology/640x360/1", tags: ["React", "Node.js", "MongoDB"], github: "#", demo: "#" }, { id: 2, title: "Task Management App", description: "Productivity application for teams to manage projects and deadlines.", image: "http://static.photos/office/640x360/2", tags: ["Vue.js", "Firebase", "Tailwind"], github: "#", demo: "#" }, { id: 3, title: "Weather Dashboard", description: "Real-time weather forecasting with interactive maps and alerts.", image: "http://static.photos/nature/640x360/3", tags: ["JavaScript", "API", "Chart.js"], github: "#", demo: "#" }, { id: 4, title: "Fitness Tracker", description: "Mobile-first application for tracking workouts and nutrition.", image: "http://static.photos/people/640x360/4", tags: ["React Native", "Redux", "GraphQL"], github: "#", demo: "#" }, { id: 5, title: "Portfolio Website", description: "Responsive portfolio showcasing design and development work.", image: "http://static.photos/workspace/640x360/5", tags: ["HTML", "CSS", "JavaScript"], github: "#", demo: "#" }, { id: 6, title: "Recipe Finder", description: "Search and save recipes from around the world with dietary filters.", image: "http://static.photos/food/640x360/6", tags: ["Angular", "Express", "PostgreSQL"], github: "#", demo: "#" } ]; // Function to render projects function renderProjects() { const container = document.getElementById('projects-container'); projects.forEach((project, index) => { const projectCard = document.createElement('div'); projectCard.className = 'project-card animate-fade-in'; projectCard.style.animationDelay = `${index * 0.1}s`; projectCard.innerHTML = ` ${project.title}

${project.title}

${project.description}

${project.tags.map(tag => `${tag}`).join('')}
Code Demo
`; container.appendChild(projectCard); }); // Re-initialize Feather icons after adding new elements feather.replace(); } // Initialize the page document.addEventListener('DOMContentLoaded', () => { renderProjects(); // Theme toggle functionality const themeToggle = document.createElement('button'); themeToggle.className = 'fixed bottom-6 right-6 bg-indigo-600 text-white p-3 rounded-full shadow-lg hover:bg-indigo-700 transition'; themeToggle.innerHTML = ''; themeToggle.addEventListener('click', toggleTheme); document.body.appendChild(themeToggle); // Initialize Feather icons feather.replace(); }); // Theme toggle function function toggleTheme() { document.body.classList.toggle('dark-mode'); const isDarkMode = document.body.classList.contains('dark-mode'); // Update icon const themeToggle = document.querySelector('.fixed.bottom-6.right-6'); themeToggle.innerHTML = isDarkMode ? '' : ''; feather.replace(); }