// Visual Content System for KidsAI Explorer // Maps topics and concepts to appropriate visual elements for kids aged 8-12 const VisualContent = { // Topic-based visual mappings topicVisuals: { // Science topics 'sky': { emoji: '🌌', animation: 'sky-animation', illustration: `
💙 Blue light scatters more!
`, description: { en: "Watch how sunlight scatters in our atmosphere!", de: "Schau, wie das Sonnenlicht in unserer Atmosphäre gestreut wird!" } }, 'bird': { emoji: '🕊️', animation: 'bird-flight-animation', illustration: `
🪶
🐦
🪶
⬆️ Lift
⬇️ Gravity
`, description: { en: "See how birds use their wings to create lift!", de: "Sieh, wie Vögel ihre Flügel nutzen, um Auftrieb zu erzeugen!" } }, 'water': { emoji: '💧', animation: 'water-molecule-animation', illustration: `
H
O
H
💧
Makes things wet because molecules stick!
`, description: { en: "Discover why water feels wet!", de: "Entdecke, warum sich Wasser nass anfühlt!" } }, 'seasons': { emoji: '🌍', animation: 'earth-orbit-animation', illustration: `
☀️
🌍
Summer ☀️ Winter ❄️
`, description: { en: "See how Earth's tilt creates seasons!", de: "Sieh, wie die Neigung der Erde die Jahreszeiten entstehen lässt!" } }, 'computer': { emoji: '💻', animation: 'data-flow-animation', illustration: `
🧠 CPU
1010101
0110011
💾 Memory
`, description: { en: "Watch how computers think with 1s and 0s!", de: "Schau, wie Computer mit 1en und 0en denken!" } }, 'dream': { emoji: '💭', animation: 'brain-dream-animation', illustration: `
🧠
🌈
🦄
🏰
~~~
`, description: { en: "See your brain creating dreams while you sleep!", de: "Sieh, wie dein Gehirn Träume erschafft, während du schläfst!" } }, 'rainbow': { emoji: '🌈', animation: 'light-prism-animation', illustration: `
🌞 White Light
🔺
Red Orange Yellow Green Blue Indigo Violet
`, description: { en: "Watch white light split into rainbow colors!", de: "Schau, wie weißes Licht in Regenbogenfarben aufgeteilt wird!" } } }, // Get visual content for a question/topic getVisualForTopic: function(question) { const questionLower = question.toLowerCase(); // Check for topic keywords for (const [topic, visual] of Object.entries(this.topicVisuals)) { if (questionLower.includes(topic) || this.getTopicKeywords(topic).some(keyword => questionLower.includes(keyword))) { return visual; } } // Default visual for general questions return { emoji: '🤔', animation: 'thinking-animation', illustration: `
🧠
💡
🔍
`, description: { en: "Let's think about this together!", de: "Lass uns gemeinsam darüber nachdenken!" } }; }, // Get additional keywords for topic matching getTopicKeywords: function(topic) { const keywords = { 'sky': ['blue', 'himmel', 'blau', 'atmosphere', 'atmosphäre'], 'bird': ['fly', 'flying', 'fliegen', 'wing', 'flügel', 'vogel'], 'water': ['wet', 'nass', 'liquid', 'flüssig', 'molecule', 'molekül'], 'seasons': ['winter', 'summer', 'spring', 'autumn', 'jahreszeit', 'sommer', 'herbst', 'frühling'], 'computer': ['work', 'funktioniert', 'processor', 'prozessor', 'digital'], 'dream': ['sleep', 'schlafen', 'träume', 'night', 'nacht'], 'rainbow': ['colors', 'farben', 'light', 'licht', 'regenbogen', 'prism', 'prisma'] }; return keywords[topic] || []; } }; // Export for use in other files if (typeof module !== 'undefined' && module.exports) { module.exports = VisualContent; }