You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

259 lines
7.5 KiB

"""
Configuration and constants for Tesla Coil Spark Course application
"""
from pathlib import Path
# ============================================================================
# Paths
# ============================================================================
# Base directory (spark-lessons/)
BASE_DIR = Path(__file__).parent.parent
# Content directories
LESSONS_DIR = BASE_DIR / 'lessons'
EXERCISES_DIR = BASE_DIR / 'exercises'
REFERENCE_DIR = BASE_DIR / 'reference'
WORKED_EXAMPLES_DIR = BASE_DIR / 'worked-examples'
ASSETS_DIR = BASE_DIR / 'assets'
# Course structure
COURSE_JSON = BASE_DIR / 'course.json'
# Resources
RESOURCES_DIR = BASE_DIR / 'resources'
STYLES_DIR = RESOURCES_DIR / 'styles'
ICONS_DIR = RESOURCES_DIR / 'icons'
DATABASE_DIR = RESOURCES_DIR / 'database'
SYMBOLS_JSON = RESOURCES_DIR / 'symbols_definitions.json'
IMAGES_DIR = ASSETS_DIR / 'images'
# User data (created in user's home directory)
USER_HOME = Path.home()
USER_DATA_DIR = USER_HOME / '.tesla_spark_course'
USER_DATA_DIR.mkdir(exist_ok=True)
DATABASE_PATH = USER_DATA_DIR / 'progress.db'
USER_NOTES_DIR = USER_DATA_DIR / 'notes'
USER_NOTES_DIR.mkdir(exist_ok=True)
# ============================================================================
# Application Constants
# ============================================================================
APP_NAME = "Tesla Coil Spark Physics Course"
APP_VERSION = "1.0.0"
APP_AUTHOR = "Tesla Coil Community"
# ============================================================================
# UI Constants
# ============================================================================
# Window dimensions
DEFAULT_WINDOW_WIDTH = 1400
DEFAULT_WINDOW_HEIGHT = 900
MIN_WINDOW_WIDTH = 1000
MIN_WINDOW_HEIGHT = 600
# Panel sizes
NAVIGATION_PANEL_MIN_WIDTH = 250
NAVIGATION_PANEL_DEFAULT_WIDTH = 300
PROGRESS_PANEL_MIN_WIDTH = 280
PROGRESS_PANEL_DEFAULT_WIDTH = 320
CONTENT_PANEL_MIN_WIDTH = 600
# Font sizes
FONT_SIZE_SMALL = 10
FONT_SIZE_NORMAL = 12
FONT_SIZE_LARGE = 14
FONT_SIZE_TITLE = 16
# Colors (light theme)
COLOR_PRIMARY = "#3498db" # Blue
COLOR_SECONDARY = "#9b59b6" # Purple
COLOR_SUCCESS = "#27ae60" # Green
COLOR_WARNING = "#f39c12" # Orange
COLOR_DANGER = "#e74c3c" # Red
COLOR_ERROR = "#e74c3c" # Red (alias)
COLOR_INFO = "#2ecc71" # Light green
COLOR_BACKGROUND = "#ffffff" # White
COLOR_PANEL_BACKGROUND = "#f8f9fa" # Light gray
COLOR_TEXT = "#2c3e50" # Dark blue-gray
COLOR_TEXT_SECONDARY = "#7f8c8d" # Gray
COLOR_BORDER = "#dee2e6" # Light border
COLOR_HIGHLIGHT = "#e3f2fd" # Light blue
# Status colors
COLOR_STATUS_COMPLETE = "#27ae60" # Green
COLOR_STATUS_IN_PROGRESS = "#f39c12" # Orange
COLOR_STATUS_NOT_STARTED = "#95a5a6" # Gray
COLOR_STATUS_LOCKED = "#bdc3c7" # Light gray
# Progress bar colors
COLOR_PROGRESS_BG = "#ecf0f1"
COLOR_PROGRESS_FG = "#3498db"
COLOR_PROGRESS_COMPLETE = "#2ecc71"
# ============================================================================
# Course Constants
# ============================================================================
TOTAL_LESSONS = 30
TOTAL_EXERCISES = 18
TOTAL_POINTS = 525
TOTAL_PARTS = 4
# Difficulty levels
DIFFICULTY_BEGINNER = "beginner"
DIFFICULTY_INTERMEDIATE = "intermediate"
DIFFICULTY_ADVANCED = "advanced"
DIFFICULTY_COLORS = {
DIFFICULTY_BEGINNER: "#2ecc71", # Green
DIFFICULTY_INTERMEDIATE: "#f39c12", # Orange
DIFFICULTY_ADVANCED: "#e74c3c" # Red
}
# Lesson status
STATUS_NOT_STARTED = "not_started"
STATUS_IN_PROGRESS = "in_progress"
STATUS_COMPLETED = "completed"
# Status icons (Unicode)
ICON_COMPLETE = ""
ICON_IN_PROGRESS = ""
ICON_NOT_STARTED = ""
ICON_LOCKED = "🔒"
ICON_EXERCISE = ""
ICON_BOOKMARK = ""
# ============================================================================
# Progress & Gamification Constants
# ============================================================================
# Level thresholds (points)
LEVELS = [
(0, "Novice", "Circuit Curious"),
(100, "Learner", "Circuit Explorer"),
(250, "Practitioner", "Circuit Master"),
(400, "Expert", "Tesla Scholar"),
]
# Achievement definitions
ACHIEVEMENTS = {
'quick_learner': {
'name': 'Quick Learner',
'description': 'Complete first lesson in under 15 minutes',
'icon': '🏆',
'condition': 'first_lesson_under_15min'
},
'accuracy_master': {
'name': 'Accuracy Master',
'description': 'Maintain 85%+ average on exercises',
'icon': '🎯',
'condition': 'exercise_avg_85_percent'
},
'bookworm': {
'name': 'Bookworm',
'description': 'Complete Part 1 in under 3 hours',
'icon': '📚',
'condition': 'part1_under_3hours'
},
'streak_master': {
'name': 'Streak Master',
'description': 'Study for 7 consecutive days',
'icon': '🔥',
'condition': 'streak_7_days'
},
'lab_rat': {
'name': 'Lab Rat',
'description': 'Complete 5 exercises with perfect scores',
'icon': '🧪',
'condition': 'perfect_5_exercises'
},
'insight': {
'name': 'Insight',
'description': 'Average fewer than 2 hints per exercise',
'icon': '💡',
'condition': 'avg_hints_under_2'
},
'power_user': {
'name': 'Power User',
'description': 'Use 10+ keyboard shortcuts',
'icon': '',
'condition': 'shortcuts_10_plus'
},
'graduate': {
'name': 'Graduate',
'description': 'Complete all 30 lessons',
'icon': '🎓',
'condition': 'all_lessons_complete'
},
}
# ============================================================================
# Auto-save Settings
# ============================================================================
AUTO_SAVE_INTERVAL = 10000 # milliseconds (10 seconds)
PROGRESS_UPDATE_INTERVAL = 1000 # milliseconds (1 second for time tracking)
# ============================================================================
# Markdown Rendering
# ============================================================================
# MathJax CDN
MATHJAX_CDN = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
# Markdown extensions
MARKDOWN_EXTENSIONS = [
'extra',
'codehilite',
'tables',
'toc',
'pymdownx.arithmatex',
'pymdownx.superfences',
'pymdownx.highlight',
]
# ============================================================================
# Keyboard Shortcuts
# ============================================================================
SHORTCUTS = {
'next_lesson': 'Ctrl+Right',
'prev_lesson': 'Ctrl+Left',
'first_lesson': 'Ctrl+Home',
'last_lesson': 'Ctrl+End',
'search': 'Ctrl+F',
'bookmark': 'Ctrl+B',
'mark_complete': 'Ctrl+M',
'exercises': 'Ctrl+E',
'references': 'Ctrl+R',
'notes': 'Ctrl+N',
'dashboard': 'Ctrl+P',
'fullscreen': 'F11',
'quit': 'Ctrl+Q',
}
# ============================================================================
# Default User Settings
# ============================================================================
DEFAULT_SETTINGS = {
'theme': 'light',
'font_size': FONT_SIZE_NORMAL,
'auto_save': True,
'show_hints': True,
'learning_path': 'intermediate',
'auto_mark_complete': True, # Auto-mark at 95% scroll
'sound_effects': False,
}
# ============================================================================
# Debug Mode
# ============================================================================
DEBUG = True # Set to False for production
VERBOSE_LOGGING = DEBUG