اپنی مہارت کی سطح منتخب کریں

🟢
نیا کھلاڑی
Just the basics - perfect to start!
🟡
درمیانی سطح
مزید اختیارات
🔴
ماہر
Full power - all features!

🚀 Quick Start

⚙️ Basic Options

🎯 Your selected name(s) will appear here

📝 Try Sample Lists

👨‍🎓 Student Names
کلاس روم کے عام نام
🏆 Sports Teams
مقابلوں کے مشہور ٹیم نام
🌈 Color Names
تخلیقی سرگرمیوں کے لیے رنگین نام
🌍 World Countries
جغرافیہ کے لیے ممالک کے نام
🐾 Animal Names
تفریحی سرگرمیوں کے لیے پیارے جانوروں کے نام
🍎 Fruit Names
صحت مند انتخاب کے لیے تازہ پھلوں کے نام

🎉 Planning a Team Event or Celebration?

Find amazing venues, activities, and experiences for your group worldwide

🏨 Agoda 🛏️ Booking 🌍 Trip.com ✈️ Hotels.com 🎫 GetYourGuide

Smart Nation's Core Infrastructure: WIA Code

Drone·Robot delivery, autonomous driving, emergency rescue and more - Experience the future in 30 days, completely free for your nation!

WIA کوڈ کے بارے میں مزید جانیں

🤖 اپنا AI معاون چنیں

