Choose Your Experience Level

🟒
Beginner
Just the basics - perfect to start!
🟑
Intermediate
More controls and options
πŸ”΄
Expert
Full power - all features!

πŸš€ Quick Start

βš™οΈ Basic Options

🎯 Your selected name(s) will appear here

πŸ“ Try Sample Lists

πŸ‘¨β€πŸŽ“ Student Names
Common classroom names for demonstration
πŸ† Sports Teams
Popular team names for competitions
🌈 Color Names
Rainbow colors for creative activities
🌍 World Countries
Popular country names for geography
🐾 Animal Names
Cute animal names for fun activities
🍎 Fruit Names
Fresh fruit names for healthy choices

πŸŽ‰ 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!

Learn More About WIA Code

πŸ€– Choose Your AI Assistant

πŸ’¬ ChatGPT
Most versatile β€’ Best for general tasks
🧠 Claude
Best reasoning β€’ Perfect for analysis
✨ Gemini FREE
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('No results to export', '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('History cleared successfully', '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: [ 'Alice Johnson', 'Bob Smith', 'Charlie Brown', 'Diana Prince', 'Eve Wilson', 'Frank Miller', 'Grace Kelly', 'Henry Ford', 'Ivy Chen', 'Jack Robinson', 'Kate Williams', 'Liam Davis' ], teams: [ 'Red Dragons', '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 = '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 = '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 = 'Change API Key'; } 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! 🎲

First time here? Perfect!

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

No experience needed! Perfect for teachers, team leaders, and organizers.

🎲 Random Name Picker

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?

Think of drawing names from a hat - 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.

🏫
Classroom Activities
Fair student selection for presentations and activities
πŸ‘₯
Team Building
Random team formation and group assignments
🎁
Prize Drawings
Unbiased winner selection for contests and giveaways
🎯
Task Assignment
Fair distribution of responsibilities and duties
πŸŽͺ
Event Organization
Random order for performances and activities
βš–οΈ
Fair Decisions
Eliminate bias in any selection process