This is an election dashboard.
Here are the specs
- Complete list of 50 US states
- Electoral vote count for each state
- State name as display label
- States must be maintained in alphabetical order
- Popular vote count for Harris
- Popular vote count for Trump
- Percentage of total votes counted (0-100)
- Called status for Harris (boolean)
- Called status for Trump (boolean)
-
Split into two distinct sections:
- Total electoral votes for Harris from called states
- Total electoral votes for Trump from called states
- Number of states called for each candidate
- Clear indication of 270 votes needed to win
- Running total of votes for Harris across all states
- Running total of votes for Trump across all states
- Number of states reporting any votes
- Vote counts formatted with thousands separators
- Alphabetical list of all states
- State name with electoral vote count
- Input field for Harris votes
- Input field for Trump votes
- Input field for percentage reporting
- Call state checkboxes for each candidate
- Visual indicator of percentage counted
- Color coding to indicate:
- Called state (dark blue/red)
- Current vote leader (light blue/red)
- Uncalled/no votes (gray)
- Accept numerical inputs only
- No negative numbers allowed
- Automatically update totals on input
- Allow clearing/resetting of values
- Percentage reporting must be 0-100
- Toggle call status via checkbox
- Only one candidate can have a state called at a time
- Uncalling a state removes electoral votes from total
- Calling for one candidate automatically uncalls for other
- Sum all entered votes for each candidate
- Update in real-time as votes are entered
- Track number of states with any votes entered
- Only count electoral votes from called states
- Update immediately when states are called/uncalled
- Track number of states called for each candidate
- Vote counts must be non-negative integers
- Percentage reported must be between 0 and 100
- Empty inputs treated as zero
- Prevent simultaneous calls for both candidates
- Allow uncalling at any time
- Allow calling regardless of vote counts or reporting percentage
- Harris: Blue (#2563EB for called, lighter for leading)
- Trump: Red (#DC2626 for called, lighter for leading)
- Gray (#666666) for uncalled states
- Light gray (#F9FAFB) for summary background
- Summary cards at top
- Scrollable state list below
- Consistent spacing between elements
- Clear visual hierarchy
- Mobile-responsive design
- Immediate recalculation of totals on any change
- No noticeable delay in UI updates
- Smooth scrolling through state list
- Handle large vote numbers (millions)
- Proper number formatting
- Efficient state management
- Maintain vote counts during session
- Maintain called status during session
- Clear data on page refresh
- Atomic updates to vote counts
- Immediate reflection of changes in UI
- Maintain consistency between popular and electoral counts
- Clear input labels
- Keyboard navigation support
- Screen reader compatibility
- Proper ARIA labels
- Sufficient color contrast
- Clear visual indicators
- Non-color dependent status indicators
- Save/load functionality
- Export results
- Historical tracking
- Sort states by various criteria
- Filter states by status
- Detailed state statistics
- Victory detection
- Timeline tracking