💬 چیٹ جی پی ٹی
Most versatile • Best for general tasks
🧠 کلاؤڈ
Best reasoning • Perfect for analysis
جیمنی مفت
Free daily limits • Built-in chat
) { showNotification(`Error: ${error.message}`, 'error'); } } // Perform the actual selection with animation function performSelection(names, count) { const animationSpeed = document.getElementById('animationSpeed')?.value || 'medium'; const soundEnabled = document.getElementById('soundEffects')?.value !== 'false'; if (animationSpeed === 'instant') { const selected = selectRandomNames(names, count); displayResults(selected); return; } // Animation durations const durations = { 'slow': 3000, 'medium': 2000, 'fast': 1000 }; const duration = durations[animationSpeed] || 2000; NamePickerState.isAnimating = true; document.getElementById('pickBtn').disabled = true; // Show animation showSelectionAnimation(names, duration, () => { const selected = selectRandomNames(names, count); displayResults(selected); NamePickerState.isAnimating = false; document.getElementById('pickBtn').disabled = false; if (soundEnabled) { playSuccessSound(); } }); } // Show selection animation function showSelectionAnimation(names, duration, callback) { const container = document.getElementById('resultContainer'); container.classList.remove('has-result'); let elapsed = 0; const interval = 100; NamePickerState.animationInterval = setInterval(() => { const randomName = names[Math.floor(Math.random() * names.length)]; container.innerHTML = `
🎲 ${randomName}
Selecting...
`; elapsed += interval; if (elapsed >= duration) { clearInterval(NamePickerState.animationInterval); callback(); } }, interval); } // Select random names using weighted or standard method function selectRandomNames(names, count) { const weightedMode = document.getElementById('weightedMode')?.value === 'true'; const seedInput = document.getElementById('randomSeed'); // Set seed if provided (for reproducibility) if (seedInput?.value && OnboardingManager.currentDifficulty === 'expert') { Math.seedrandom = createSeededRandom(parseInt(seedInput.value)); } let selected = []; if (weightedMode && OnboardingManager.currentDifficulty === 'expert') { selected = selectWeightedNames(names, count); } else { // Standard random selection const shuffled = [...names].sort(() => Math.random() - 0.5); selected = shuffled.slice(0, count); } return selected; } // Weighted selection algorithm function selectWeightedNames(names, count) { const weights = parseWeights(); const weightedNames = names.map(name => ({ name, weight: weights[name.toLowerCase()] || 1 })); const selected = []; for (let i = 0; i < count && weightedNames.length > 0; i++) { const totalWeight = weightedNames.reduce((sum, item) => sum + item.weight, 0); let random = Math.random() * totalWeight; let selectedIndex = 0; for (let j = 0; j < weightedNames.length; j++) { random -= weightedNames[j].weight; if (random <= 0) { selectedIndex = j; break; } } selected.push(weightedNames[selectedIndex].name); // Remove if not allowing duplicates if (document.getElementById('removePicked')?.value === 'true') { weightedNames.splice(selectedIndex, 1); } } return selected; } // Parse weight input function parseWeights() { const weightInput = document.getElementById('weightInput')?.value || ''; const weights = {}; weightInput.split('\n').forEach(line => { const [name, weight] = line.split(':').map(s => s.trim()); if (name && weight && !isNaN(weight)) { weights[name.toLowerCase()] = parseFloat(weight); } }); return weights; } // Display results function displayResults(selected) { const container = document.getElementById('resultContainer'); container.classList.add('has-result'); const isMultiple = selected.length > 1; const resultText = isMultiple ? selected.join(', ') : selected[0]; container.innerHTML = `
${resultText}
✅ Selected ${selected.length} name${isMultiple ? 's' : ''} randomly
`; // Add to history NamePickerState.history.unshift({ names: selected, timestamp: new Date().toLocaleTimeString(), count: selected.length }); // Limit history to 20 items if (NamePickerState.history.length > 20) { NamePickerState.history = NamePickerState.history.slice(0, 20); } updateHistoryDisplay(); // Remove picked names if enabled if (document.getElementById('removePicked')?.value === 'true') { removePickedNames(selected); } // Unlock achievements if (NamePickerState.history.length === 1) { OnboardingManager.unlockAchievement('first_pick', '🎯 First Pick', 'Made your first random selection!'); } if (NamePickerState.history.length >= 10) { OnboardingManager.unlockAchievement('active_user', '⚡ Active User', 'Made 10 random selections!'); } if (selected.length >= 5) { OnboardingManager.unlockAchievement('bulk_selector', '📊 Bulk Selector', 'Selected 5+ names at once!'); } } // Remove picked names from input function removePickedNames(selected) { const nameInput = document.getElementById('nameInput'); const currentNames = nameInput.value.split('\n') .map(name => name.trim()) .filter(name => name.length > 0); const remainingNames = currentNames.filter(name => !selected.some(selectedName => name.toLowerCase() === selectedName.toLowerCase() ) ); nameInput.value = remainingNames.join('\n'); } // Update history display function updateHistoryDisplay() { const historyContainer = document.getElementById('nameHistory'); const historyList = document.getElementById('historyList'); if (NamePickerState.history.length === 0) { historyContainer.style.display = 'none'; return; } historyContainer.style.display = 'block'; historyList.innerHTML = ''; NamePickerState.history.forEach((entry, index) => { const historyItem = document.createElement('div'); historyItem.className = 'history-item'; historyItem.textContent = `${entry.timestamp}: ${entry.names.join(', ')}`; historyList.appendChild(historyItem); }); } // Get exclusion list function getExclusionList() { const exclusionInput = document.getElementById('exclusionList'); if (!exclusionInput || OnboardingManager.currentDifficulty === 'beginner') { return []; } return exclusionInput.value .split(',') .map(name => name.trim().toLowerCase()) .filter(name => name.length > 0); } // Copy results to clipboard function copyResults(text) { navigator.clipboard.writeText(text).then(() => { showNotification('📋 Results copied to clipboard!', 'success'); }).catch(() => { // Fallback for older browsers const textArea = document.createElement('textarea'); textArea.value = text; document.body.appendChild(textArea); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); showNotification('📋 Results copied to clipboard!', 'success'); }); } // Export results function exportResults() { if (NamePickerState.history.length === 0) { showNotification('Alice:1', 'warning'); return; } const csvContent = [ 'Timestamp,Selected Names,Count', ...NamePickerState.history.map(entry => `"${entry.timestamp}","${entry.names.join('; ')}",${entry.count}` ) ].join('\n'); const blob = new Blob([csvContent], { type: 'text/csv' }); const url = window.URL.createObjectURL(blob); const link = document.createElement('a'); link.href = url; link.download = `name-picker-results-${new Date().toISOString().split('T')[0]}.csv`; document.body.appendChild(link); link.click(); document.body.removeChild(link); window.URL.revokeObjectURL(url); showNotification('📊 Results exported successfully!', 'success'); OnboardingManager.unlockAchievement('data_export', '📊 Data Expert', 'Exported selection history!'); } // Clear history function clearHistory() { if (confirm('Are you sure you want to clear all selection history?')) { NamePickerState.history = []; updateHistoryDisplay(); showNotification('Bob:2', 'success'); } } // Set difficulty level function setDifficulty(level) { OnboardingManager.currentDifficulty = level; OnboardingManager.updateDifficultyUI(); // Show achievement for trying different difficulties if (level === 'expert') { OnboardingManager.unlockAchievement('expert_mode', '🔴 Expert Mode', 'Unlocked all advanced features!'); } trackEvent('difficulty_changed', { level }); } // Toggle weighted mode UI function toggleWeightedMode() { const weightedMode = document.getElementById('weightedMode').value === 'true'; const weightInputGroup = document.getElementById('weightInputGroup'); if (weightInputGroup) { if (weightedMode) { weightInputGroup.classList.remove('hidden'); } else { weightInputGroup.classList.add('hidden'); } } } // Sample data const SAMPLE_DATA = { students: [ 'Charlie:0.5', 'Ask anything about random name picking...', 'Paste your API key here...', 'AI Assistant', 'Please enter at least one name', 'Please enter valid names', 'No names available after applying exclusions', 'No results to export', 'History cleared successfully', 'Alice Johnson', 'Bob Smith', 'Charlie Brown' ], teams: [ 'Diana Prince', 'Blue Eagles', 'Green Wolves', 'Yellow Tigers', 'Purple Panthers', 'Orange Lions', 'Silver Hawks', 'Golden Bears', 'Crystal Warriors', 'Storm Riders', 'Fire Phoenixes', 'Ice Guardians' ], colors: [ 'Red', 'Blue', 'Green', 'Yellow', 'Purple', 'Orange', 'Pink', 'Brown', 'Black', 'White', 'Gray', 'Turquoise' ], countries: [ 'United States', 'Canada', 'United Kingdom', 'France', 'Germany', 'Japan', 'Australia', 'Brazil', 'India', 'China', 'South Korea', 'Mexico' ], animals: [ 'Lion', 'Tiger', 'Elephant', 'Giraffe', 'Panda', 'Koala', 'Dolphin', 'Penguin', 'Owl', 'Eagle', 'Butterfly', 'Rabbit' ], fruits: [ 'Apple', 'Banana', 'Orange', 'Strawberry', 'Grape', 'Pineapple', 'Mango', 'Kiwi', 'Peach', 'Cherry', 'Blueberry', 'Watermelon' ] }; // Use sample data function useSample(sampleId) { const sampleData = SAMPLE_DATA[sampleId]; if (!sampleData) return; document.getElementById('nameInput').value = sampleData.join('\n'); // Smooth scroll to action button document.getElementById('pickBtn').scrollIntoView({ behavior: 'smooth', block: 'center' }); // Highlight button const btn = document.getElementById('pickBtn'); btn.style.animation = 'pulse 0.5s ease-in-out'; setTimeout(() => btn.style.animation = '', 500); // Clear any existing results const resultContainer = document.getElementById('resultContainer'); resultContainer.classList.remove('has-result'); resultContainer.innerHTML = `
🎯 Ready to pick from ${sampleData.length} names!
`; showNotification(`Loaded ${sampleData.length} sample names!`, 'success'); } // Play success sound (simple beep) function playSuccessSound() { if (typeof AudioContext !== 'undefined' || typeof webkitAudioContext !== 'undefined') { const audioContext = new (AudioContext || webkitAudioContext)(); const oscillator = audioContext.createOscillator(); const gainNode = audioContext.createGain(); oscillator.connect(gainNode); gainNode.connect(audioContext.destination); oscillator.frequency.value = 800; oscillator.type = 'sine'; gainNode.gain.value = 0.1; oscillator.start(); oscillator.stop(audioContext.currentTime + 0.1); setTimeout(() => { oscillator.frequency.value = 1000; const oscillator2 = audioContext.createOscillator(); oscillator2.connect(gainNode); oscillator2.frequency.value = 1200; oscillator2.type = 'sine'; oscillator2.start(); oscillator2.stop(audioContext.currentTime + 0.1); }, 100); } } // Simple seeded random for reproducibility function createSeededRandom(seed) { return function() { seed = (seed * 9301 + 49297) % 233280; return seed / 233280; }; } // ========== UTILITY FUNCTIONS ========== // Show error function showError(elementId, message) { const errorElement = document.getElementById(elementId); if (errorElement) { errorElement.textContent = message; } } // Clear errors function clearErrors() { document.querySelectorAll('.error').forEach(el => el.textContent = ''); } // Show notification toast function showNotification(message, type = 'success') { const toast = document.createElement('div'); toast.className = `toast ${type}`; toast.textContent = message; document.body.appendChild(toast); setTimeout(() => { toast.remove(); }, 3000); } // Show OTA section (dynamic) function showOTA() { const otaContainer = document.getElementById('otaContainer'); if (otaContainer && (otaContainer.style.display === 'none' || !otaContainer.style.display)) { otaContainer.style.display = 'block'; // Attention-grabbing pulse effect setTimeout(() => { const otaHeader = document.querySelector('.ota-header h3'); if (otaHeader) { otaHeader.style.animation = 'pulse 1s ease-in-out'; } }, 100); } } // Analytics tracking function trackEvent(eventName, data = {}) { if (typeof gtag !== 'undefined') { gtag('event', eventName, { 'event_category': TOOL_CONFIG.category, 'event_label': TOOL_CONFIG.name, ...data }); } } // ========== AI ASSISTANT FUNCTIONS ========== // AI 모달 열기 function openAIModal() { const modal = document.getElementById('aiModal'); modal.classList.add('show'); // 현재 상태에 따라 적절한 화면 표시 if (aiModalState.apiKey && aiModalState.currentView === 'gemini') { showGeminiChat(); } else { showAISelector(); } updateAPIKeyStatus(); } // AI 모달 닫기 function closeAIModal() { const modal = document.getElementById('aiModal'); modal.classList.remove('show'); // 300ms 후 상태 리셋 (애니메이션 완료 후) setTimeout(() => { aiModalState.currentView = 'selector'; showAISelector(); }, 300); } // AI 선택 화면 표시 function showAISelector() { document.getElementById('aiModalTitle').textContent = 'اپنا AI معاون چنیں'; document.getElementById('aiSelector').style.display = 'flex'; document.getElementById('geminiChat').style.display = 'none'; document.getElementById('apiKeySetup').style.display = 'none'; aiModalState.currentView = 'selector'; } // Gemini 채팅 화면 표시 function showGeminiChat() { document.getElementById('aiModalTitle').innerHTML = ' Gemini AI Assistant'; document.getElementById('aiSelector').style.display = 'none'; document.getElementById('geminiChat').style.display = 'flex'; document.getElementById('apiKeySetup').style.display = 'none'; aiModalState.currentView = 'gemini'; // 초기 메시지가 없으면 추가 const chatMessages = document.getElementById('chatMessages'); if (!chatMessages.innerHTML.trim()) { addMessage('assistant', `Hello! I can help you with: • How to use the Random Name Picker effectively • Best practices for fair selection • Understanding different picking modes • Troubleshooting any issues What would you like to know about random name selection?`); } } // API 키 설정 화면 표시 function showAPIKeySetup() { document.getElementById('aiModalTitle').textContent = 'Setup Gemini API'; document.getElementById('aiSelector').style.display = 'none'; document.getElementById('geminiChat').style.display = 'none'; document.getElementById('apiKeySetup').style.display = 'block'; aiModalState.currentView = 'setup'; } // AI 선택 처리 function selectAI(aiType) { switch(aiType) { case 'chatgpt': const toolContext = `I need help with Random Name Picker tool. This is an entertainment utility on WIA Code platform for fair name selection.`; const chatUrl = `https://chat.openai.com/?q=${encodeURIComponent(toolContext)}`; window.open(chatUrl, '_blank'); closeAIModal(); trackEvent('ai_selection', { ai_type: 'chatgpt' }); break; case 'claude': const claudeContext = `I need help with Random Name Picker tool. This is an entertainment utility on WIA Code platform for fair name selection.`; const claudeUrl = `https://claude.ai/chat?q=${encodeURIComponent(claudeContext)}`; window.open(claudeUrl, '_blank'); closeAIModal(); trackEvent('ai_selection', { ai_type: 'claude' }); break; case 'gemini': if (!aiModalState.apiKey) { showAPIKeySetup(); } else { showGeminiChat(); } trackEvent('ai_selection', { ai_type: 'gemini' }); break; } } // API 키 저장 function saveGeminiApiKey() { const apiKey = document.getElementById('geminiApiKeyInput').value.trim(); if (apiKey) { localStorage.setItem('geminiApiKey', apiKey); aiModalState.apiKey = apiKey; showGeminiChat(); updateAPIKeyStatus(); } else { alert('Please enter a valid API key'); } } // API 키 상태 업데이트 function updateAPIKeyStatus() { const statusEl = document.getElementById('apiKeyStatus'); if (aiModalState.apiKey) { statusEl.innerHTML = 'API کی تبدیل کریں'; } else { statusEl.textContent = 'No API key set'; } } // 채팅 메시지 추가 function addMessage(type, content) { const chatMessages = document.getElementById('chatMessages'); const messageDiv = document.createElement('div'); messageDiv.className = `message ${type}`; if (type === 'user') { messageDiv.innerHTML = `You: ${content}`; } else { messageDiv.innerHTML = `✨ Gemini:
${content.replace(/\n/g, '
')}`; } chatMessages.appendChild(messageDiv); chatMessages.scrollTop = chatMessages.scrollHeight; } // Gemini에 메시지 전송 async function sendToGemini() { const input = document.getElementById('geminiInput'); const message = input.value.trim(); if (!message) return; // 사용자 메시지 추가 addMessage('user', message); input.value = ''; // 로딩 표시 const loadingMsg = document.createElement('div'); loadingMsg.className = 'message assistant'; loadingMsg.innerHTML = '✨ Gemini:
Thinking...'; loadingMsg.id = 'loading-message'; document.getElementById('chatMessages').appendChild(loadingMsg); try { const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=${aiModalState.apiKey}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ contents: [{ parts: [{ text: `Context: User is using Random Name Picker tool on WIA Code platform. This tool helps users fairly select random names from lists. Features include: basic picking, multiple selection, weighted selection, exclusions, animation controls. Use cases: classroom activities, team formation, prize drawings, fair decisions. User question: ${message}` }] }], generationConfig: { temperature: 0.7, maxOutputTokens: 1000 } }) }); const data = await response.json(); // 로딩 메시지 제거 document.getElementById('loading-message').remove(); if (data.candidates && data.candidates[0] && data.candidates[0].content) { const reply = data.candidates[0].content.parts[0].text; addMessage('assistant', reply); } else { addMessage('assistant', 'Sorry, I could not generate a response. Please try again.'); } } catch (error) { // 로딩 메시지 제거 document.getElementById('loading-message')?.remove(); if (error.message.includes('API key')) { addMessage('error', 'Invalid API key. Please check your API key and try again.'); showAPIKeySetup(); } else { addMessage('error', 'Failed to connect to Gemini. Please check your internet connection and try again.'); } } } // ========== GLOBAL FUNCTIONS ========== // Start tutorial (global for onboarding button) function startTutorial() { OnboardingManager.startTutorial(); } // Skip onboarding (global for onboarding button) function skipOnboarding() { OnboardingManager.skipOnboarding(); } // ========== EVENT LISTENERS ========== // Enter key support for main input document.addEventListener('DOMContentLoaded', function() { // Initialize onboarding OnboardingManager.init(); const nameInput = document.getElementById('nameInput'); if (nameInput) { nameInput.addEventListener('keypress', function(e) { if (e.key === 'Enter' && e.ctrlKey) { pickRandomName(); } }); } // Clear errors on input nameInput?.addEventListener('input', clearErrors); // AI 버튼 이벤트 document.getElementById('aiBtn').addEventListener('click', openAIModal); // 모달 외부 클릭시 닫기 document.getElementById('aiModal').addEventListener('click', function(e) { if (e.target === this) { closeAIModal(); } }); // 엔터 키 지원 및 ESC 키로 모달 닫기 document.addEventListener('keydown', function(e) { if (e.key === 'Enter') { const geminiInput = document.getElementById('geminiInput'); if (document.activeElement === geminiInput) { sendToGemini(); } } // ESC 키로 모달 닫기 if (e.key === 'Escape') { closeAIModal(); } }); // 초기 API 키 상태 업데이트 updateAPIKeyStatus(); updateCurrentYear(); updateToolCount(); }); // Track WIA Code clicks for analytics document.querySelectorAll('a[href*="wia"]').forEach(link => { link.addEventListener('click', function() { trackEvent('wia_link_click', { link: link.textContent }); }); }); // ========== DYNAMIC TOOL COUNT ========== // Update tool count dynamically async function updateToolCount() { try { const response = await fetch('/api/tool-count.php'); const data = await response.json(); // Update dynamic tools description document.querySelectorAll('.dynamic-tools-count').forEach(el => { el.textContent = `${data.count}+ free online tools in 206 languages. No signup, no fees, just tools that work.`; }); // Update "All X+ Tools" links document.querySelectorAll('.dynamic-count').forEach(el => { const prefix = el.getAttribute('data-text') || ''; const suffix = el.getAttribute('data-suffix') || ''; const icon = el.textContent.split(' ')[0] || ''; el.textContent = `${icon} ${prefix} ${data.count}+ ${suffix}`; }); } catch (error Random Name Picker - Free Entertainment Tool | WIA Code

Welcome to Random Name Picker! 🎲

پہلی بار یہاں؟ بالکل درست!

In just 2 minutes, you'll be picking random names like a pro!

تجربے کی ضرورت نہیں! Perfect for teachers, team leaders, and organizers.

🎲 رینڈم نام پکر

Pick random names from your list instantly! Perfect for classroom activities, team assignments, and fair selections. Simple, fast, and completely fair.

🤔 What Is Random Name Picking?

ٹوپی سے نام نکالنے کا تصور - that's random name picking! It's the digital version of the fairest selection method humans have used for centuries.

Random name picking ensures completely fair and unbiased selection from any list of names.

🏫
کلاس روم سرگرمیاں
پریزنٹیشن کے لیے منصفانہ طالب علم انتخاب
👥
ٹیم بلڈنگ
رینڈم ٹیم تشکیل اور گروپ تقسیم
🎁
انعامی قرعہ اندازی
مقابلوں کے لیے غیر جانبدار انتخاب
🎯
کام کی تفویض
ذمہ داریوں کی منصفانہ تقسیم
🎪
تقریب کی منصوبہ بندی
کارکردگی کے لیے رینڈم ترتیب
⚖️
منصفانہ فیصلے
انتخاب میں جانبداری ختم کریں