// Emoji Library for P4RS3LT0NGV3 // Create namespace for emoji library window.emojiLibrary = {}; // Polyfill for Intl.Segmenter if not available if (!Intl.Segmenter) { console.warn('Intl.Segmenter not available, falling back to basic character splitting'); } // Helper function to properly split text into grapheme clusters (emojis) window.emojiLibrary.splitEmojis = function(text) { if (Intl.Segmenter) { const segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' }); return Array.from(segmenter.segment(text), ({ segment }) => segment); } return Array.from(text); }; // Helper function to properly join emojis window.emojiLibrary.joinEmojis = function(emojis) { return emojis.join(''); }; // Additional emojis for expanded library window.emojiLibrary.ADDITIONAL_EMOJIS = [ // Animals & Nature "๐ฆ", "๐ฆ", "๐ฏ", "๐ฎ", "๐ท", "๐ธ", "๐ต", "๐", "๐ง", "๐ฆ", "๐ค", "๐ฆ", "๐ฆ ", "๐ฆ", "๐ฆ", "๐บ", "๐", "๐ด", "๐ฆ", "๐", "๐", "๐ฆ", "๐", "๐", "๐", "๐ท๏ธ", "๐ฆ", "๐ฆ", "๐ฆ ", "๐ฆจ", "๐ฆฉ", "๐ฆซ", "๐ฆฌ", "๐ปโโ๏ธ", "๐ผ", "๐จ", "๐", "๐ถ", "๐ฉ", "๐", "๐ฑ", "๐ชฑ", // Food & Drink "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ฅญ", "๐", "๐ฅฅ", "๐ฅ", "๐ ", "๐", "๐ฅ", "๐ฅฆ", "๐ฅฌ", "๐ฅ", "๐ถ๏ธ", "๐ฝ", "๐ฅ", "๐ง", "๐ง ", "๐ฅ", "๐ ", "๐ฅ", "๐", "๐", "๐", "๐", "๐ค", "๐ฃ", "๐ฑ", "๐", "๐ฒ", "๐ฅ", // Travel & Places "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ฒ", "๐", "๐", "๐ก", "๐", "๐ธ", "๐ฅ๏ธ", "๐๏ธ", "๐๏ธ", "๐ค", "๐ข", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐๏ธ", "๐๏ธ", // Activities & Sports "โฝ", "๐", "๐", "๐", "๐", "๐พ", "๐ณ", "๐", "๐", "๐", "๐ธ", "๐ฅ", "๐ฅ", "๐ฅ ", "๐คพ", "๐ฟ", "๐", "๐", "๐", "๐๏ธ", "๐คผ", "๐คธ", "๐คบ", "๐คฝ", "๐คน", "๐ฏ", "๐ฑ", "๐ฝ", "๐ด", "๐ต", // Tech & Objects "๐ป", "โจ๏ธ", "๐ฅ๏ธ", "๐ฑ๏ธ", "๐จ๏ธ", "๐ฑ", "โ๏ธ", "๐", "๐", "๐ ", "๐บ", "๐ป", "๐๏ธ", "๐๏ธ", "๐๏ธ", "๐งญ", "โฑ๏ธ", "โฒ๏ธ", "โฐ", "๐ฐ๏ธ", "๐ก", "๐", "๐", "๐ก", "๐ฎ", "๐ช", "๐งฏ", "๐ข๏ธ", "๐ธ", "๐ต", "๐ณ", "๐ด", "๐ถ", "๐ท", "๐ฐ", "๐ฑ", "๐ฒ", "๐ผ", "๐ฝ", "๐พ", "๐ฟ", // Symbols "โค๏ธ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ค", "๐ข", "๐ฃ", "๐ฅ", "๐ฆ", "๐จ", "๐ฉ", "๐ซ", "๐ฌ", "๐ฅ", "๐ ", "๐พ", "๐ป", "๐", "๐ฝ", "๐ฟ", "๐ฉธ", // Mystical & Fantasy "๐ง", "๐งโโ๏ธ", "๐งโโ๏ธ", "๐ง", "๐งโโ๏ธ", "๐งโโ๏ธ", "๐ง", "๐งโโ๏ธ", "๐งโโ๏ธ", "๐ง", "๐งโโ๏ธ", "๐งโโ๏ธ", "๐น", "๐บ", "๐ป", "๐ฝ", "๐พ", "๐ฒ", "๐ฎ", "๐", "๐", "๐ฆ", "๐ธ", "๐ฅท", "๐ฐ", "๐ง", "โ๏ธ", "๐ฏ", "๐ฑ", "โ๏ธ", "โจ", "๐ ", "๐", "๐", "๐", "๐", "๐บ", "๐น", "๐ญ", "๐", "๐", "๐ข", "๐", "๐ฐ", "๐ฅ", "๐ฅ", "๐", "๐", "๐ช๏ธ", "๐ฉธ", "๐ชฑ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", // Flags "๐", "๐ฉ", "๐", "๐ด", "๐ณ๏ธ", "๐ณ๏ธโ๐", "๐ณ๏ธโโง๏ธ", "๐ดโโ ๏ธ", "๐บ๐ธ", "๐จ๐ฆ", "๐ฌ๐ง", "๐ฉ๐ช", "๐ซ๐ท", "๐ฎ๐น", "๐ฏ๐ต", "๐ฐ๐ท", "๐ท๐บ", "๐จ๐ณ", "๐ฎ๐ณ", "๐ฆ๐บ", "๐ง๐ท", "๐ช๐ธ", "๐ณ๐ฑ", "๐ต๐น", "๐ธ๐ช", "๐ฆ๐ท", "๐ฆ๐บ", "๐ฆ๐น", "๐ง๐ช", "๐ง๐ด" ]; // Make emoji list globally available window.emojiLibrary.EMOJI_LIST = [ // Faces and People "๐", // Grinning Face "๐", // Beaming Face with Smiling Eyes "๐", // Face with Tears of Joy "๐คฃ", // Rolling on the Floor Laughing "๐", // Grinning Face with Big Eyes "๐", // Grinning Face with Smiling Eyes "๐ ", // Grinning Face with Sweat "๐", // Grinning Squinting Face "๐", // Winking Face "๐", // Smiling Face with Smiling Eyes "๐", // Face Savoring Food "๐", // Smiling Face with Sunglasses "๐", // Smiling Face with Heart-Eyes "๐", // Face Blowing a Kiss "๐ฅฐ", // Smiling Face with Hearts "๐", // Kissing Face "๐", // Kissing Face with Smiling Eyes "๐", // Kissing Face with Closed Eyes "๐", // Slightly Smiling Face "๐ค", // Hugging Face "๐คฉ", // Star-Struck "๐ค", // Thinking Face "๐คจ", // Face with Raised Eyebrow "๐", // Neutral Face "๐", // Expressionless Face "๐ถ", // Face Without Mouth "๐", // Face with Rolling Eyes "๐", // Smirking Face "๐ฃ", // Persevering Face "๐ฅ", // Sad but Relieved Face "๐ฎ", // Face with Open Mouth "๐ค", // Zipper-Mouth Face "๐ฏ", // Hushed Face "๐ช", // Sleepy Face "๐ซ", // Tired Face "๐ด", // Sleeping Face "๐", // Relieved Face "๐", // Face with Tongue "๐", // Winking Face with Tongue "๐", // Squinting Face with Tongue "๐คค", // Drooling Face "๐", // Unamused Face "๐", // Downcast Face with Sweat "๐", // Pensive Face "๐", // Confused Face "๐", // Upside-Down Face "๐ค", // Money-Mouth Face "๐ฒ", // Astonished Face "๐", // Slightly Frowning Face "๐", // Confounded Face "๐", // Disappointed Face "๐", // Worried Face "๐ค", // Face with Steam From Nose "๐ข", // Crying Face "๐ญ", // Loudly Crying Face "๐ง", // Anguished Face "๐จ", // Fearful Face "๐ฉ", // Weary Face "๐คฏ", // Exploding Head "๐ฑ", // Face Screaming in Fear "๐ณ", // Flushed Face "๐ฅต", // Hot Face "๐ฅถ", // Cold Face "๐ก", // Pouting Face "๐ ", // Angry Face "๐คฌ", // Face with Symbols on Mouth "๐ท", // Face with Medical Mask "๐ค", // Face with Thermometer "๐ค", // Face with Head-Bandage "๐คข", // Nauseated Face "๐คฎ", // Face Vomiting "๐คง", // Sneezing Face "๐", // Smiling Face with Halo "๐ฅณ", // Partying Face "๐ฅด", // Woozy Face "๐ฅบ", // Pleading Face "๐ง", // Face with Monocle "๐ฅฑ", // Yawning Face "๐ง ", // Brain // Gestures and Body Parts "๐", // Thumbs Up "๐", // Thumbs Down "๐", // Clapping Hands "๐", // Raising Hands "๐ค", // Handshake "๐", // Waving Hand "โ๏ธ", // Victory Hand "๐ค", // Love-You Gesture "๐ค", // Sign of the Horns "๐", // Oncoming Fist "โ", // Raised Fist "๐", // Backhand Index Pointing Up "๐", // Backhand Index Pointing Down "๐", // Backhand Index Pointing Left "๐", // Backhand Index Pointing Right "๐", // OK Hand "๐ค", // Pinched Fingers "๐ค", // Pinching Hand "โ", // Raised Hand "๐ค", // Raised Back of Hand "๐๏ธ", // Hand with Fingers Splayed "๐", // Vulcan Salute "๐", // Eyes "๐๏ธ", // Eye "๐", // Mouth "๐งฟ", // Nazar Amulet // Celebration & Objects "๐", // Party Popper "๐", // Confetti Ball "๐", // Birthday Cake "๐", // Wrapped Gift "๐", // Balloon "๐", // Christmas Tree "๐", // Jack-O-Lantern "๐", // Trophy "๐ ", // Sports Medal "๐ฅ", // 1st Place Medal "๐ฅ", // 2nd Place Medal "๐ฅ", // 3rd Place Medal "๐ฐ", // Money Bag "๐ธ", // Money with Wings "๐ต", // Dollar Banknote "๐ด", // Yen Banknote "๐ถ", // Euro Banknote "๐ท", // Pound Banknote "๐ฏ", // Hundred Points "๐ฑ", // Mobile Phone "๐ป", // Laptop "โจ๏ธ", // Keyboard "๐ฅ๏ธ", // Desktop Computer "๐", // Locked "๐", // Unlocked // Food & Drink "๐", // Pizza "๐", // Hamburger "๐ฆ", // Ice Cream "๐ฉ", // Doughnut "๐บ", // Beer Mug "๐ท", // Wine Glass "โ", // Hot Beverage // Nature & Weather "๐", // Rainbow "๐", // Sun with Face "๐", // New Moon "๐", // Waxing Crescent Moon "๐", // First Quarter Moon "๐", // Waxing Gibbous Moon "๐", // Full Moon "๐", // Waning Gibbous Moon "๐", // Last Quarter Moon "๐", // Waning Crescent Moon "๐", // Crescent Moon "โญ", // Star "๐", // Glowing Star "โก", // High Voltage "โ๏ธ", // Snowflake "๐ฅ", // Fire "๐ง", // Droplet "๐", // Water Wave // Animals "๐ฑ", // Cat Face "๐ถ", // Dog Face "๐ฆ", // Fox "๐ผ", // Panda "๐ฆ", // Lion "๐ฌ", // Dolphin "๐ฆ", // Unicorn // Symbols & Special "โค๏ธ", // Red Heart "๐งก", // Orange Heart "๐", // Green Heart "๐", // Blue Heart "๐", // Purple Heart "๐", // Rocket "๐", // Eyes "๐", // Skull "๐ฅน", // Face Holding Back Tears "๐", // Snake "๐", // Dragon "๐ฒ", // Dragon Face "๐งโโ๏ธ", // Wizard "๐ช", // Magic Wand "๐ดโโ ๏ธ", // Pirate Flag "๐ฆ ", // Eagle (often associated with pirates) "๐ฆ", // Parrot (pirate symbol) "๐ป", // Laptop (hacker symbol) "๐ถ๏ธ", // Sunglasses (cool guy symbol) "๐งโ๐ป", // Technologist "๐จโ๐ป", // Man Technologist "๐ฉโ๐ป", // Woman Technologist "๐ต๏ธ", // Detective "๐ต๏ธโโ๏ธ", // Man Detective "๐ต๏ธโโ๏ธ", // Woman Detective "๐ฅ๏ธ", // Desktop Computer "โจ๏ธ", // Keyboard "๐ฑ๏ธ", // Computer Mouse "๐น๏ธ", // Joystick "๐ฑ", // Mobile Phone "๐ฒ", // Mobile Phone with Arrow "๐", // Unlocked (hacker symbol) "๐", // Key (hacker symbol) "๐๏ธ", // Old Key (hacker symbol) "๐ก๏ธ", // Shield (hacker symbol) "โ๏ธ", // Crossed Swords (hacker symbol) "๐งฌ", // DNA (hacker symbol) "๐งซ", // Petri Dish (hacker symbol) "๐งช", // Test Tube (hacker symbol) "๐ ๏ธ", // Hammer and Wrench (hacker symbol) "โ๏ธ", // Gear (hacker symbol) "๐งฐ", // Toolbox (hacker symbol) "๐งฒ", // Magnet (hacker symbol) "๐ฃ", // Bomb (hacker symbol) "๐ณ๏ธ", // Hole (hacker symbol) "๐ก", // Satellite Antenna (hacker symbol) "๐ฐ๏ธ", // Satellite (hacker symbol) "๐", // Telephone Receiver (hacker symbol) "โ๏ธ", // Telephone (hacker symbol) "๐", // Pager (hacker symbol) "๐ ", // Fax Machine (hacker symbol) "๐", // Electric Plug (hacker symbol) "๐ก", // Light Bulb (hacker symbol) "๐ฆ", // Flashlight (hacker symbol) "๐ฏ๏ธ", // Candle (hacker symbol) "๐๏ธ", // Rolled-Up Newspaper (hacker symbol) "๐", // Scroll (hacker symbol) "๐", // Page with Curl (hacker symbol) "๐", // Page Facing Up (hacker symbol) "๐", // Bookmark Tabs (hacker symbol) "๐", // Bar Chart (hacker symbol) "๐", // Chart Increasing (hacker symbol) "๐", // Chart Decreasing (hacker symbol) "๐๏ธ", // Card Index Dividers (hacker symbol) "๐๏ธ", // Card File Box (hacker symbol) "๐๏ธ", // File Cabinet (hacker symbol) "๐๏ธ", // Wastebasket (hacker symbol) "๐ข๏ธ", // Oil Drum (hacker symbol) "๐๏ธ", // Bellhop Bell (hacker symbol) "๐งณ", // Luggage (hacker symbol) "๐", // Person in Bed (hacker symbol) "๐๏ธ", // Bed (hacker symbol) "๐๏ธ", // Couch and Lamp (hacker symbol) "๐ช", // Chair (hacker symbol) "๐ช", // Door (hacker symbol) "๐งด", // Lotion Bottle (hacker symbol) "๐งท", // Safety Pin (hacker symbol) "๐งน", // Broom (hacker symbol) "๐งบ", // Basket (hacker symbol) "๐งป", // Roll of Paper (hacker symbol) "๐งผ", // Soap (hacker symbol) "๐งฝ", // Sponge (hacker symbol) "๐งฏ", // Fire Extinguisher (hacker symbol) "๐", // Shopping Cart (hacker symbol) "๐ฌ", // Cigarette (hacker symbol) "โฐ๏ธ", // Coffin (hacker symbol) "โฑ๏ธ", // Funeral Urn (hacker symbol) "๐ฟ", // Moai (hacker symbol) "๐", // Passport Control (hacker symbol) "๐", // Customs (hacker symbol) "๐", // Baggage Claim (hacker symbol) "๐ ", // Left Luggage (hacker symbol) "๐น", // Men's Room (hacker symbol) "๐บ", // Women's Room (hacker symbol) "๐ผ", // Baby Symbol (hacker symbol) "๐ป", // Restroom (hacker symbol) "๐ฎ", // Litter in Bin Sign (hacker symbol) "๐ฐ", // Potable Water (hacker symbol) "๐พ", // Water Closet (hacker symbol) "๐ญ", // No Smoking (hacker symbol) "๐ฏ", // No Littering (hacker symbol) "๐ฑ", // Non-Potable Water (hacker symbol) // Additional Smileys & Emotion "๐", // Smiling Face with Smiling Eyes "๐", // Smiling Face with Halo "๐", // Slightly Smiling Face "๐", // Upside-Down Face "๐", // Winking Face "๐", // Relieved Face "๐", // Smiling Face with Heart-Eyes "๐ฅฐ", // Smiling Face with Hearts "๐", // Face Blowing a Kiss "๐", // Kissing Face "๐", // Kissing Face with Smiling Eyes "๐", // Kissing Face with Closed Eyes "๐", // Face Savoring Food "๐", // Face with Tongue "๐", // Squinting Face with Tongue "๐", // Winking Face with Tongue "๐คช", // Zany Face // Additional People & Body "๐งโ๐", // Astronaut "๐จโ๐", // Man Astronaut "๐ฉโ๐", // Woman Astronaut "๐งโ๐ฌ", // Scientist "๐จโ๐ฌ", // Man Scientist "๐ฉโ๐ฌ", // Woman Scientist "๐งโโ๏ธ", // Health Worker "๐จโโ๏ธ", // Man Health Worker "๐ฉโโ๏ธ", // Woman Health Worker "๐งโ๐ง", // Mechanic "๐จโ๐ง", // Man Mechanic "๐ฉโ๐ง", // Woman Mechanic "๐งโ๐", // Firefighter "๐จโ๐", // Man Firefighter "๐ฉโ๐", // Woman Firefighter // Additional Animals & Nature "๐ฆ", // Giraffe "๐ฆ", // Zebra "๐ฆฌ", // Bison "๐ฆ", // Llama "๐ฆ", // Kangaroo "๐ฆฅ", // Sloth "๐ฆฆ", // Otter "๐ฆก", // Badger "๐ฆ", // Hedgehog "๐ฆ", // Raccoon "๐ฟ๏ธ", // Chipmunk "๐ฆซ", // Beaver "๐ฆ", // Lizard "๐", // Crocodile "๐ข", // Turtle "๐ฆ", // Sauropod "๐ฆ", // T-Rex "๐", // Whale "๐ฌ", // Dolphin "๐ฆญ", // Seal // Additional Food & Drink "๐ฅ", // Pancakes "๐ง", // Waffle "๐ง", // Cheese Wedge "๐", // Meat on Bone "๐", // Poultry Leg "๐ฅฉ", // Cut of Meat "๐ฅ", // Bacon "๐", // Hamburger "๐", // French Fries "๐", // Pizza "๐ญ", // Hot Dog "๐ฅช", // Sandwich "๐ฎ", // Taco "๐ฏ", // Burrito "๐ฅ", // Stuffed Flatbread "๐ง", // Falafel "๐ฅ", // Egg "๐ณ", // Cooking "๐ฅ", // Shallow Pan of Food "๐ฒ", // Pot of Food // Additional Travel & Places "๐๏ธ", // Cityscape "๐", // Cityscape at Dusk "๐", // Sunset "๐", // Night with Stars "๐", // Bridge at Night "๐๏ธ", // National Park "๐๏ธ", // Desert "๐๏ธ", // Desert Island "๐๏ธ", // Beach with Umbrella "โฐ๏ธ", // Mountain "๐๏ธ", // Snow-Capped Mountain "๐", // Volcano "๐ป", // Mount Fuji "๐ ", // House "๐ก", // House with Garden "๐ข", // Office Building "๐ฃ", // Japanese Post Office "๐ค", // Post Office "๐ฅ", // Hospital "๐ฆ", // Bank // Additional Flags "๐บ๐ธ", // United States "๐ฌ๐ง", // United Kingdom "๐จ๐ฆ", // Canada "๐ฏ๐ต", // Japan "๐ฉ๐ช", // Germany "๐ซ๐ท", // France "๐ฎ๐น", // Italy "๐ช๐ธ", // Spain "๐ท๐บ", // Russia "๐จ๐ณ", // China "๐ฎ๐ณ", // India "๐ง๐ท", // Brazil "๐ฆ๐บ", // Australia "๐ฒ๐ฝ", // Mexico "๐ฐ๐ท", // South Korea "๐ฟ๐ฆ", // South Africa "๐ธ๐ช", // Sweden "๐ณ๐ด", // Norway "๐ณ๐ฟ", // New Zealand "๐ฎ๐ช", // Ireland ]; // Define emoji categories with specific emojis for each category window.emojiLibrary.EMOJIS = { nature: ["๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ฆ", "๐ฆ", "๐ฏ", "๐ฎ", "๐ท", "๐ธ", "๐ต", "๐", "๐ง", "๐ฆ", "๐ค", "๐ฆ", "๐ฆ ", "๐ฆ", "๐ฆ", "๐บ", "๐", "๐ด", "๐ฆ", "๐", "๐", "๐ฆ", "๐", "๐", "๐", "๐ท๏ธ", "๐ฆ", "๐ฆ", "๐ฆ ", "๐ชฑ"], mystical: ["๐ง", "๐งโโ๏ธ", "๐งโโ๏ธ", "๐ง", "๐งโโ๏ธ", "๐งโโ๏ธ", "๐ง", "๐งโโ๏ธ", "๐งโโ๏ธ", "๐ง", "๐งโโ๏ธ", "๐งโโ๏ธ", "๐น", "๐บ", "๐ป", "๐ฝ", "๐พ", "๐ฒ", "๐ฎ", "๐", "๐", "๐ฆ", "โ๏ธ", "๐ฏ", "๐ฑ", "โ๏ธ", "โจ", "๐ ", "๐", "๐", "๐ฉธ"], faces_people: ["๐", "๐", "๐", "๐คฃ", "๐", "๐", "๐ ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ฅฐ", "๐", "๐", "๐", "๐", "๐ค", "๐คฉ", "๐ค", "๐คจ", "๐", "๐", "๐ถ", "๐", "๐", "๐ฃ", "๐ฅ", "๐ฎ", "๐ค", "๐ฏ", "๐ช", "๐ซ", "๐ด", "๐", "๐", "๐", "๐", "๐คค", "๐", "๐", "๐", "๐", "๐", "๐ค", "๐ฒ", "๐", "๐", "๐", "๐", "๐ค", "๐ข", "๐ญ", "๐ง", "๐จ", "๐ฉ", "๐คฏ", "๐ฑ", "๐ณ", "๐ฅต", "๐ฅถ", "๐ก", "๐ ", "๐คฌ", "๐ท", "๐ค", "๐ค", "๐คข", "๐คฎ", "๐คง", "๐", "๐ฅณ", "๐ฅด", "๐ฅบ", "๐ง", "๐ฅฑ", "๐ง "], gestures: ["๐", "๐", "๐", "โ๏ธ", "๐ค", "๐ค", "๐ค", "๐ค", "๐", "๐", "๐", "๐", "๐", "โ๏ธ", "โ", "๐ค", "๐๏ธ", "๐", "๐", "๐ค", "๐", "๐", "๐", "๐ค", "๐"], animals_nature: ["๐ฆ", "๐ฆ", "๐ฏ", "๐ฎ", "๐ท", "๐ธ", "๐ต", "๐", "๐ง", "๐ฆ", "๐ค", "๐ฆ", "๐ฆ ", "๐ฆ", "๐ฆ", "๐บ", "๐", "๐ด", "๐", "๐", "๐ฆ", "๐", "๐", "๐", "๐ท๏ธ", "๐ฆ", "๐", "๐ฆจ", "๐ฆฉ", "๐ฆซ", "๐ฆฌ", "๐ปโโ๏ธ", "๐ผ", "๐จ", "๐", "๐ถ", "๐ฉ", "๐", "๐ฑ"], activities_sports: ["โฝ", "๐", "๐", "๐", "๐", "๐พ", "๐ณ", "๐", "๐", "๐", "๐ธ", "๐ฅ", "๐ฅ", "๐ฅ ", "๐คพ", "๐ฟ", "๐", "๐", "๐", "๐๏ธ", "๐คผ", "๐คธ", "๐คบ", "๐คฝ", "๐คน", "๐ฏ", "๐ฑ", "๐ฝ", "๐ด", "๐ต"], technology_objects: ["๐ป", "โจ๏ธ", "๐ฅ๏ธ", "๐ฑ๏ธ", "๐จ๏ธ", "๐ฑ", "โ๏ธ", "๐", "๐", "๐ ", "๐บ", "๐ป", "๐๏ธ", "๐๏ธ", "๐๏ธ", "๐งญ", "๐ก", "๐", "๐", "๐ก", "๐ข๏ธ", "๐ธ", "๐ต", "๐ณ", "๐", "๐", "๐"], mystical_fantasy: ["๐ง", "๐ง", "๐ง", "๐ง", "๐น", "๐บ", "๐ป", "๐ฝ", "๐พ", "๐ฎ", "๐ช", "๐", "๐ฒ", "๐ฆ"], nature_weather: ["๐", "๐", "๐", "โญ", "๐", "โก", "โ๏ธ", "๐ฅ", "๐ง", "๐", "๐ช๏ธ", "๐"], symbols: ["โค๏ธ", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐", "๐ข", "๐ฃ", "๐ฅ", "๐ฆ", "๐จ", "๐ฉ", "๐ซ", "๐ฌ", "๐ ", "๐ฎ"], flags: ["๐", "๐ฉ", "๐", "๐ด", "๐ณ๏ธ", "๐ณ๏ธโ๐", "๐ณ๏ธโโง๏ธ", "๐ดโโ ๏ธ", "๐บ๐ธ", "๐จ๐ฆ", "๐ฌ๐ง", "๐ฉ๐ช", "๐ซ๐ท", "๐ฎ๐น", "๐ฏ๐ต", "๐ฐ๐ท", "๐ท๐บ", "๐จ๐ณ", "๐ฎ๐ณ", "๐ง๐ท", "๐ฆ๐บ", "๐ช๐ธ", "๐ณ๐ฑ", "๐ธ๐ช"] }; // Define standard emoji categories window.emojiLibrary.CATEGORIES = [ { id: 'all', name: 'All Emojis', icon: '๐' }, { id: 'faces_people', name: 'Faces & People', icon: '๐' }, { id: 'gestures', name: 'Gestures', icon: '๐' }, { id: 'animals_nature', name: 'Animals & Nature', icon: '๐ฆ' }, { id: 'activities_sports', name: 'Activities & Sports', icon: 'โฝ' }, { id: 'technology_objects', name: 'Tech & Objects', icon: '๐ป' }, { id: 'mystical_fantasy', name: 'Mystical & Fantasy', icon: '๐ง' }, { id: 'nature_weather', name: 'Nature & Weather', icon: '๐' }, { id: 'symbols', name: 'Symbols', icon: 'โค๏ธ' }, { id: 'flags', name: 'Flags', icon: '๐' } ]; // Function to render emoji grid with categories window.emojiLibrary.renderEmojiGrid = function(containerId, onEmojiSelect, filteredList) { console.log('Rendering emoji grid to:', containerId); // Get container by ID const container = document.getElementById(containerId); if (!container) { console.error('Container not found:', containerId); return; } // Clear container container.innerHTML = ''; // Add header with instruction message const emojiHeader = document.createElement('div'); emojiHeader.className = 'emoji-header'; emojiHeader.innerHTML = '
Click any emoji to copy your hidden message
'; container.appendChild(emojiHeader); // Create category tabs const categoryTabs = document.createElement('div'); categoryTabs.className = 'emoji-category-tabs'; // Add category tabs window.emojiLibrary.CATEGORIES.forEach(category => { const tab = document.createElement('button'); tab.className = 'emoji-category-tab'; if (category.id === 'all') { tab.classList.add('active'); } tab.setAttribute('data-category', category.id); tab.innerHTML = `${category.icon} ${category.name}`; categoryTabs.appendChild(tab); }); container.appendChild(categoryTabs); // Create emoji grid with enforced styling const gridContainer = document.createElement('div'); gridContainer.className = 'emoji-grid'; // Get the active category let activeCategory = 'all'; const activeCategoryTab = container.querySelector('.emoji-category-tab.active'); if (activeCategoryTab) { activeCategory = activeCategoryTab.getAttribute('data-category'); } // Determine which emojis to show based on category and filter let emojisToShow = []; if (filteredList && filteredList.length > 0) { // If we have a filtered list (from search), use that emojisToShow = filteredList; } else if (activeCategory === 'all') { // For 'all' category, combine all emojis from the categories Object.values(window.emojiLibrary.EMOJIS).forEach(categoryEmojis => { emojisToShow = [...emojisToShow, ...categoryEmojis]; }); } else if (window.emojiLibrary.EMOJIS[activeCategory]) { // For specific category, use emojis from that category emojisToShow = window.emojiLibrary.EMOJIS[activeCategory]; } console.log(`Adding ${emojisToShow.length} emojis to grid for category: ${activeCategory}`); // Add emojis to grid with enforced styling emojisToShow.forEach(emoji => { const emojiButton = document.createElement('button'); emojiButton.className = 'emoji-button'; emojiButton.textContent = emoji; // Use textContent for better emoji handling emojiButton.title = 'Click to encode with this emoji'; emojiButton.addEventListener('click', () => { if (typeof onEmojiSelect === 'function') { onEmojiSelect(emoji); // Add visual feedback when clicked emojiButton.style.backgroundColor = '#e6f7ff'; setTimeout(() => { emojiButton.style.backgroundColor = ''; }, 300); } }); gridContainer.appendChild(emojiButton); }); container.appendChild(gridContainer); console.log('Emoji grid rendering complete'); // Add event listeners to category tabs const categoryTabButtons = container.querySelectorAll('.emoji-category-tab'); categoryTabButtons.forEach(tab => { tab.addEventListener('click', () => { // Update active tab categoryTabButtons.forEach(t => t.classList.remove('active')); tab.classList.add('active'); // Re-render the emoji grid with the selected category const selectedCategory = tab.getAttribute('data-category'); console.log('Category selected:', selectedCategory); // Clear and recreate the grid container.removeChild(gridContainer); window.emojiLibrary.renderEmojiGrid(containerId, onEmojiSelect); }); }); // Debug info - add count display const countDisplay = document.createElement('div'); countDisplay.className = 'emoji-count'; countDisplay.textContent = `${emojisToShow.length} emojis available`; container.appendChild(countDisplay); };