Class_generator/js/content/example-with-images.js
StillHammer 475006e912 Add Word Discovery game with auto-play TTS and Settings system
- New Word Discovery game with image support and practice phases
- Auto-play TTS on word appearance with speed control (0.7x-1.1x)
- Complete Settings page with TTS controls and debug interface
- Language standardization with BCP 47 codes (en-US, zh-CN, fr-FR)
- Media fallback handling for missing images and audio
- Settings Manager with voice selection and debug tools

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-19 14:39:08 +08:00

81 lines
2.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Example content module with image support for Word Discovery game
window.ContentModules = window.ContentModules || {};
window.ContentModules.ExampleWithImages = {
name: "Basic Vocabulary with Images",
description: "Simple English words with visual support for beginners",
difficulty: "easy",
language: "en-US",
// Vocabulary with image support
vocabulary: {
"apple": {
translation: "pomme",
pronunciation: "æpəl",
type: "noun",
image: "assets/images/vocabulary/apple.png",
audioFile: "assets/audio/vocabulary/apple.mp3"
},
"cat": {
translation: "chat",
pronunciation: "kæt",
type: "noun",
image: "assets/images/vocabulary/cat.png",
audioFile: "assets/audio/vocabulary/cat_broken.mp3" // Broken path to test fallback
},
"house": {
translation: "maison",
pronunciation: "haʊs",
type: "noun",
image: "assets/images/vocabulary/house.png"
},
"car": {
translation: "voiture",
pronunciation: "kɑr",
type: "noun",
image: "assets/images/vocabulary/car.png"
},
"tree": {
translation: "arbre",
pronunciation: "tri",
type: "noun",
image: "assets/images/vocabulary/tree.png"
},
"book": {
translation: "livre",
pronunciation: "bʊk",
type: "noun",
image: "assets/images/vocabulary/book.png"
},
"sun": {
translation: "soleil",
pronunciation: "sʌn",
type: "noun",
image: "assets/images/vocabulary/sun.png"
},
"dog": {
translation: "chien",
pronunciation: "dɔg",
type: "noun",
image: "assets/images/vocabulary/dog.png"
}
},
// Backward compatibility for other games
sentences: [
{
english: "The apple is red",
chinese: "La pomme est rouge",
prononciation: "ðə æpəl ɪz red"
},
{
english: "The cat is sleeping",
chinese: "Le chat dort",
prononciation: "ðə kæt ɪz slipɪŋ"
},
{
english: "I live in a house",
chinese: "J'habite dans une maison",
prononciation: "aɪ lɪv ɪn ə haʊs"
}
]
};