Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const generateBtn = document.getElementById('generateBtn');
+ const result = document.getElementById('result');
+ const plate = document.getElementById('plate');
+ const modeToggle = document.getElementById('modeToggle');
+ const initialText = document.querySelector('.initial-text');
+
+ const normalFoods = [
+ "Pizza Margherita 🍕",
+ "Chicken Stir-Fry 🥢",
+ "Spaghetti Carbonara 🍝",
+ "Grilled Salmon 🐟",
+ "Caesar Salad 🥗",
+ "Hamburger 🍔",
+ "Vegetable Curry 🍛",
+ "Tacos 🌮",
+ "Sushi Roll 🍱",
+ "Roast Chicken 🍗"
+ ];
+
+ const weirdCombos = [
+ "Chocolate-covered Pickles 🥒🍫",
+ "Ice Cream Spaghetti 🍝🍦",
+ "Peanut Butter Pizza 🍕🥜",
+ "Banana Burger 🍌🍔",
+ "Cookie Sushi 🍪🍱",
+ "Hot Dog Smoothie 🌭🥤",
+ "Cereal Tacos 🌮🥣",
+ "Donut Sandwich 🍩🥪",
+ "Pizza Ice Pop 🍕🍡",
+ "Candy Soup 🍬🥣"
+ ];
+
+ const spinPlate = () => {
+ plate.style.transform = 'rotate(360deg) scale(0.95)';
+ setTimeout(() => {
+ plate.style.transform = 'rotate(0deg) scale(1)';
+ }, 500);
+ };
+
+ const generateFood = () => {
+ initialText.style.display = 'none';
+ result.classList.remove('show');
+
+ const foods = modeToggle.checked ? weirdCombos : normalFoods;
+ const randomFood = foods[Math.floor(Math.random() * foods.length)];
+
+ spinPlate();
+
+ setTimeout(() => {
+ result.textContent = randomFood;
+ result.classList.add('show');
+ }, 250);
+ };
+
+ generateBtn.addEventListener('click', generateFood);
+ plate.addEventListener('click', generateFood);
+
+ // Add button press effect
+ generateBtn.addEventListener('mousedown', () => {
+ generateBtn.style.transform = 'scale(0.95)';
+ });
+
+ generateBtn.addEventListener('mouseup', () => {
+ generateBtn.style.transform = 'scale(1)';
+ });
+
+ // Handle keyboard navigation
+ generateBtn.addEventListener('keydown', (e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ generateFood();
+ }
+ });
+ });