// Welcome overlay for first-time users class WelcomeOverlay { constructor() { this.isVisible = false; this.hasBeenShown = localStorage.getItem('cloze-reader-welcomed') === 'true'; } show() { // Always show overlay regardless of previous views this.isVisible = true; const overlay = this.createOverlay(); document.body.appendChild(overlay); // Animate in requestAnimationFrame(() => { overlay.style.opacity = '1'; }); } createOverlay() { const overlay = document.createElement('div'); overlay.className = 'welcome-overlay'; overlay.style.opacity = '0'; const modal = document.createElement('div'); modal.className = 'welcome-modal'; modal.style.cssText = ` max-width: 500px; margin: 20px; text-align: center; `; modal.innerHTML = `
How to play: Read the passage, fill in the blanks, and use hints or chat help (💬) if needed. Progress through levels as you improve.
Data source: Randomly excerpted historical and literary texts from Project Gutenberg's public domain collection, processed via Hugging Face Datasets.
AI assistance: Powered by Google's Gemma 3 model via OpenRouter for intelligent word selection and contextual hints.