/** * Leaderboard UI * Modal display and initials entry interface * Following arcade conventions with vintage aesthetic */ export class LeaderboardUI { constructor(leaderboardService) { this.service = leaderboardService; this.modal = null; this.initialsModal = null; this.currentSlot = 0; this.initials = ['A', 'A', 'A']; this.onInitialsSubmit = null; this.canSubmitInitials = false; // Prevent accidental immediate submission } /** * Show the leaderboard modal */ show() { // Remove existing modal if any this.hide(); const data = this.service.getFormattedLeaderboard(); const playerStats = this.service.getPlayerStats(); // Create modal HTML this.modal = document.createElement('div'); this.modal.className = 'leaderboard-overlay'; this.modal.innerHTML = `
No high scores yet!
Be the first to reach Level 2!
Enter or update your initials:
Type your 3-letter initials directly
Use arrow keys ↑↓ to change letters
Press Tab or ←→ to move between slots
Press Enter to submit