// personality_allocation.js // Personality and color mappings with additional visual properties const personalityConfig = { normal: { color: '#227c9d', // cerulean name: 'normal', icon: 'mdi:account-circle', backgroundColor: 'cerulean', borderColor: 'border-blue-600' }, genuine_friend: { color: '#17c3b2', // light-sea-green name: 'genuine friend', icon: 'mdi:account-heart', backgroundColor: 'light-sea-green', borderColor: 'border-teal-600' }, sensitive_to_compliments: { color: '#ffcb77', // sunset name: 'sensitive to compliments', icon: 'mdi:account-star', backgroundColor: 'sunset', borderColor: 'border-yellow-600' }, /* rebellious: { color: '#fe6d73', // light-red name: 'rebellious', icon: 'mdi:account-alert', backgroundColor: 'light-red', borderColor: 'border-red-600' } */ }; // Get random personality function getRandomPersonality() { const personalities = Object.keys(personalityConfig); const randomIndex = Math.floor(Math.random() * personalities.length); return personalities[randomIndex]; } // Create player square with personality function createPlayerSquare(personality) { const config = personalityConfig[personality]; // Create the square container const square = document.createElement('div'); square.className = `w-16 h-16 rounded-md shadow-lg flex flex-col items-center justify-center text-white font-medium pop-in ${config.backgroundColor}`; // Add icon and label square.innerHTML = ` You `; return square; } // Initialize personality system function initializePersonalitySystem() { // Get DOM elements const personalitySelect = document.getElementById('personality-select'); const gridContainer = document.getElementById('grid-container'); const gameInfo = document.getElementById('game-info'); // Get random personality const selectedPersonality = getRandomPersonality(); const config = personalityConfig[selectedPersonality]; // Set the select value programmatically personalitySelect.value = selectedPersonality; // Create personality display const personalityDisplay = document.createElement('div'); personalityDisplay.className = 'bg-white rounded-lg p-4 shadow-md mb-4'; personalityDisplay.innerHTML = `