const workouts = [ { id: 1, title: "Desk Push-ups", category: "strength", duration: 2, calories: 15, image: "https://images.unsplash.com/photo-1571019614242-c5c5dee9f50b?w=400&h=300&fit=crop", description: "Use your desk to do inclined push-ups for a quick upper body boost.", instructions: ["Stand arm's length from your desk", "Place hands shoulder-width apart on edge", "Lower chest to desk, then push back up", "Repeat 10-15 times"] }, { id: 2, title: "Chair Squats", category: "strength", duration: 3, calories: 25, image: "https://images.unsplash.com/photo-1574680096145-d05b474e2155?w=400&h=300&fit=crop", description: "Sit to stand squats to wake up your legs and glutes.", instructions: ["Stand in front of your chair", "Lower down until you almost sit", "Stand back up squeezing glutes", "Repeat 15-20 times"] }, { id: 3, title: "Neck Rolls", category: "stretch", duration: 2, calories: 5, image: "https://images.unsplash.com/photo-1544367563-12123d8965cd?w=400&h=300&fit=crop", description: "Release tension from hours of screen time with gentle neck stretches.", instructions: ["Drop chin to chest slowly", "Roll head to right shoulder", "Roll back to center, then left", "Repeat 5 times each direction"] }, { id: 4, title: "Eye Yoga", category: "wellness", duration: 2, calories: 0, image: "https://images.unsplash.com/photo-1559757175-5700dde675bc?w=400&h=300&fit=crop", description: "Reduce eye strain with focus shifting exercises.", instructions: ["Look at something 20 feet away for 20 seconds", "Close eyes and roll them gently", "Look up and down 5 times", "Blink rapidly for 10 seconds"] }, { id: 5, title: "Desk Plank", category: "strength", duration: 2, calories: 20, image: "https://images.unsplash.com/photo-1566241440091-ec10de8db2e1?w=400&h=300&fit=crop", description: "Core stability exercise using your desk surface.", instructions: ["Place forearms on desk", "Step back into plank position", "Keep body straight from head to heels", "Hold for 30-60 seconds"] }, { id: 6, title: "Seated Spinal Twist", category: "stretch", duration: 3, calories: 8, image: "https://images.unsplash.com/photo-1599901860904-17e6ed7083a0?w=400&h=300&fit=crop", description: "Release lower back tension with a gentle seated twist.", instructions: ["Sit tall in your chair", "Twist torso to right, hold chair back", "Hold for 30 seconds", "Repeat on left side"] }, { id: 7, title: "Jumping Jacks", category: "cardio", duration: 3, calories: 35, image: "https://images.unsplash.com/photo-1599058945522-28d584b6f0ff?w=400&h=300&fit=crop", description: "Quick cardio burst to get your heart rate up.", instructions: ["Stand up from desk", "Jump feet apart while raising arms", "Jump back to starting position", "Continue for 1-3 minutes"] }, { id: 8, title: "Wrist Flexor Stretch", category: "stretch", duration: 2, calories: 3, image: "https://images.unsplash.com/photo-1574680096141-1cddd32e04ca?w=400&h=300&fit=crop", description: "Prevent carpal tunnel and wrist strain from typing.", instructions: ["Extend arm straight out", "Pull fingers back with other hand", "Hold for 15 seconds", "Switch hands and repeat"] }, { id: 9, title: "Standing Calf Raises", category: "strength", duration: 2, calories: 12, image: "https://images.unsplash.com/photo-1434608519344-49d77a699ded?w=400&h=300&fit=crop", description: "Boost circulation in your legs while standing.", instructions: ["Stand behind your chair", "Rise up on toes slowly", "Lower down with control", "Repeat 20 times"] }, { id: 10, title: "Box Breathing", category: "mindfulness", duration: 3, calories: 0, image: "https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=400&h=300&fit=crop", description: "Reduce stress and improve focus with controlled breathing.", instructions: ["Inhale for 4 counts", "Hold breath for 4 counts", "Exhale for 4 counts", "Hold empty for 4 counts", "Repeat 5 cycles"] }, { id: 11, title: "Shoulder Shrugs", category: "stretch", duration: 2, calories: 6, image: "https://images.unsplash.com/photo-1600881333168-2ef49b341f30?w=400&h=300&fit=crop", description: "Release shoulder tension from hunching over keyboard.", instructions: ["Lift shoulders to ears", "Hold for 3 seconds", "Release down", "Repeat 10 times"] }, { id: 12, title: "Wall Sit", category: "strength", duration: 2, calories: 18, image: "https://images.unsplash.com/photo-1517836357463-d25dfeac3438?w=400&h=300&fit=crop", description: "Static leg strengthener you can do against any wall.", instructions: ["Stand with back against wall", "Slide down until knees at 90 degrees", "Hold position", "Aim for 30-60 seconds"] } ]; export default function handler(req, res) { const { category, random } = req.query; let result = workouts; if (category && category !== 'all') { result = workouts.filter(w => w.category === category); } if (random === 'true') { const randomIndex = Math.floor(Math.random() * result.length); result = [result[randomIndex]]; } res.status(200).json(result); }