A client-side web application for exploring and learning about the United States Constitution and its amendments. Built with vanilla HTML, CSS, and JavaScript - no frameworks required.
- Interactive Learning: Explore amendments through quizzes, scenarios, and reflection prompts
- Progress Tracking: XP system with awards and badges to track learning progress
- Responsive Design: Works seamlessly on desktop and mobile devices
- Dynamic Content: Amendment content loads dynamically based on URL parameters
- Modular CSS: Organized, maintainable stylesheets
This is a static web application that can be run in several ways:
Option 1: Direct File Access
Simply open index.html in your web browser.
Option 2: Local Server (Recommended)
# Using Python 3
python -m http.server
# Using Node.js http-server
npx http-server
# Using PHP
php -S localhost:8000Then navigate to http://localhost:8000 in your browser.
├── index.html # Main landing page
├── amendments.html # Amendment detail template
├── script.js # Main application logic
├── loader.js # Amendment data loading
├── amendment_data.js # Amendment content and data
├── css/ # Modular stylesheets
│ ├── main.css # Main CSS entry point
│ ├── base/ # Core styles (variables, typography)
│ ├── components/ # UI component styles
│ └── layout/ # Page layout styles
├── js/ # JavaScript modules
│ └── awards.js # Awards and XP system
└── images/ # Amendment-related images
- Home Page: Users start at
index.htmlwith amendment cards - Amendment Selection: Clicking a card opens
amendments.html?amendment=N - Dynamic Loading:
loader.jsreads the URL parameter and loads appropriate data - Content Rendering:
script.jspopulates the template with amendment content - Progress Tracking: User interactions are tracked and stored in localStorage
The application includes a gamified learning experience:
- XP Points: Earned by completing quizzes and scenarios
- Awards: Unlocked based on progress milestones
- Progress Persistence: All progress saved in browser localStorage
Storage keys:
totalUserXP: Total experience pointsuserActionScores: Completed activities trackingamendmentStatus: Amendment completion status
- Add entry to
amendment_data.jswith required structure - Include any images in the
images/directory - Update navigation links in adjacent amendments
- Add amendment card to home page if needed
The CSS is organized modularly:
- Place new styles in appropriate existing modules
- Create new module files for distinct components
- Import new modules in
main.css - Existing directories include
css/base,css/components, andcss/layout
- Quizzes: Multiple-choice questions with immediate feedback
- Scenarios: Real-world application challenges
- Collapsible Sections: Expandable content areas
- Progress Bars: Visual XP and completion indicators
Tests use a small Node-based runner located in the tests/ directory. Run all
tests with:
npm testWorks in all modern browsers that support:
- ES6 JavaScript features
- CSS Grid and Flexbox
- localStorage API
This is an educational project focused on constitutional learning. When contributing:
- Maintain the vanilla JavaScript approach (no frameworks)
- Follow existing code organization patterns
- Ensure responsive design on all screen sizes
- Test thoroughly across different browsers
Educational use project for learning about the U.S. Constitution.