import React, { useState, useEffect, useRef, useCallback } from 'react';
import QRCode from 'qrcode';
import jsqr from 'jsqr'; // Changed import statement to lowercase 'jsqr'
// Custom Alert Modal Component
const CustomAlert = ({ message, onClose }) => {
if (!message) return null;
return (
);
};
// --- QRGeneratorTab Component ---
const QRGeneratorTab = ({
content, setContent, errorLevel, setErrorLevel, qrColor, setQrColor,
suggestIdeas, downloadQrCode, qrCanvasRef,
isInputFocused, setIsInputFocused, currentThemeClasses,
qrStyles, selectedStyleIndex, setSelectedStyleIndex, styleCanvasRefs, drawQrCode,
suggestedIdea, showSuggestedIdea, setShowSuggestedIdea,
downloadResolution, setDownloadResolution
}) => {
// Effect to generate QR code on the main canvas (Generator Tab)
useEffect(() => {
// Preview canvas is always 256x256
drawQrCode(qrCanvasRef.current, content, qrColor, errorLevel, 256);
}, [content, qrColor, errorLevel, drawQrCode, qrCanvasRef]);
// Effect to generate QR codes for style previews (Style Selection Panel)
useEffect(() => {
qrStyles.forEach((style, index) => {
const canvas = styleCanvasRefs.current[index];
// Use a generic sample for style previews, not actual content
// For style previews, the 'light' color should always be black for contrast with the style's fg color
drawQrCode(canvas, "Sample", style.fg, 'H', 80, '#000000');
});
}, [qrStyles, drawQrCode, styleCanvasRefs]);
return (
// Modified: Changed lg:items-stretch to lg:items-start to allow independent heights
{/* Left Panel: Input and Controls - Removed flex-grow as it's not needed with items-start */}
{/* Suggested Ideas Panel */}
{showSuggestedIdea && suggestedIdea && (
setShowSuggestedIdea(!showSuggestedIdea)}>
)}
setQrColor(e.target.value)}
/>
{/* New: Download Resolution Selector */}
{!content && (
Enter content to see QR preview
)}
{/* Right Panel: Style Selection - Increased max-h slightly to 800px */}
{/* This inner div needs to scroll if content overflows. flex-grow and overflow-y-auto */}
{qrStyles.map((style, index) => (
{
setSelectedStyleIndex(index);
setQrColor(style.fg);
}}
>
{style.name}
))}
);
};
// --- QRDecoderTab Component ---
const QRDecoderTab = ({
decodedContent, setDecodedContent,
isSummarizing, summarizeContent, showAlert, decodeQrCode,
currentThemeClasses
}) => {
return (
// Added flex-grow to ensure it takes available vertical space
);
};
// --- SettingsTab Component ---
const SettingsTab = ({ currentTheme, setCurrentTheme, currentThemeClasses, themes }) => {
return (
// Added flex-grow to ensure it takes available vertical space
);
};
// --- Main App component ---
const App = () => {
const [activeTab, setActiveTab] = useState('generator');
const [content, setContent] = useState('');
const [errorLevel, setErrorLevel] = useState('L');
// Default QR color set to neon cyan
const [qrColor, setQrColor] = useState('#00FFFF');
const [decodedContent, setDecodedContent] = useState('');
const [selectedStyleIndex, setSelectedStyleIndex] = useState(0);
const [currentTheme, setCurrentTheme] = useState('dark');
const [isSummarizing, setIsSummarizing] = useState(false);
const [suggestedIdea, setSuggestedIdea] = useState('');
const [showSuggestedIdea, setShowSuggestedIdea] = useState(false);
const [alertMessage, setAlertMessage] = useState(null);
const [isInputFocused, setIsInputFocused] = useState(false);
const [downloadResolution, setDownloadResolution] = useState(512);
// Suggested ideas now directly within App.jsx
const [allSuggestedIdeas, setAllSuggestedIdeas] = useState([
"โค๏ธ๐ My Girlfriend's Mobile Number",
"โค๏ธ๐ฉ My Girlfriend's Name",
"โค๏ธ๐ My Girlfriend's Address",
"๐ ๐ My Home Address",
"๐๐ฑ My Mobile Number",
"๐งโ๏ธ My Email Address",
"๐๐ My Website URL",
"๐๐ My LinkedIn Profile",
"๐ญโจ My Favorite Quote",
"๐ก๐ Wi-Fi Network: MyHomeWiFi; Pass: MySecretPass",
"๐ฐ๐ณ UPI ID: myname@bank",
"๐๐๏ธ Event: Birthday Party, Date: 2025-12-25, Location: My House",
"๐๏ธ๐ Product Link: https://www.google.com/search?q=example.com/product/xyz",
"๐บ๏ธโก๏ธ Directions: geo:34.0522,-118.2437?q=Los Angeles",
"๐คซโจ Secret Message: You are awesome!",
"๐๐ผ My Business Card Info",
"๐จ๐ป Link to my Portfolio",
"๐จโ๐ป๐ My GitHub Repository",
"๐ถ๐ง My Favorite Song on Spotify",
"๐คฒ๐ A Donation Link",
"๐จ๐ Emergency Contact: John Doe, 9876543210",
"๐ฅ๐ฉธ Medical Info: Blood Type O+, Allergies: Penicillin",
"๐พ๐ Pet's Microchip ID: 1234567890",
"๐๐ Favorite Recipe: Pasta Carbonara Ingredients",
"๐๐ก Book Recommendation: 'Dune' by Frank Herbert",
"๐ฌ๐ฟ Movie to Watch: 'Inception'",
"๐ฎ๐ Game ID: PlayerOne#1234",
"โฟ๐ Crypto Wallet Address (ETH): 0x...",
"๐ผ๏ธ๐ NFT Collection Link",
"๐๐ Smart Contract Address",
"๐ณ๏ธ๐ก DAO Proposal Link",
"๐โจ Web3 DApp URL",
"๐๐ Decentralized Identity (DID)",
"๐๐ My Public Key",
"๐๏ธ๐ IPFS Hash of a Document",
"โ๏ธโ
Blockchain Transaction ID",
"๐๐ Metaverse Coordinates: X:100, Y:200, Z:50",
"๐๐ VR Experience Link",
"๐ธโจ AR Filter Link",
"๐จ๐ Digital Art Gallery URL",
"โ
๐๏ธ Event RSVP Link",
"๐๐ก Feedback Form Link",
"๐โ Survey Link",
"๐ฌ๐ค Customer Support Chat Link",
"๐โฌ๏ธ Download App Link (iOS)",
"๐คโฌ๏ธ Download App Link (Android)",
"๐๐ง Product Manual Link",
"๐๐ก๏ธ Warranty Information",
"โฉ๏ธ๐ Return Policy URL",
"๐ข๐ Company Contact Info",
"๐ผโ๏ธ Job Application Link",
"๐โฌ๏ธ Resume Download Link",
"๐๏ธ๐ค Interview Schedule",
"๐
๐ค Conference Agenda",
"๐ฃ๏ธ๐ Speaker Bio Link",
"โ๏ธ๐ก Workshop Registration",
"๐ฝ๏ธ๐ Restaurant Menu",
"๐ฝ๏ธ๐๏ธ Table Reservation Link",
"๐ฆ๐ Delivery Order Tracking",
"๐ฅ๐ณ Recipe Video Link",
"๐ช๐๏ธ Workout Plan",
"๐ฅ๐๏ธ Diet Plan",
"โค๏ธโ๐ฉน๐ Health Tracker Link",
"๐จ๐ Emergency Services Number",
"๐พ๐ Lost Pet Poster Link",
"๐๐ Found Item Contact",
"๐๐ณ Public Library Card Number",
"๐๏ธ๐ผ๏ธ Museum Exhibit Info",
"๐ฝ๐บ๏ธ Tourist Attraction Details",
"๐๏ธ๐ Local Event Calendar",
"๐โฐ Public Transport Schedule",
"๐
ฟ๏ธ๐ Parking Spot Locator",
"๐๐ค Car Share Booking Link",
"๐ฒ rent Bike Rental Info",
"๐ด๐ Scooter Share Unlock Code",
"โก๐ Charging Station Locator",
"๐๐ Electric Vehicle Info",
"โป๏ธ๐ Recycling Center Address",
"๐ฑ๐๏ธ Compost Drop-off Location",
"๐ง๐ก Water Conservation Tips",
"๐ก๐ฐ Energy Saving Advice",
"๐ค๐ Volunteer Opportunity",
"๐โค๏ธ Charity Donation Link",
"๐งโ๐พ๐ฅ Community Garden Info",
"๐ฅ๐๏ธ Local Farmers Market Schedule",
"๐จโ๏ธ Art Class Registration",
"๐ถ๐๏ธ Music Lesson Booking",
"๐๐๏ธ Dance Studio Schedule",
"๐งโโ๏ธ๐๏ธ Yoga Class Info",
"๐๏ธโโ๏ธ๐๏ธ Fitness Class Booking",
"โฝโ๏ธ Sports League Sign-up",
"๐ณ๐บ๏ธ Outdoor Activity Guide",
"โฐ๏ธ๐บ๏ธ Hiking Trail Map",
"๐๏ธ๐๏ธ Camping Site Reservation",
"๐ฃ๐ Fishing License Info",
"๐น๐ Hunting License Info",
"๐ค๐ Boating Regulations",
"โท๏ธโ๏ธ Ski Resort Conditions",
"๐โ๏ธ Snowboarding Park Info",
"๐โโ๏ธ๐ Surf Report",
"๐คฟ๐ Scuba Diving Spot",
"๐ช๐๏ธ Paragliding Booking",
"๐๐๏ธ Hot Air Balloon Ride",
"๐ชโจ Skydiving Experience",
"๐ฒ๐ข Zipline Adventure",
"๐ชข๐คธ Bungee Jumping Spot",
"๐งโโ๏ธ๐ Rock Climbing Gym",
"๐๐๏ธ Escape Room Booking",
"๐ฒโ Board Game Cafe",
"๐๐๏ธ Book Club Meeting Details",
"๐ค๐ Poetry Slam Event",
"๐๏ธ๐๏ธ Open Mic Night",
"๐๐๏ธ Comedy Show Tickets",
"๐ญ๐๏ธ Theater Play Schedule",
"๐ถ๐๏ธ Concert Tickets",
"๐จ๐๏ธ Art Exhibition Info",
"๐ธ๐ก Photography Workshop",
"๐ณโ๏ธ Cooking Class Registration",
"๐ฐ๐ Baking Recipe",
"๐น๐ Cocktail Recipe",
"๐ท๐๏ธ Wine Tasting Event",
"๐บ๐ญ Beer Brewery Tour",
"โ๐ณ Coffee Shop Loyalty Program",
"๐๏ธ๐จ Local Craft Market",
"๐๏ธ๐ฐ๏ธ Vintage Store Address",
"๐โป๏ธ Thrift Shop Location",
"๐บ๐ฐ๏ธ Antique Shop Info",
"๐ฟ๐ Record Store Address",
"๐๐ฆธ Comic Book Store",
"๐ฒ๐๏ธ Board Game Store",
"๐ ๏ธ๐๏ธ Hobby Shop Inventory",
"๐จ๐ก DIY Project Instructions",
"๐งโ๐พ๐ก Gardening Tips",
"๐ชด๐ Plant Care Guide",
"๐๐ Flower Shop Delivery",
"๐พโ๏ธ Pet Grooming Appointment",
"๐ถ๐ Veterinarian Contact",
"๐พโค๏ธ Animal Shelter Donation",
"๐๐ณ Dog Park Location",
"๐โ Cat Cafe Details",
"๐ฆ๐ณ Bird Watching Spot",
"๐ฆ๐ณ Wildlife Sanctuary Info",
"๐ ๐๏ธ Aquarium Tickets",
"๐ฆ๐๏ธ Zoo Visit Booking",
"๐๐๏ธ Farm Tour Schedule",
"๐๐๏ธ Orchard Picking Season",
"๐๐ท Vineyard Tour & Tasting",
"๐๐ท๏ธ Local Market Deals",
"๐ป๐ฐ Online Store Discount Code",
"๐๐บ Subscription Service Login",
"๐ป๐ Software License Key",
"๐ฎโฌ๏ธ Game Download Code",
"๐โฌ๏ธ E-book Download Link",
"๐ง๐ Audiobook Chapter List",
"๐๏ธ๐ Podcast Series Link",
"โถ๏ธ๐ YouTube Channel Link",
"๐ฎ๐ด Twitch Stream Link",
"๐ฌ๐ฎ Discord Server Invite",
"โ๏ธ๐ฌ Telegram Group Link",
"๐ข๐ฌ WhatsApp Group Invite",
"๐๐ฌ Signal Group Link",
"๐๐ฅ Facebook Group Link",
"๐ธ๐ค Instagram Profile",
"๐ฆโ๏ธ Twitter Handle",
"๐ต๐ TikTok Profile",
"๐ป๐ธ Snapchat Username",
"๐๐ผ๏ธ Pinterest Board Link",
"๐ฝ๐ฌ Reddit Community",
"โ๐ก Quora Profile",
"๐ปโ Stack Overflow Profile",
"โ๏ธ๐ป Dev.to Article Link",
"โ๏ธ๐ Medium Article Link",
"โ๏ธ๐ฐ Substack Newsletter",
"๐๐ค Patreon Page",
"โ๐ Ko-fi Link",
"โ๐ Buy Me a Coffee Link",
"๐๐๏ธ Merchandise Store Link",
"๐๏ธ๐๏ธ Eventbrite Ticket Link",
"๐ป๐ค Zoom Meeting ID",
"๐ป๐ฌ Google Meet Link",
"๐ป๐ Microsoft Teams Meeting",
"๐ปโ๏ธ Webinar Registration",
"๐๐ป Online Course Link",
"๐ฅ๐ก Tutorial Video Link",
"๐๐ Documentation Link",
"๐๐ป API Endpoint URL",
"โฌ๏ธ๐ป Software Update Link",
"๐๐ Bug Report Form",
"โจ๐ Feature Request Form",
"๐ซ๐ค Support Ticket System",
"๐๐ก Knowledge Base Article",
"โ๐ FAQ Page",
"๐ ๏ธ๐ Troubleshooting Guide",
"๐๐ง User Manual",
"๐๐ Quick Start Guide",
"โฌ๏ธ๐ ๏ธ Installation Instructions",
"๐ปโ
System Requirements",
"โ
๐ Compatibility List",
"๐โจ Release Notes",
"๐๐ Changelog",
"๐ณ๐ป Version Control Repository",
"โ
๐ Build Status Page",
"๐๐ Deployment Pipeline Status",
"๐ฅ๏ธโ
Server Status Page",
"๐๐บ๏ธ Network Diagram",
"๐๐ Security Policy",
"๐ต๏ธโโ๏ธ๐ Privacy Policy",
"๐๐ค Terms of Service",
"๐ช๐ Cookie Policy",
"๐ช๐บโ
GDPR Compliance Info",
"โฟ๐ Accessibility Statement",
"๐บ๏ธ๐ Sitemap",
"๐ค๐ Robots.txt Content",
"๐ก๐ป Open Source Project Page",
"๐ค๐ Contributor Guidelines",
"๐ค๐ Code of Conduct",
"๐โ
License Information",
"๐ฐ๐ Bug Bounty Program",
"๐จ๐ Security Vulnerability Report",
"๐ก๏ธ๐ Penetration Test Report",
"โ
๐ Compliance Audit Report",
"๐๐ Certification Details",
"๐โจ Awards and Recognition",
"๐ฐโฌ๏ธ Press Kit Download",
"๐๐ฐ Media Contact Info",
"๐๐ค Investor Relations Page",
"๐๐๏ธ Annual Report",
"๐๐ Quarterly Earnings Call",
"๐๐ฐ Stock Information",
"๐งโ๐ผ๐ฉโ๐ผ Board of Directors",
"๐๐ฐ๏ธ Company History",
"๐ฏโจ Mission Statement",
"๐ญโจ Vision Statement",
"๐๐ Values Statement",
"๐ผโจ Career Opportunities",
"๐๐งโ๐ผ Employee Handbook",
"๐๐ฉโ๐ผ HR Contact Info",
"๐ฐ๐ฅ Benefits Information",
"๐๐ก Training Resources",
"๐๐ Internal Wiki Link",
"๐๐ ๏ธ Project Management Tool",
"๐ฌ๐ค Team Communication Channel",
"๐๐๏ธ Meeting Notes Link",
"๐๐ค Shared Document Folder",
"๐๏ธโ๏ธ Time Off Request Form",
"๐ฐ๐ Expense Report System",
"๐ฅ๏ธ๐ค IT Support Portal",
"๐ข๐บ๏ธ Office Location Map",
"๐
ฟ๏ธ๐ Parking Instructions",
"๐ก๐ Visitor Wi-Fi Password",
"๐จ๐บ๏ธ Emergency Evacuation Plan",
"๐ฉน๐ First Aid Kit Location",
"defibrillator AED Location",
"๐ฅ๐ Fire Extinguisher Location",
"โ ๏ธ๐ Safety Guidelines",
"๐ช๐ Building Access Code",
"๐ฎ๐ Security Guard Contact",
"๐งน๐๏ธ Cleaning Schedule",
"๐ง๐ Maintenance Request Form",
"๐ฆ๐ Supply Order Form",
"โ๐ Coffee Machine Instructions",
"๐จ๏ธ๐ Printer Setup Guide",
"๐๐ ๏ธ Network Troubleshooting Steps",
"๐ปโฌ๏ธ Software Installation Guide",
"๐๐ VPN Connection Details",
"๐ฅ๏ธ๐ Remote Desktop Access",
"๐๐ค Help Desk Contact",
"๐๐ Feedback Survey for Employees",
"๐ก๐ณ๏ธ Suggestion Box Link",
"๐๏ธ๐ Company Event Calendar",
"๐ค๐ Team Building Activity Info",
"๐๐๏ธ Holiday Schedule",
"๐๐ Dress Code Policy",
"โ๏ธ๐ Travel Policy",
"๐ฐ๐ Expense Reimbursement Policy",
"๐ป๐ IT Asset Management System",
"๐ป๐ฆ Software Inventory",
"๐ฅ๏ธ๐ฆ Hardware Inventory",
"๐ท๏ธ๐ Asset Tagging Guidelines",
"โป๏ธ๐ป Disposal Procedures for Electronics",
"๐พ๐๏ธ Data Backup Schedule",
"๐จ๐พ Disaster Recovery Plan",
"๐จ๐ Incident Report Form",
"๐๐ Change Management Process",
"๐๐ Project Plan Document",
"โ
๐ Task List for Project",
"๐โโ๏ธ๐ Sprint Backlog",
"๐๐ Burndown Chart Link",
"๐๐ก Retrospective Notes",
"๐ฅ๐ Team Roster",
"โ
๐งโ๐ป Onboarding Checklist",
"โ
๐ Offboarding Checklist",
"๐๐ Training Module Link",
"๐๐ Certification Tracking",
"๐๐ Performance Review Form",
"๐ฏ๐ Goal Setting Worksheet",
"๐ค๐ก Mentorship Program Info",
"๐๐ Career Development Resources",
"๐๐ Employee Recognition Program",
"๐งโโ๏ธ๐ Wellness Program Details",
"๐ง ๐ Mental Health Resources",
"๐ชโ๏ธ Fitness Challenge Sign-up",
"๐ฅ๐ Nutrition Guide",
"๐ชโ
Ergonomics Checklist",
"๐ ๐ป Work From Home Policy",
"๐๏ธโ๏ธ Flexible Work Arrangement Request",
"๐๐ฐ Commuter Benefits Info",
"๐ฐโ๏ธ Company Newsletter Sign-up",
"๐ผ๐ข Internal Job Postings",
"๐ค๐ฐ Referral Program Details",
"๐๐ค Diversity & Inclusion Initiatives",
"โป๏ธ๐ Sustainability Report",
"๐ค๐ Corporate Social Responsibility",
"๐๐ Investor Deck",
"๐ฐ๐๏ธ Press Release Archive",
"๐จ๐ Brand Guidelines",
"๐ผ๏ธโฌ๏ธ Logo Download Page",
"๐๐ Marketing Collateral Library",
"๐๐ Sales Playbook",
"๐ค๐ป Customer Relationship Management (CRM) Login",
"๐๐ Sales Forecasting Dashboard",
"โ๏ธ๐ก Lead Generation Form",
"๐ค๐ Partnership Program Details",
"๐๐ฐ Affiliate Program Info",
"๐คโ๏ธ Reseller Application",
"๐ค๐ป Vendor Portal Login",
"๐๐ Procurement Policy",
"๐งพ๐ป Invoice Submission Portal",
"๐ฐโ
Payment Status Checker",
"๐๐ฐ Budget Tracking Spreadsheet",
"๐๐ Financial Report Access",
"๐๐ Legal Document Library",
"๐๐ค Contract Review Request",
"ยฎ๏ธ๐ Trademark Registration Info",
"๐ก๐ Patent Application Status",
"โ
๐ Compliance Training Module",
"โ ๏ธ๐ Risk Assessment Report",
"๐๏ธ๐ Audit Schedule",
"๐๐ Internal Audit Findings",
"๐๐ External Audit Report",
"๐๐ Regulatory Updates",
"๐๐ Industry Standards Guide",
"โจ๐ Best Practices Document",
"๐ฌ๐ Research Paper Link",
"๐โฌ๏ธ Case Study Download",
"๐๐ก Whitepaper Access",
"๐ฅ๐ป Webinar Recording",
"๐ง๐ Podcast Series Link",
"โ๏ธ๐ Blog Post Archive",
"๐ฐโจ News Article About Us",
"๐ฃ๏ธ๐ Customer Testimonials",
"โญ๐ Product Reviews",
"๐ฌ๐ User Forum Link",
"๐ค๐ Community Guidelines",
"๐ก๏ธ๐ Moderation Policy",
"๐จ๐ Report Abuse Form",
"โ๏ธ๐ค Account Settings Page",
"๐๐ Password Reset Link",
"๐๐ฑ Two-Factor Authentication Setup",
"๐โ๏ธ Notification Preferences",
"๐ณโ๏ธ Payment Methods Management",
"๐ฆ๐ Order History",
"๐๐ Shipping Tracking",
"โฉ๏ธ๐ฐ Returns & Refunds Policy",
"๐๐๏ธ Wishlist Link",
"๐๐๏ธ Shopping Cart Link",
"๐๐๏ธ Product Catalog",
"๐๏ธ๐ค Service Booking Page",
"๐๏ธโ๏ธ Appointment Scheduling",
"๐๏ธ๐ Class Schedule",
"๐๏ธ๐ Event Calendar",
"๐๏ธ๐๏ธ Ticket Purchase Link",
"๐บ๏ธ๐ Venue Map",
"๐บ๐บ๏ธ Seating Chart",
"โก๏ธ๐ Directions to Venue",
"๐
ฟ๏ธ๐ Parking Information",
"๐๐ Public Transport Options",
"๐จ๐๏ธ Hotel Booking Link",
"โ๏ธ๐๏ธ Flight Information",
"๐๐๏ธ Car Rental Booking",
"โ๏ธ๐ก๏ธ Travel Insurance Info",
"๐๐ Passport Renewal Guide",
"๐๐ Visa Application Requirements",
"๐ฑ๐ Currency Exchange Rates",
"๐๐ค Local Customs Guide",
"โ ๏ธโ๏ธ Travel Advisory Updates",
"๐จ๐ Emergency Travel Contacts",
"๐งณ๐ Lost Luggage Report",
"๐บ๏ธ๐๏ธ Travel Itinerary",
"โ
๐งณ Packing Checklist",
"๐ฅโ๏ธ Travel Health Information",
"๐โ
Vaccination Requirements",
"๐ก๏ธโ๏ธ Travel Safety Tips",
"๐ฝ๏ธ๐บ๏ธ Local Cuisine Guide",
"๐ฝ๏ธโญ Restaurant Recommendations",
"โ๐บ๏ธ Cafe Directory",
"๐ป๐บ๏ธ Bar & Pub Guide",
"๐๐ Nightlife Events",
"๐๏ธ๐บ๏ธ Shopping Districts",
"๐๐บ๏ธ Local Markets",
"๐๐บ๏ธ Souvenir Shop Locations",
"๐๏ธ๐ผ๏ธ Museums & Galleries",
"๐๐๏ธ Historical Sites",
"๐ณ๐ท Parks & Gardens",
"๐๏ธ๐ Beaches & Lakes",
"โฐ๏ธ๐ฒ Hiking & Biking Trails",
"๐๏ธโฝ Sports Facilities",
"๐ค๐๏ธ Concert Venues",
"๐ญ๐ Theater & Performance Spaces",
"๐ฌโฐ Cinema Showtimes",
"๐๐ Library Branches",
"โ๏ธ๐ Post Office Locations",
"๐ฆ๐ง Bank & ATM Locations",
"๐๐บ๏ธ Pharmacy Directory",
"๐ฅ๐บ๏ธ Hospital & Clinic Finder",
"๐๐ Police Station Contact",
"๐๐ Fire Station Contact",
"๐ข๐ Embassy/Consulate Info",
"๐๏ธ๐ค Local Government Services",
"๐๏ธ๐ Public Holidays Calendar",
"๐ซ๐ School Directory",
"๐๐ University Course Catalog",
"๐ถ๐ Childcare Services",
"๐ต๐ Elderly Care Resources",
"โฟ๐ค Disability Support Services",
"โ๏ธ๐ค Legal Aid Services",
"๐ฐ๐ค Financial Advisor Contact",
"๐ก๏ธ๐ Insurance Agent Info",
"๐ ๐ Real Estate Agent Contact",
"๐ฆโ
Moving Checklist",
"๐ก๐ Utility Provider Contacts",
"๐๐ Internet Service Provider Info",
"๐บ๐ Cable TV Provider Info",
"๐๏ธ๐๏ธ Waste Collection Schedule",
"โป๏ธ๐ Recycling Guidelines",
"๐๏ธ๐ Bulk Item Pickup Request",
"๐งน๐๏ธ Street Cleaning Schedule",
"๐คซ๐ Noise Complaint Form",
"๐๐ Lost & Found Reporting",
"๐๐ Neighborhood Watch Info",
"๐๏ธ๐ Community Events Calendar",
"๐ฐ๐ Local News Feed",
"โ๏ธโ๏ธ Weather Forecast Link",
"๐ฆ๐ Traffic Updates",
"๐จ๐ข Public Safety Alerts",
"๐ก๏ธ๐ก Crime Prevention Tips",
"๐จ๐ Emergency Preparedness Guide",
"๐๐ค Disaster Relief Resources",
"๐ค๐ Volunteer Opportunities",
"๐๐ข Charitable Organizations",
"๐๐ฅซ Food Bank Locations",
"๐ ๐ค Homeless Shelter Info",
"๐พโค๏ธ Animal Rescue Groups",
"๐ณ๐ก๏ธ Environmental Protection Agencies",
"๐ฑ๐ค Conservation Programs",
"โ๏ธโก Renewable Energy Initiatives",
"โป๏ธ๐ Sustainable Living Tips",
"๐ฑ๐ข Green Building Certifications",
"โป๏ธ๐๏ธ Eco-Friendly Product List",
"๐ค๐๏ธ Fair Trade Product Info",
"๐๐ค Ethical Sourcing Policy",
"Rights๐ค Human Rights Organizations",
"โ๏ธ๐ค Social Justice Initiatives",
"๐ง ๐ Mental Health Support Hotlines",
"๐จ๐ค Crisis Intervention Services",
"๐ญ๐ค Addiction Recovery Resources",
"๐ค๐ฌ Support Groups Directory",
"๐๏ธ๐ Therapist/Counselor Finder",
"๐งโโ๏ธ๐ก Stress Management Techniques",
"๐งโโ๏ธโจ Mindfulness Exercises",
"๐งโโ๏ธ๐ฑ Meditation Apps",
"๐ด๐ก Sleep Hygiene Tips",
"๐๐ Healthy Eating Guide",
"๐ช๐๏ธ Exercise Routines",
"๐๏ธโโ๏ธ๐ Personal Trainer Contact",
"๐๏ธโโ๏ธ๐ณ Gym Membership Info",
"โฝ๐๏ธ Sports Team Schedule",
"๐๏ธ๐๏ธ Game Tickets Purchase",
"fanatic Fan Club Registration",
"๐๐๏ธ Team Merchandise Store",
"๐โน๏ธ Player Statistics",
"๐๐ League Standings",
"๐ฅโฝ Match Highlights Video",
"๐ฐโฝ Sports News Feed",
"๐ฎ๐ Fantasy Sports League",
"๐ฒ๐ฐ Betting Odds",
"๐ป๐ Sports Bar Locator",
"๐๏ธ๐๏ธ Stadium Tour Booking",
"๐
๐ค Athlete Bio",
"๐งโ๐ซ๐ฅ Coaching Staff Directory",
"๐๐ Team History",
"๐โจ Hall of Fame Inductees",
"๐ผ๏ธ๐ฐ Memorabilia Auction",
"โ๏ธ๐๏ธ Autograph Session Details",
"๐ค๐ Fan Meetup Info",
"๐๏ธ๐ Season Ticket Holder Benefits",
"โจ๐๏ธ VIP Experience Packages",
"๐ค๐ฐ Sponsorship Opportunities",
"๐ฐโ๏ธ Media Accreditation Form",
"๐ค๐๏ธ Press Conference Schedule",
"๐๏ธ๐ค Post-Game Interview Access",
"๐๐ฅ Team Roster Changes",
"๐ฉน๐ Injury Report",
"๐๐ฌ Trade Rumors",
"๐๐ก Draft Pick Analysis",
"๐๐ Scouting Reports",
"๐ถโฝ Youth Sports Programs",
"๐งโ๐ซ๐ Coaching Certification Courses",
"โ๏ธ๐ Referee Training Programs",
"๐๏ธโฝ Sports Equipment Store",
"๐๐๏ธ Sports Apparel Shop",
"๐๐ช Nutritional Supplements Info",
"๐ฅ๐ฉน Sports Injury Clinic",
"๐ถโโ๏ธ๐ฉน Physical Therapy Services",
"๐ง ๐ช Sports Psychology Resources",
"๐๐งโ๐ซ Performance Coaching",
"๐
โ๏ธ Athlete Sponsorship Application",
"๐๐ฐ Sports Scholarship Info",
"๐ฌ๐ช Sports Science Research",
"๐ฌ๐ถ Biomechanics Lab Access",
"๐๐ป Sports Analytics Tools",
"โ๐ช Wearable Tech for Athletes",
"๐ด๐ฉน Recovery Techniques",
"๐ง๐ก Hydration Guidelines",
"๐ดโจ Sleep Optimization Tips",
"๐ชโฐ Pre-Workout Routine",
"๐ฝ๏ธ๐ช Post-Workout Meal Ideas",
"๐ก๏ธ๐ช Injury Prevention Exercises",
"๐ฅ๐ช Warm-up Drills",
"๐ฌ๏ธ๐ง Cool-down Stretches",
"๐๐ช Cross-Training Ideas",
"๐๏ธโโ๏ธ๐๏ธ Strength Training Program",
"๐โโ๏ธ๐๏ธ Cardio Workout Plan",
"๐คธโโ๏ธ๐ง Flexibility Exercises",
"โ๏ธ๐คธ Balance Training Drills",
"โก๐ Agility Training Drills",
"๐จ๐ Speed Training Workouts",
"wytrwalosc Endurance Training Tips",
"๐ฅ๐ช Plyometric Exercises",
"๐ช๐ง Core Strength Workouts",
"๐ชโฌ๏ธ Upper Body Workout",
"๐ชโฌ๏ธ Lower Body Workout",
"๐ช๐ Full Body Workout",
"๐ด๐ณ Rest Day Activities",
"๐ถโโ๏ธ๐ฉน Active Recovery Ideas",
"๐งโโ๏ธ๐คธ Stretching Routine",
"roll Foam Rolling Techniques",
"๐โโ๏ธ๐๏ธ Massage Therapy Booking",
"โ๏ธ๐ฉน Cryotherapy Benefits",
"๐งโโ๏ธ๐ฅ Sauna Session Info",
"๐ง๐ฉน Hydrotherapy Benefits",
"๐๐ฉน Acupuncture Clinic",
"๐ฆด๐ Chiropractor Contact",
"๐ถโโ๏ธ๐ Physical Therapist Contact",
"๐ฅ๐ Sports Doctor Contact",
"๐ฅ๐ Dietitian Consultation",
"๐๐ Sports Nutritionist",
"๐ง ๐งโ๐ซ Mental Performance Coach",
"๐ง ๐ Sports Psychologist",
"๐งโโ๏ธ๐ช Yoga for Athletes",
"๐คธโโ๏ธ๐ช Pilates for Core Strength",
"๐๏ธโโ๏ธ๐๏ธ CrossFit WODs",
"โฑ๏ธ๐ช HIIT Workout Examples",
"โฑ๏ธ๐๏ธโโ๏ธ Tabata Training Guide",
"๐๐ช Circuit Training Ideas",
"๐คธโโ๏ธ๐ช Bodyweight Exercises",
"elastic Resistance Band Workouts",
"kettlebell Kettlebell Training",
"dumbbell Dumbbell Exercises",
"barbell Barbell Workouts",
"โ๏ธ๐ช Gym Machine Guide",
"๐ณ๐ช Outdoor Workout Spots",
"๐โโ๏ธ๐บ๏ธ Running Routes",
"๐ฒ๐บ๏ธ Cycling Trails",
"๐โโ๏ธ๐๏ธ Swimming Pool Schedule",
"๐๐ Basketball Court Locator",
"๐พ๐๏ธ Tennis Court Booking",
"๐๐ Volleyball Court Info",
"๐ธ๐๏ธ Badminton Court Booking",
"squash Squash Court Booking",
"๐๐ Table Tennis Club",
"๐ณ๐ Bowling Alley Info",
"โธ๏ธ๐ Ice Skating Rink",
"๐ผ๐ Roller Skating Rink",
"๐น๐ Skate Park Location",
"๐งโโ๏ธ๐ Climbing Wall Gym",
"๐งโโ๏ธ๐ Bouldering Gym",
"๐ฅ๐ Martial Arts Dojo",
"๐ฅ๐ Boxing Gym",
"๐คบ๐ Fencing Club",
"๐น๐ Archery Range",
"๐ซ๐ Shooting Range",
"โณ๐๏ธ Golf Course Booking",
"โณ๐ Mini Golf Course",
"๐๏ธโโ๏ธ๐ Driving Range",
"๐๐๏ธ Horse Riding Lessons",
"๐๐ Equestrian Center"
]);
// No need for isFetchingIdeas state or useEffect for fetching ideas anymore
const [isFetchingIdeas, setIsFetchingIdeas] = useState(false);
const qrCanvasRef = useRef(null);
const styleCanvasRefs = useRef(Array(12).fill(null));
// Define QR code styles (remains in App as it's static data used by QRGeneratorTab)
const qrStyles = [
{ name: "Classic", fg: "#FFFFFF" }, // Changed to white for visibility
{ name: "Neon Green", fg: "#39FF14" }, // Vibrant Neon Green
{ name: "Electric Blue", fg: "#00BFFF" }, // Bright Sky Blue
{ name: "Radiant Pink", fg: "#FF007F" }, // Hot Pink
{ name: "Cyber Purple", fg: "#BF00FF" }, // Bright Purple
{ name: "Gold Spark", fg: "#FFD700" }, // Gold
{ name: "Aqua Glow", fg: "#00FFFF" }, // Cyan (default)
{ name: "Fire Orange", fg: "#FF4500" }, // Orange-Red
{ name: "Lava Red", fg: "#FF2400" }, // Bright Red
{ name: "Lime Zing", fg: "#7FFF00" }, // Chartreuse
{ name: "Deep Teal", fg: "#008080" }, // Teal
{ name: "Violet Ray", fg: "#8A2BE2" }, // Blue-Violet
{ name: "Emerald", fg: "#00C957" }, // Deep Green
{ name: "Sapphire", fg: "#082567" }, // Deep Blue
{ name: "Ruby", fg: "#E0115F" }, // Deep Red
{ name: "Amethyst", fg: "#9966CC" }, // Medium Purple
{ name: "Sunshine", fg: "#FFD300" }, // Bright Yellow
{ name: "Ocean Wave", fg: "#007FFF" }, // Medium Blue
{ name: "Forest Mist", fg: "#A8C3BC" }, // Light Greenish-Gray
{ name: "Crimson Tide", fg: "#DC143C" }, // Crimson
{ name: "Midnight Blue", fg: "#191970" }, // Dark Blue
{ name: "Rose Gold", fg: "#B76E79" }, // Rose Gold
{ name: "Spring Green", fg: "#00FF7F" }, // Spring Green
{ name: "Royal Purple", fg: "#7851A9" }, // Royal Purple
{ name: "Azure", fg: "#007FFF" }, // Azure Blue
{ name: "Coral", fg: "#FF7F50" }, // Coral Orange
{ name: "Mint Green", fg: "#98FF98" }, // Light Mint Green
{ name: "Lavender", fg: "#E6E6FA" }, // Light Lavender
{ name: "Chocolate", fg: "#D2691E" }, // Chocolate Brown
{ name: "Silver", fg: "#C0C0C0" }, // Silver
{ name: "Bronze", fg: "#CD7F32" }, // Bronze
{ name: "Copper", fg: "#B87333" }, // Copper
{ name: "Plum", fg: "#8E4585" }, // Plum Purple
{ name: "Olive", fg: "#808000" }, // Olive Green
{ name: "Maroon", fg: "#800000" }, // Maroon Red
{ name: "Teal Blue", fg: "#367588" }, // Teal Blue
{ name: "Sky Blue", fg: "#87CEEB" }, // Sky Blue
{ name: "Slate Gray", fg: "#708090" }, // Slate Gray
{ name: "Dark Green", fg: "#006400" }, // Dark Green
{ name: "Dark Red", fg: "#8B0000" }, // Dark Red
{ name: "Dark Blue", fg: "#00008B" }, // Dark Blue
{ name: "Dark Cyan", fg: "#008B8B" }, // Dark Cyan
{ name: "Dark Magenta", fg: "#8B008B" }, // Dark Magenta
{ name: "Dark Yellow", fg: "#8B8B00" }, // Dark Yellow
{ name: "Light Gray", fg: "#D3D3D3" }, // Light Gray
{ name: "Light Blue", fg: "#ADD8E6" }, // Light Blue
{ name: "Light Green", fg: "#90EE90" }, // Light Green
{ name: "Light Pink", fg: "#FFB6C1" }, // Light Pink
{ name: "Light Yellow", fg: "#FFFFE0" }, // Light Yellow
{ name: "Pale Green", fg: "#98FB98" }, // Pale Green
{ name: "Pale Blue", fg: "#AFEEEE" }, // Pale Blue
{ name: "Pale Red", fg: "#F08080" }, // Pale Red
{ name: "Pale Yellow", fg: "#FFFF99" }, // Pale Yellow
{ name: "Deep Orange", fg: "#FF6600" }, // Deep Orange
{ name: "Deep Pink", fg: "#FF1493" }, // Deep Pink
{ name: "Deep Purple", fg: "#800080" }, // Deep Purple
{ name: "Deep Sky Blue", fg: "#00BFFF" }, // Deep Sky Blue
{ name: "Medium Sea Green", fg: "#3CB371" }, // Medium Sea Green
{ name: "Medium Slate Blue", fg: "#7B68EE" }, // Medium Slate Blue
{ name: "Medium Spring Green", fg: "#00FA9A" }, // Medium Spring Green
{ name: "Medium Turquoise", fg: "#48D1CC" }, // Medium Turquoise
{ name: "Medium Violet Red", fg: "#C71585" }, // Medium Violet Red
{ name: "Dark Goldenrod", fg: "#B8860B" }, // Dark Goldenrod
{ name: "Dark Orchid", fg: "#9932CC" }, // Dark Orchid
{ name: "Dark Salmon", fg: "#E9967A" }, // Dark Salmon
{ name: "Dark Sea Green", fg: "#8FBC8F" }, // Dark Sea Green
{ name: "Dark Slate Blue", fg: "#483D8B" }, // Dark Slate Blue
{ name: "Dark Slate Gray", fg: "#2F4F4F" }, // Dark Slate Gray
{ name: "Dark Turquoise", fg: "#00CED1" }, // Dark Turquoise
{ name: "Dark Violet", fg: "#9400D3" }, // Dark Violet
{ name: "Light Coral", fg: "#F08080" }, // Light Coral
{ name: "Light Cyan", fg: "#E0FFFF" }, // Light Cyan
{ name: "Light Goldenrod Yellow", fg: "#FAFAD2" }, // Light Goldenrod Yellow
{ name: "Light Green", fg: "#90EE90" }, // Light Green
{ name: "Light Pink", fg: "#FFB6C1" }, // Light Pink
{ name: "Light Salmon", fg: "#FFA07A" }, // Light Salmon
{ name: "Light Sea Green", fg: "#20B2AA" }, // Light Sea Green
{ name: "Light Sky Blue", fg: "#87CEFA" }, // Light Sky Blue
{ name: "Light Slate Gray", fg: "#778899" }, // Light Slate Gray
{ name: "Light Steel Blue", fg: "#B0C4DE" }, // Light Steel Blue
{ name: "Light Yellow", fg: "#FFFFE0" }, // Light Yellow
{ name: "Hot Pink", fg: "#FF69B4" }, // Hot Pink
{ name: "Indian Red", fg: "#CD5C5C" }, // Indian Red
{ name: "Indigo", fg: "#4B0082" }, // Indigo
{ name: "Khaki", fg: "#F0E68C" }, // Khaki
{ name: "Lavender Blush", fg: "#FFF0F5" }, // Lavender Blush
{ name: "Lemon Chiffon", fg: "#FFFACD" }, // Lemon Chiffon
{ name: "Lime Green", fg: "#32CD32" }, // Lime Green
{ name: "Linen", fg: "#FAF0E6" }, // Linen
{ name: "Medium Aqua Marine", fg: "#66CDAA" }, // Medium Aqua Marine
{ name: "Medium Blue", fg: "#0000CD" }, // Medium Blue
{ name: "Medium Orchid", fg: "#BA55D3" }, // Medium Orchid
{ name: "Medium Purple", fg: "#9370DB" }, // Medium Purple
{ name: "Medium Violet Red", fg: "#C71585" }, // Medium Violet Red
{ name: "Misty Rose", fg: "#FFE4E1" }, // Misty Rose
{ name: "Moccasin", fg: "#FFE4B5" }, // Moccasin
{ name: "Navajo White", fg: "#FFDEAD" }, // Navajo White
{ name: "Old Lace", fg: "#FDF5E6" }, // Old Lace
{ name: "Olive Drab", fg: "#6B8E23" }, // Olive Drab
{ name: "Orange Red", fg: "#FF4500" }, // Orange Red
{ name: "Orchid", fg: "#DA70D6" }, // Orchid
{ name: "Pale Goldenrod", fg: "#EEE8AA" }, // Pale Goldenrod
{ name: "Pale Turquoise", fg: "#AFEEEE" }, // Pale Turquoise
{ name: "Pale Violet Red", fg: "#DB7093" }, // Pale Violet Red
{ name: "Papaya Whip", fg: "#FFEFD5" }, // Papaya Whip
{ name: "Peach Puff", fg: "#FFDAB9" }, // Peach Puff
{ name: "Peru", fg: "#CD853F" }, // Peru
{ name: "Pink", fg: "#FFC0CB" }, // Pink
{ name: "Plum", fg: "#DDA0DD" }, // Plum
{ name: "Powder Blue", fg: "#B0E0E6" }, // Powder Blue
{ name: "Rosy Brown", fg: "#BC8F8F" }, // Rosy Brown
{ name: "Royal Blue", fg: "#4169E1" }, // Royal Blue
{ name: "Saddle Brown", fg: "#8B4513" }, // Saddle Brown
{ name: "Salmon", fg: "#FA8072" }, // Salmon
{ name: "Sandy Brown", fg: "#F4A460" }, // Sandy Brown
{ name: "Sea Green", fg: "#2E8B57" }, // Sea Green
{ name: "Sea Shell", fg: "#FFF5EE" }, // Sea Shell
{ name: "Sienna", fg: "#A0522D" }, // Sienna
{ name: "Sky Blue", fg: "#87CEEB" }, // Sky Blue
{ name: "Slate Blue", fg: "#6A5ACD" }, // Slate Blue
{ name: "Slate Gray", fg: "#708090" }, // Slate Gray
{ name: "Snow", fg: "#FFFAFA" }, // Snow
{ name: "Spring Green", fg: "#00FF7F" }, // Spring Green
{ name: "Steel Blue", fg: "#4682B4" }, // Steel Blue
{ name: "Tan", fg: "#D2B48C" }, // Tan
{ name: "Thistle", fg: "#D8BFD8" }, // Thistle
{ name: "Tomato", fg: "#FF6347" }, // Tomato
{ name: "Turquoise", fg: "#40E0D0" }, // Turquoise
{ name: "Violet", fg: "#EE82EE" }, // Violet
{ name: "Wheat", fg: "#F5DEB3" }, // Wheat
{ name: "White Smoke", fg: "#F5F5F5" }, // White Smoke
{ name: "Yellow Green", fg: "#9ACD32" }, // Yellow Green
];
// Define themes (remains in App)
const themes = {
dark: {
// Deeper, more consistent dark background
bg: 'bg-gradient-to-br from-[#050505] via-[#100515] to-[#050505] animate-gradient-shift',
text: 'text-gray-100',
// More vibrant neon accents
primaryAccent: 'from-cyan-500 to-blue-600',
secondaryAccent: 'from-fuchsia-500 to-purple-600',
glassBg: 'bg-white/5 backdrop-blur-3xl',
glassBorder: 'border-white/10',
shadow: 'shadow-blue-500/20',
glow: 'shadow-lg shadow-cyan-400/40', // Stronger neon glow
buttonGlow: 'hover:shadow-xl hover:shadow-cyan-300/50', // Stronger button glow
success: 'text-green-400',
alert: 'text-pink-500',
inputBg: 'bg-white/5',
inputBorder: 'border-white/10',
tabActive: 'bg-white/10 border-cyan-500 shadow-lg shadow-cyan-500/20', // Neon active tab
tabInactive: 'bg-transparent border-transparent',
cardBg: 'bg-white/5 backdrop-blur-md',
cardBorder: 'border-white/10',
// Ensure QR preview background is very dark for neon contrast
qrPreviewBorder: 'border-cyan-500/50',
qrPreviewBg: 'bg-gradient-to-br from-gray-950/40 to-gray-900/40 backdrop-blur-md',
headerGlow: 'animate-quantum-flux'
},
light: {
bg: 'bg-gradient-to-br from-[#F8F8F8] via-[#E8E8E8] to-[#F8F8F8] animate-gradient-shift-light',
text: 'text-gray-800',
primaryAccent: 'from-blue-400 to-purple-500',
secondaryAccent: 'from-cyan-300 to-teal-400',
glassBg: 'bg-white/80 backdrop-blur-3xl',
glassBorder: 'border-gray-200',
shadow: 'shadow-gray-400/20',
glow: 'shadow-lg shadow-blue-300/40',
buttonGlow: 'hover:shadow-xl hover:shadow-blue-300/50',
success: 'text-green-600',
alert: 'text-red-600',
inputBg: 'bg-white/90',
inputBorder: 'border-gray-300',
tabActive: 'bg-white/90 border-blue-500 shadow-lg shadow-blue-300/20',
tabInactive: 'bg-transparent border-transparent',
cardBg: 'bg-white/90 backdrop-blur-md',
cardBorder: 'border-gray-200',
qrPreviewBorder: 'border-blue-400/50',
qrPreviewBg: 'bg-gradient-to-br from-gray-100/60 to-gray-200/60 backdrop-blur-md',
headerGlow: 'animate-quantum-flux-light'
},
'forest-green': {
bg: 'bg-gradient-to-br from-[#0A2A1A] via-[#1A4A3A] to-[#0A3A2A] animate-gradient-shift',
text: 'text-white',
primaryAccent: 'from-green-500 to-emerald-600',
secondaryAccent: 'from-lime-400 to-green-500',
glassBg: 'bg-green-900/40 backdrop-blur-3xl',
glassBorder: 'border-green-800/20',
shadow: 'shadow-green-500/20',
glow: 'shadow-lg shadow-green-500/40',
buttonGlow: 'hover:shadow-xl hover:shadow-green-400/50',
success: 'text-lime-400',
alert: 'text-red-400',
inputBg: 'bg-green-950/30',
inputBorder: 'border-green-900/15',
tabActive: 'bg-green-800/20 border-green-500 shadow-lg shadow-green-500/20',
tabInactive: 'bg-transparent border-transparent',
cardBg: 'bg-green-950/30 backdrop-blur-md',
cardBorder: 'border-green-900/15',
qrPreviewBorder: 'border-green-500/50',
qrPreviewBg: 'bg-gradient-to-br from-green-900/30 to-green-800/30 backdrop-blur-md',
headerGlow: 'animate-quantum-flux'
},
'ocean-blue': {
bg: 'bg-gradient-to-br from-[#001A33] via-[#003366] to-[#002A5A] animate-gradient-shift',
text: 'text-white',
primaryAccent: 'from-blue-600 to-indigo-700',
secondaryAccent: 'from-sky-400 to-cyan-500',
glassBg: 'bg-blue-900/40 backdrop-blur-3xl',
glassBorder: 'border-blue-800/20',
shadow: 'shadow-blue-600/20',
glow: 'shadow-lg shadow-blue-600/40',
buttonGlow: 'hover:shadow-xl hover:hover:shadow-blue-500/50',
success: 'text-sky-400',
alert: 'text-red-400',
inputBg: 'bg-blue-950/30',
inputBorder: 'border-blue-900/15',
tabActive: 'bg-blue-800/20 border-blue-500 shadow-lg shadow-blue-600/20',
tabInactive: 'bg-transparent border-transparent',
cardBg: 'bg-blue-950/30 backdrop-blur-md',
cardBorder: 'border-blue-900/15',
qrPreviewBorder: 'border-blue-600/50',
qrPreviewBg: 'bg-gradient-to-br from-blue-950/30 to-blue-900/30 backdrop-blur-md',
headerGlow: 'animate-quantum-flux'
},
'warm-grey': {
bg: 'bg-gradient-to-br from-[#202020] via-[#404040] to-[#303030] animate-gradient-shift',
text: 'text-gray-100',
primaryAccent: 'from-gray-500 to-gray-700',
secondaryAccent: 'from-yellow-400 to-orange-500',
glassBg: 'bg-gray-700/40 backdrop-blur-3xl',
glassBorder: 'border-gray-600/20',
shadow: 'shadow-gray-500/20',
glow: 'shadow-lg shadow-gray-500/40',
buttonGlow: 'hover:shadow-xl hover:shadow-gray-400/50',
success: 'text-lime-400',
alert: 'text-red-400',
inputBg: 'bg-gray-800/30',
inputBorder: 'border-gray-700/15',
tabActive: 'bg-gray-600/20 border-gray-500 shadow-lg shadow-gray-500/20',
tabInactive: 'bg-transparent border-transparent',
cardBg: 'bg-gray-800/30 backdrop-blur-md',
cardBorder: 'border-gray-700/15',
qrPreviewBorder: 'border-gray-500/50',
qrPreviewBg: 'bg-gradient-to-br from-gray-800/30 to-gray-700/30 backdrop-blur-md',
headerGlow: 'animate-quantum-flux'
},
'deep-purple': {
bg: 'bg-gradient-to-br from-[#100830] via-[#201040] to-[#180C38] animate-gradient-shift',
text: 'text-white',
primaryAccent: 'from-purple-600 to-fuchsia-700',
secondaryAccent: 'from-pink-400 to-purple-500',
glassBg: 'bg-purple-900/40 backdrop-blur-3xl',
glassBorder: 'border-purple-800/20',
shadow: 'shadow-purple-600/20',
glow: 'shadow-lg shadow-purple-600/40',
buttonGlow: 'hover:shadow-xl hover:hover:shadow-purple-500/50',
success: 'text-lime-400',
alert: 'text-red-400',
inputBg: 'bg-purple-950/30',
inputBorder: 'border-purple-900/15',
tabActive: 'bg-purple-800/20 border-purple-500 shadow-lg shadow-purple-600/20',
tabInactive: 'bg-transparent border-transparent',
cardBg: 'bg-purple-950/30 backdrop-blur-md',
cardBorder: 'border-purple-900/15',
qrPreviewBorder: 'border-purple-600/50',
qrPreviewBg: 'bg-gradient-to-br from-purple-950/30 to-purple-900/30 backdrop-blur-md',
headerGlow: 'animate-quantum-flux'
},
'sunrise-orange': {
bg: 'bg-gradient-to-br from-[#A0300A] via-[#D0501A] to-[#B84012] animate-gradient-shift',
text: 'text-white',
primaryAccent: 'from-orange-600 to-red-700',
secondaryAccent: 'from-yellow-400 to-orange-500',
glassBg: 'bg-orange-800/40 backdrop-blur-3xl',
glassBorder: 'border-orange-700/20',
shadow: 'shadow-orange-600/20',
glow: 'shadow-lg shadow-orange-600/40',
buttonGlow: 'hover:shadow-xl hover:hover:shadow-orange-500/50',
success: 'text-lime-400',
alert: 'text-red-400',
inputBg: 'bg-orange-900/30',
inputBorder: 'border-orange-800/15',
tabActive: 'bg-orange-700/20 border-orange-500 shadow-lg shadow-orange-600/20',
tabInactive: 'bg-transparent border-transparent',
cardBg: 'bg-orange-900/30 backdrop-blur-md',
cardBorder: 'border-orange-800/15',
qrPreviewBorder: 'border-orange-600/50',
qrPreviewBg: 'bg-gradient-to-br from-orange-900/30 to-orange-800/30 backdrop-blur-md',
headerGlow: 'animate-quantum-flux'
},
};
const currentThemeClasses = themes[currentTheme];
// Function to show custom alert
const showAlert = (message) => {
setAlertMessage(message);
};
// Callback to generate QR code on a given canvas
// Added a new parameter `lightColorOverride` to explicitly set the light module color
const drawQrCode = useCallback((canvas, text, color, errorLevel, size = 256, lightColorOverride = null) => {
if (!canvas) {
console.warn("Canvas element is null, cannot draw QR code.");
return;
}
if (!QRCode) {
console.error("QRCode library is not loaded.");
const context = canvas.getContext('2d');
context.clearRect(0, 0, canvas.width, canvas.height);
context.fillStyle = 'red';
context.font = '10px Arial';
context.fillText('QR Lib Error', 10, 20);
return;
}
const context = canvas.getContext('2d');
context.clearRect(0, 0, canvas.width, canvas.height);
// Determine the light module color: white if QR color is black, otherwise black
const effectiveLightColor = lightColorOverride || (color === '#000000' ? '#FFFFFF' : '#000000');
if (text.trim() !== '') {
QRCode.toCanvas(canvas, text, {
errorCorrectionLevel: errorLevel,
width: size,
color: {
dark: color,
light: effectiveLightColor // Use the determined light color
}
}, function (error) {
if (error) console.error("QR Code drawing error:", error);
});
}
}, []);
// Function to download the generated QR code
const downloadQrCode = () => {
if (content.trim() === '') {
showAlert('Please enter content to generate QR code.');
return;
}
// Create a temporary canvas for high-resolution download
const tempCanvas = document.createElement('canvas');
tempCanvas.width = downloadResolution;
tempCanvas.height = downloadResolution;
// Determine the light module color for download: white if QR color is black, otherwise black
const effectiveLightColorForDownload = qrColor === '#000000' ? '#FFFFFF' : '#000000';
QRCode.toCanvas(tempCanvas, content, {
errorCorrectionLevel: errorLevel,
width: downloadResolution,
color: {
dark: qrColor,
light: effectiveLightColorForDownload // Use the determined light color for download
}
}, function (error) {
if (error) console.error("QR Code drawing error for download:", error);
const pngUrl = tempCanvas.toDataURL("image/png");
const downloadLink = document.createElement('a');
downloadLink.href = pngUrl;
downloadLink.download = `qrcode_${downloadResolution}x${downloadResolution}.png`;
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
showAlert(`QR Code saved as ${downloadResolution}x${downloadResolution} PNG!`);
});
};
// Function to decode QR code from an uploaded image
const decodeQrCode = (event) => {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = (e) => {
const img = new Image();
img.onload = () => {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
canvas.width = img.width;
canvas.height = img.height;
context.drawImage(img, 0, 0, img.width, img.height);
const imageData = context.getImageData(0, 0, canvas.width, canvas.height);
// Use jsqr (lowercase) here
if (jsqr) {
let code = jsqr(imageData.data, imageData.width, imageData.height);
if (!code) {
// Attempt to invert colors and try again
for (let i = 0; i < imageData.data.length; i += 4) {
imageData.data[i] = 255 - imageData.data[i];
imageData.data[i + 1] = 255 - imageData.data[i + 1];
imageData.data[i + 2] = 255 - imageData.data[i + 2];
}
code = jsqr(imageData.data, imageData.width, imageData.height);
}
if (code) {
setDecodedContent(code.data);
setSuggestedIdea(''); // Clear previous suggestions when new QR is decoded
setShowSuggestedIdea(false);
} else {
setDecodedContent('No QR code detected.');
setSuggestedIdea('');
setShowSuggestedIdea(false);
}
} else {
showAlert('QR decoder library (jsqr) not loaded. Please try again or check internet connection.');
setSuggestedIdea('');
setShowSuggestedIdea(false);
}
};
img.src = e.target.result;
};
reader.readAsDataURL(file);
};
// Function to summarize content using Gemini API
const summarizeContent = async () => {
if (!decodedContent.trim() || decodedContent === 'No QR code detected.') {
showAlert('Please decode a QR code first to summarize its content.');
return;
}
setIsSummarizing(true);
try {
let chatHistory = [];
// Prompt to handle various content types for summarization
const prompt = `Summarize the following text concisely. If the text appears to be in XML, JSON, or another large structured format, extract the key information and present it as plain text. If it's a very long plain text, provide a brief summary. Text to summarize: "${decodedContent}"`;
chatHistory.push({ role: "user", parts: [{ text: prompt }] });
const payload = { contents: chatHistory };
const apiKey = ""; // Canvas will provide this at runtime
const apiUrl = `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=${apiKey}`;
const response = await fetch(apiUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
});
const result = await response.json();
if (result.candidates && result.candidates.length > 0 &&
result.candidates[0].content && result.candidates[0].content.parts &&
result.candidates[0].content.parts.length > 0) {
const text = result.candidates[0].content.parts[0].text;
setContent(text); // Update the generator's input field with summarized content
showAlert('Content summarized and moved to QR Generator tab!');
} else {
showAlert("Failed to summarize content. Please try again.");
}
} catch (error) {
console.error("Error summarizing content:", error);
showAlert("An error occurred while summarizing content.");
} finally {
setIsSummarizing(false);
}
};
// Function to suggest ideas for QR code generation from the local array
const suggestIdeas = () => {
if (allSuggestedIdeas.length > 0) {
const randomIndex = Math.floor(Math.random() * allSuggestedIdeas.length);
const randomIdea = allSuggestedIdeas[randomIndex];
setSuggestedIdea(randomIdea); // Display the randomly selected idea
setContent(randomIdea); // Set the QR content to the suggested idea
setShowSuggestedIdea(true); // Ensure the ideas panel is shown
} else {
// This case should ideally not be hit if allSuggestedIdeas is hardcoded
setSuggestedIdea("No ideas available in the local list.");
setShowSuggestedIdea(true);
}
};
return (
// Modified: min-h-screen to allow page to grow, flex-col for vertical layout
{/* Container for header, tabs, and tab content */}
QuantumQR Studio
{/* Tabs Navigation */}
{/* Tab Content - Added flex-grow to fill remaining space */}
{activeTab === 'generator' && (
)}
{activeTab === 'decoder' && (
)}
{activeTab === 'settings' && (
)}
{/* Added padding to the bottom of the container to ensure space below content */}
{/* Custom Alert Modal */}
setAlertMessage(null)} />
{/* Font Awesome for Icons */}
{/* Google Fonts - Inter & Orbitron */}
{/* Tailwind CSS CDN - Ensure this is loaded */}
{/* Custom Scrollbar Styles */}
);
};
export default App;