#!/bin/bash # Reading Teacher - Interactive Playground Generator # Creates instant, interactive reading learning experiences set -e # Colors GREEN='\033[0;32m' BLUE='\033[0;34m' PURPLE='\033[0;35m' NC='\033[0m' print_success() { echo -e "${GREEN}✓ $1${NC}"; } print_info() { echo -e "${BLUE}ℹ $1${NC}"; } prompt_select() { local prompt="$1" local var_name="$2" shift 2 local options=("$@") echo -e "${BLUE}${prompt}${NC}" PS3="Select (1-${#options[@]}): " select opt in "${options[@]}"; do if [ -n "$opt" ]; then eval "$var_name='$opt'" break fi done } echo "" echo "╔════════════════════════════════════════════════════════════╗" echo "║ Reading Teacher - Playground Generator 📚 ║" echo "╚════════════════════════════════════════════════════════════╝" echo "" print_info "Step 1/4: Age Group" prompt_select "Choose age group:" AGE_GROUP \ "Toddler (Ages 1-3)" \ "Preschool (Ages 3-5)" \ "Early Elementary (Ages 5-7)" \ "Elementary (Ages 7-10)" print_info "Step 2/4: Reading Skill" case $AGE_GROUP in "Toddler (Ages 1-3)") prompt_select "Which skill?" SKILL \ "Letter Recognition" \ "Letter Sounds" \ "Alphabet Song" ;; "Preschool (Ages 3-5)") prompt_select "Which skill?" SKILL \ "Phonics - CVC Words" \ "Letter Matching" \ "Rhyming Words" ;; "Early Elementary (Ages 5-7)") prompt_select "Which skill?" SKILL \ "Sight Words" \ "Word Families" \ "Simple Sentences" ;; "Elementary (Ages 7-10)") prompt_select "Which skill?" SKILL \ "Reading Comprehension" \ "Vocabulary Building" \ "Story Sequencing" ;; esac print_info "Step 3/4: Activity Type" prompt_select "Type of activity?" ACTIVITY_TYPE \ "Interactive Explorer" \ "Practice Game" \ "Timed Challenge" print_info "Step 4/4: Output" read -p "Playground name (e.g., letter-land.html): " OUTPUT_FILE OUTPUT_DIR="./reading-playgrounds" mkdir -p "$OUTPUT_DIR" OUTPUT_PATH="$OUTPUT_DIR/$OUTPUT_FILE" print_info "📚 Generating your reading playground..." # Generate based on skill (showing letter recognition as example) cat > "$OUTPUT_PATH" << 'EOF'