اختر مستوى خبرتك

🟢
مبتدئ
الأساسيات فقط - مثالي للبداية!
🟡
متوسط
المزيد من التحكم والخيارات
🔴
خبير
قوة كاملة - جميع الميزات!

🚀 Quick Start

⚙️ Basic Options

🎯 ستظهر الأسماء المختارة هنا

📝 Try Sample Lists

👨‍🎓 أسماء الطلاب
أسماء شائعة في الفصل للتوضيح
🏆 الفرق الرياضية
أسماء الفرق الشهيرة للمسابقات
🌈 أسماء الألوان
ألوان قوس قزح للأنشطة الإبداعية
🌍 دول العالم
أسماء البلدان الشائعة للجغرافيا
🐾 أسماء الحيوانات
أسماء حيوانات لطيفة للأنشطة الممتعة
🍎 أسماء الفواكه
أسماء الفواكه الطازجة للخيارات الصحية

🎉 تخطط لحدث فريق أو احتفال؟

اعثر على أماكن وأنشطة وتجارب رائعة لمجموعتك حول العالم

🏨 أجودا 🛏️ بوكينج 🌍 تريب.كوم ✈️ هوتيلز.كوم 🎫 احجز جولتك

Smart Nation's Core Infrastructure: WIA Code

توصيل بالدرون والروبوت، قيادة ذاتية، إنقاذ طوارئ والمزيد - اختبر المستقبل خلال 30 يوماً، مجاناً تماماً لبلدك!

تعرف أكثر عن WIA Code

🤖 اختر مساعدك الذكي

💬 شات جي بي تي
الأكثر تنوعاً • الأفضل للمهام العامة
🧠 كلود
أفضل تحليل • مثالي للتحليل المعمق
جيميناي مجاني
حدود يومية مجانية • محادثة مدمجة
) { 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}
جاري الاختيار...
`; 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.length} اسم${isMultiple ? 'اء' : ''} عشوائياً
`; // 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('أليس: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('بوب: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: [ 'تشارلي:0.5', 'اسأل أي شيء عن اختيار الأسماء العشوائي...', 'ضع مفتاح API الخاص بك هنا...', 'المساعد الذكي', 'الرجاء إدخال اسم واحد على الأقل', 'الرجاء إدخال أسماء صحيحة', 'لا توجد أسماء متاحة بعد تطبيق الاستثناءات', 'لا توجد نتائج للتصدير', 'تم مسح السجل بنجاح', 'أليس جونسون', 'بوب سميث', 'تشارلي براون' ], teams: [ 'ديانا برنس', 'النسور الزرقاء', 'الذئاب الخضراء', 'النمور الصفراء', 'الفهود الأرجوانية', 'الأسود البرتقالية', 'الصقور الفضية', 'الدببة الذهبية', 'محاربو الكريستال', 'راكبو العواصف', 'طيور الفينيق النارية', 'حراس الجليد' ], colors: [ 'أحمر', 'أزرق', 'أخضر', 'أصفر', 'أرجواني', 'برتقالي', 'وردي', 'بني', 'أسود', 'أبيض', 'رمادي', 'فيروزي' ], countries: [ 'الولايات المتحدة', 'كندا', 'المملكة المتحدة', 'فرنسا', 'ألمانيا', 'اليابان', 'أستراليا', 'البرازيل', 'الهند', 'الصين', 'كوريا الجنوبية', 'المكسيك' ], animals: [ 'أسد', 'نمر', 'فيل', 'زرافة', 'باندا', 'كوالا', 'دولفين', 'بطريق', 'بومة', 'نسر', 'فراشة', 'أرنب' ], fruits: [ 'تفاح', 'موز', 'برتقالي', 'فراولة', 'عنب', 'أناناس', 'مانجو', 'كيوي', 'خوخ', 'كرز', 'توت أزرق', 'بطيخ' ] }; // 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 = `
🎯 جاهز لاختيار من ${sampleData.length} أسماء!
`; 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 = 'Choose Your AI Assistant'; 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 = 'إعداد واجهة برمجة جيميني'; 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('الرجاء إدخال مفتاح واجهة برمجة صالح'); } } // API 키 상태 업데이트 function updateAPIKeyStatus() { const statusEl = document.getElementById('apiKeyStatus'); if (aiModalState.apiKey) { statusEl.innerHTML = 'تغيير مفتاح API'; } else { statusEl.textContent = 'لم يتم تعيين مفتاح API'; } } // 채팅 메시지 추가 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: 'إرسال', 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')) { 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('تحميل محتوى DOM', function() { // Initialize onboarding OnboardingManager.init(); const nameInput = document.getElementById('nameInput'); if (nameInput) { nameInput.addEventListener('keypress', function(e) { if (e.key === 'إدخال' && 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 === 'إدخال') { const geminiInput = document.getElementById('geminiInput'); if (document.activeElement === geminiInput) { sendToGemini(); } } // ESC 키로 모달 닫기 if (e.key === 'خروج') { 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 منتقي الأسماء العشوائي - أداة ترفيهية مجانية | WIA Code

مرحباً بك في منتقي الأسماء العشوائي! 🎲

أول مرة هنا؟ ممتاز!

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

لا حاجة للخبرة! Perfect for teachers, team leaders, and organizers.

🎲 منتقي الأسماء العشوائي

اختر أسماء عشوائية من قائمتك فوراً! مثالي لأنشطة الفصول الدراسية وتعيين الفرق والاختيارات العادلة. بسيط وسريع وعادل تماماً.

🤔 ما هو اختيار الأسماء العشوائي؟

تخيل سحب الأسماء من قبعة - that's random name picking! It's the digital version of the fairest selection method humans have used for centuries.

يضمن اختيار الأسماء العشوائي اختياراً عادلاً وغير متحيز من أي قائمة أسماء.

🏫
أنشطة الفصول الدراسية
اختيار عادل للطلاب للعروض التقديمية والأنشطة
👥
بناء الفريق
تشكيل الفرق وتوزيع المجموعات عشوائياً
🎁
سحب الجوائز
اختيار غير متحيز للفائزين في المسابقات والهدايا
🎯
توزيع المهام
توزيع عادل للمسؤوليات والواجبات
🎪
تنظيم الفعاليات
ترتيب عشوائي للعروض والأنشطة
⚖️
قرارات عادلة
القضاء على التحيز في أي عملية اختيار