[ "https://images.unsplash.com/photo-1503676260728-1c00da094a0b?auto=format&fit=crop&w=800&q=80", "https://images.unsplash.com/photo-1427504494785-3a9ca7044f45?auto=format&fit=crop&w=800&q=80", "https://images.unsplash.com/photo-1488521787991-ed7bbaae773c?auto=format&fit=crop&w=800&q=80" ], 'ration' => [ "https://images.unsplash.com/photo-1593113515093-61ba4f7f4577?auto=format&fit=crop&w=800&q=80", "https://images.unsplash.com/photo-1532629345422-7515f3d16bb6?auto=format&fit=crop&w=800&q=80", "https://images.unsplash.com/photo-1618666012174-83b441c0bc76?auto=format&fit=crop&w=800&q=80" ], 'medical' => [ "https://images.unsplash.com/photo-1576091160550-2173dba999ef?auto=format&fit=crop&w=800&q=80", "https://images.unsplash.com/photo-1584515933487-779824d29309?auto=format&fit=crop&w=800&q=80" ], 'animals' => [ "https://images.unsplash.com/photo-1548842188-f5424dfc0df8?auto=format&fit=crop&w=800&q=80", "https://images.unsplash.com/photo-1599839619722-39751411ea63?auto=format&fit=crop&w=800&q=80" ], 'generic' => [ "https://images.unsplash.com/photo-1469571486292-0ba58a3f068b?auto=format&fit=crop&w=800&q=80", "https://images.unsplash.com/photo-1559027615-cd4628902d4a?auto=format&fit=crop&w=800&q=80", "https://images.unsplash.com/photo-1594708767771-a7502209ff51?auto=format&fit=crop&w=800&q=80" ] ]; // Premium Themes $themes = [ ['id' => 'maroon-gold', 'bg' => 'bg-gradient-to-br from-red-950 via-rose-900 to-[#4A0E17]', 'border' => 'border-yellow-500/30', 'accent' => 'text-yellow-400', 'isLight' => false], ['id' => 'divine-orange', 'bg' => 'bg-gradient-to-tr from-[#2b0303] via-red-800 to-orange-600', 'border' => 'border-orange-400/40', 'accent' => 'text-orange-300', 'isLight' => false], ['id' => 'royal-purple', 'bg' => 'bg-gradient-to-bl from-purple-950 via-fuchsia-900 to-rose-950', 'border' => 'border-pink-500/30', 'accent' => 'text-pink-300', 'isLight' => false], ['id' => 'hope-emerald', 'bg' => 'bg-gradient-to-br from-emerald-950 via-teal-900 to-[#022c22]', 'border' => 'border-emerald-400/30', 'accent' => 'text-emerald-300', 'isLight' => false], ['id' => 'classic-india', 'bg' => 'bg-gradient-to-b from-orange-100 via-white to-orange-50', 'border' => 'border-red-600/40', 'accent' => 'text-red-700', 'isLight' => true], ['id' => 'luxury-dark', 'bg' => 'bg-[#0a0a0a]', 'border' => 'border-yellow-600/50', 'accent' => 'text-yellow-500', 'isLight' => false] ]; // Helper to analyze text and pick a category function analyzeCategory($text) { $lower = mb_strtolower($text, 'UTF-8'); if (strpos($lower, 'बच्च') !== false || strpos($lower, 'education') !== false || strpos($lower, 'शिक्षा') !== false || strpos($lower, 'book') !== false) return 'education'; if (strpos($lower, 'राशन') !== false || strpos($lower, 'भोजन') !== false || strpos($lower, 'food') !== false || strpos($lower, 'kit') !== false || strpos($lower, 'महिला') !== false) return 'ration'; if (strpos($lower, 'health') !== false || strpos($lower, 'medical') !== false || strpos($lower, 'चिकित्सा') !== false || strpos($lower, 'camp') !== false) return 'medical'; if (strpos($lower, 'गौ') !== false || strpos($lower, 'जीव') !== false || strpos($lower, 'animal') !== false || strpos($lower, 'cow') !== false) return 'animals'; return 'generic'; } function getRandomImage($arr) { return $arr[array_rand($arr)]; } // Inline SVG Icon Helper (Lucide equivalents) function getIcon($name, $classes = '') { $svgs = [ 'heart' => '', 'sparkles' => '', 'phone' => '', 'globe' => '', 'users' => '', 'book' => '', 'package' => '', 'bird' => '', 'stethoscope' => '', 'info' => '', 'qrcode' => '', 'layout' => '', 'image' => '', 'download' => '', 'zap' => '', 'trash2' => '', 'plus' => '' ]; return isset($svgs[$name]) ? $svgs[$name] : ''; } function getCategoryIcon($category) { switch($category) { case 'education': return getIcon('book', 'text-blue-500 w-full h-full'); case 'ration': return getIcon('package', 'text-orange-500 w-full h-full'); case 'medical': return getIcon('stethoscope', 'text-red-500 w-full h-full'); case 'animals': return getIcon('bird', 'text-green-500 w-full h-full'); default: return getIcon('heart', 'text-pink-500 w-full h-full'); } } // Initial Form State $formData = [ 'ngoName' => "Shree Kutch Mahila Vikas", 'headline' => "सेवा ही सर्वोत्तम धर्म", 'mobile' => "+91 9173516693", 'upi' => "pdp.apexautolink-2@oksbi", 'tagline' => "एक कदम सेवा की ओर", 'trustMessage' => "आपका छोटा सा सहयोग किसी की जिंदगी बदल सकता है", 'website' => "www.example.org", 'services' => [ "गरीब बच्चों को बैग व नोटबुक", "महिलाओं को राशन किट", "Health and Medical Camp", "गौ सेवा व जीवदया कार्य" ] ]; // Process POST request if ($_SERVER['REQUEST_METHOD'] === 'POST') { $formData['ngoName'] = $_POST['ngoName'] ?? ''; $formData['headline'] = $_POST['headline'] ?? ''; $formData['mobile'] = $_POST['mobile'] ?? ''; $formData['upi'] = $_POST['upi'] ?? ''; $formData['tagline'] = $_POST['tagline'] ?? ''; $formData['trustMessage'] = $_POST['trustMessage'] ?? ''; $formData['website'] = $_POST['website'] ?? ''; $formData['services'] = $_POST['services'] ?? []; // Filter empty services $formData['services'] = array_filter($formData['services'], function($v) { return trim($v) !== ''; }); if(count($formData['services']) > 5) { $formData['services'] = array_slice($formData['services'], 0, 5); } } // Generate Posters Configuration $posters = []; $numVariations = 6; $timestamp = time(); for ($i = 0; $i < $numVariations; $i++) { $layout = $i % 6; // Determine Theme if ($layout === 3) { $theme = $themes[4]; // 'classic-india' } else if ($layout === 4) { $theme = $themes[5]; // 'luxury-dark' } else { $theme = $themes[$i % (count($themes) - 2)]; } // AI Simulation: Resolve images based on text $generatedImages = []; foreach ($formData['services'] as $service) { $category = analyzeCategory($service); $generatedImages[] = getRandomImage($imagePools[$category]); } // Extra hero image $generatedImages['hero'] = getRandomImage($imagePools['generic']); $posters[] = [ 'id' => "var-{$timestamp}-{$i}", 'theme' => $theme, 'layout' => $layout, 'generatedImages' => $generatedImages ]; } // The core render engine for individual posters function renderPosterTemplate($data, $config) { $theme = $config['theme']; $layout = $config['layout']; $generatedImages = $config['generatedImages']; $textColor = $theme['isLight'] ? 'text-gray-900' : 'text-white'; $subTextColor = $theme['isLight'] ? 'text-gray-700' : 'text-gray-200'; $isLight = $theme['isLight']; // Component Render Functions $renderHeader = function($customClass = "") use ($data, $isLight, $textColor) { $badgeClass = $isLight ? 'border-red-500 bg-red-50 text-red-700' : 'glass-panel border-yellow-500/50 text-yellow-300'; $headlineClass = $isLight ? 'text-red-700 drop-shadow-md' : 'text-transparent bg-clip-text bg-gradient-to-b from-white via-yellow-100 to-yellow-500 drop-shadow-[0_5px_15px_rgba(0,0,0,0.8)]'; $lineClass1 = $isLight ? 'bg-red-300' : 'bg-gradient-to-r from-transparent to-white/50'; $lineClass2 = $isLight ? 'bg-red-300' : 'bg-gradient-to-l from-transparent to-white/50'; $sparkleIcon = getIcon('sparkles', 'w-4 h-4 mr-2'); return "
" . htmlspecialchars($data['upi']) . "
\"मानव सेवा ही माधव सेवा है\"
AI Poster Portal - PHP Version
Including Traditional Indian & Modern UI styles (1080x1920 HD)