WordHunt - Transform Focus into Fun
1. Inspiration
In today's hyper-connected digital world, maintaining focus has become one of the biggest challenges for students and professionals alike. We've all been there - opening a webpage to learn something new, only to find ourselves mindlessly scrolling hours later, our time lost to digital distractions.
Current solutions either block websites entirely (creating frustration) or ignore the problem (allowing endless procrastination). We asked ourselves: "What if we could transform procrastination into productivity through gamification?"
Enter WordHunt - a Chrome extension that doesn't just block distracting websites, but instead encourages users to engage meaningfully with the content they're viewing. By extracting words from the current webpage and turning them into an interactive word-hunt challenge, we help users take productive micro-breaks that reinforce learning rather than mindless scrolling.
Just as the Pomodoro technique transforms work into manageable chunks, WordHunt transforms reading breaks into engaging learning experiences.
2. What It Does
WordHunt is an intelligent Chrome extension that transforms any webpage into an engaging word-hunting game, creating productive micro-breaks that enhance focus and retention.
2.1 Core Features
2.1.1 Intelligent Word Extraction
- Analyzes current webpage content using advanced DOM traversal
- Filters out common stop words ("the", "and", "with", etc.)
- Extracts top 80 meaningful words based on frequency analysis
- Preserves page-relevant vocabulary for contextual learning
2.1.2 Immersive Game Overlay
When triggered (manually or via auto-timer), a stunning full-screen overlay appears featuring:
- 20 floating word bubbles dynamically spawned without collision
- Target word display with animated glowing underline
- Real-time timer (60 seconds default) with urgency states
- Live score tracking (+1 correct, -1 wrong)
- Smooth animations at 60fps using requestAnimationFrame
2.1.3 Five Beautiful Themes
Switch between professionally designed color schemes:
- Ocean - Dark blue with cyan accents (default)
- Sunset - Warm oranges and golden hues
- Forest - Natural greens with teal highlights
- Galaxy - Deep purples with neon accents
- Cyber - Dark tech with electric cyan/green
2.1.4 Engaging Visual Effects
- Glowing trails that expand from clicked words
- Confetti bursts celebrating correct answers
- Spotlight effects highlighting target words
- Timer urgency - Yellow warning at 30s, red danger at 10s
- Smooth floating animations with subtle vibrations
2.1.5 Smart Scoring System
- +1 point for each correct word found
- -1 point for incorrect clicks
- Auto-regeneration when fewer than 5 words remain
- Score persistence across sessions
2.1.6 AI-Powered Summary (Ready for Chrome Built-in AI)
At game end, receive encouraging messages highlighting:
- Total words mastered
- Key concepts discovered from the page
- Motivational feedback for focus improvement
3. How We Built It
3.1 Architecture Overview
WordHunt is built as a Chrome Extension (Manifest V3) with a modular architecture:
WordHunt/
├── manifest.json # Extension configuration
├── background.js # Service worker for alarms & storage
├── content_script.js # Game logic & overlay injection
├── popup.html/js # User control interface
└── icons/ # Extension icons
3.2 Technology Stack
- Manifest V3 - Modern Chrome extension architecture
- Vanilla JavaScript - Lightweight and performant
- CSS3 - Advanced animations and theming
- Chrome APIs - Storage, Alarms, and Messaging
- DOM TreeWalker - Efficient text extraction
4. Challenges We Ran Into
4.1 Word Collision Prevention
Problem: Words overlapping made them unreadable and game unplayable.
Solution: Implemented spatial hashing collision detection:
- Pre-calculate word dimensions before placement
- Check 30px minimum spacing on all sides
- Retry placement up to 100 times per word
- Fallback to safe positions if collision persists
4.2 Performance Optimization
Problem: Large webpages (news articles, documentation) caused lag and freezing.
Solution: Multi-pronged optimization approach:
- Limited text traversal to 20,000 characters
- Used Set for O(1) stop word lookup instead of array
- Implemented requestAnimationFrame for smooth 60fps
- Added GPU acceleration hints with will-change CSS
Performance Metrics:
- Before: ~500ms extraction, 30fps animations
- After: ~50ms extraction, 60fps animations
4.3 Animation Smoothness
Problem: Early versions had janky, stuttering animations.
Solution:
- Migrated from setInterval to requestAnimationFrame
- Proper cleanup with cancelAnimationFrame on element removal
- Used CSS transforms instead of position changes
- Added isConnected checks to prevent animating removed elements
4.4 Theme Persistence
Problem: Switching themes caused visual glitches and color flashing.
Solution:
- CSS custom properties for instant theme switching
- Proper class clearing before reapplication
- Theme state storage in chrome.storage.local
- Smooth transition animations
4.5 Timer Accuracy
Problem: Game timer would drift and lose sync.
Solution:
- Separate interval for UI updates versus game logic
- Progressive urgency states (normal → warning → danger)
- Clear interval cleanup on game end
- Added visual feedback for time pressure
4.6 Z-index Management
Problem: Confetti and trail effects rendering behind word bubbles.
Solution:
- Used position: fixed for all effects
- Established z-index hierarchy (9999998-9999999)
- Appended effects to document.body instead of overlay
- Ensured proper stacking context
5. Accomplishments That We're Proud Of
5.1 Beautiful Visual Design
- Five professionally designed themes with cohesive color palettes
- Smooth 60fps animations across all interactions
- Satisfying visual feedback (trails, confetti, glows)
5.2 Engaging Gameplay
- Successfully gamified learning without feeling educational
- Balanced difficulty that adapts to remaining words
- Addictive feedback loop that encourages replay
5.3 Technical Excellence
- Optimized performance for large webpages
- Clean, modular code architecture
- Robust collision detection system
6. What We Learned
6.1 Chrome Extension Development
- Deep understanding of Manifest V3 architecture
- Content script injection and isolation
- Background service worker lifecycle
- Message passing between components
- Chrome Storage API for persistence
- Alarms API for scheduling
6.2 DOM Manipulation & Performance
- Efficient TreeWalker API for text extraction
- Collision detection spatial algorithms
- RequestAnimationFrame for smooth animations
- GPU acceleration with CSS transforms
- Memory management and cleanup
6.3 CSS Architecture
- CSS custom properties for theming
- Animation performance optimization
- Z-index stacking contexts
- Flexbox for responsive layouts
- Keyframe animations
6.4 Game Design Psychology
- Reward feedback loops
- Progressive difficulty curves
- Visual feedback importance
- Balancing challenge and fun
- Creating addictive mechanics
6.5 Accessibility Considerations
- Color contrast ratios
- Keyboard navigation
- Screen reader compatibility (future implementation)
- Cognitive load management
7. What's Next for WordHunt
7.1 Phase 1: Enhanced Gameplay
7.1.1 Combo/Streak System
Track consecutive correct answers:
- 3+ streak: 2x points
- 5+ streak: 3x points with visual effects
- Streak counter with fire animation
7.1.2 Power-ups
- Freeze Time - Pause timer for 5 seconds
- Highlight Target - Make target word glow
- Double Points - 2x score for 10 seconds
- Slow Motion - Reduce word movement speed
7.1.3 Difficulty Levels
- Easy - 15 words, 90 seconds
- Medium - 20 words, 60 seconds
- Hard - 25 words, 45 seconds, faster movement
7.2 Phase 2: Gamification & Progress
7.2.1 Achievement Badges
- Speed Demon - 10 words in 30 seconds
- Perfect Game - No wrong answers
- Marathon - 50+ correct in one game
- Streak Master - 10 consecutive correct answers
7.2.2 Advanced Statistics Dashboard
- Words per minute (WPM) tracking
- Accuracy percentage graphs
- Personal best records
- Progress over time visualization
- Circular timer progress indicator
7.2.3 Level System
- XP bar that fills with each correct answer
- Level-up animations and rewards
- Unlockable themes and power-ups
7.3 Phase 3: AI Integration
7.3.1 Chrome Built-in AI (Gemini Nano)
- Personalized difficulty adjustment based on performance
- Intelligent word selection matching user interests
- Context-aware hints and tips
- Natural language feedback and encouragement
- Learning pattern analysis
7.3.2 Smart Features
- AI-generated word categories (Tech, Science, Business)
- Adaptive timer based on user speed
- Predictive difficulty scaling
- Personalized challenge recommendations
7.4 Phase 4: Social & Multiplayer
7.4.1 Multiplayer Mode
- Real-time competitive mode with friends
- Shared game sessions with live leaderboards
- Challenge friends to beat your score
7.4.2 Social Features
- Share achievements on social media
- Global leaderboard rankings
- Daily and weekly challenges
- Friend system and competitions
7.5 Phase 5: Polish & Expansion
7.5.1 Audio Experience
- Success chime on correct clicks
- Error buzz on wrong answers
- Ticking clock when fewer than 10 seconds remain
- Victory fanfare on game end
- Mute toggle for quiet environments
7.5.2 Visual Enhancements
- Particle effects on correct answers
- Screen shake feedback
- Lightning bolt connecting words
- Ripple wave effects
- Aurora borealis background animation
7.5.3 Cross-Platform Support
- Firefox extension port
- Microsoft Edge browser support
- Safari extension (future)
- Progressive Web App version
7.5.4 Internationalization
- Multi-language support (Spanish, French, German, Japanese)
- i18n framework integration
- Localized word extraction
7.5.5 Cloud Features
- Cross-device score synchronization
- Cloud backup of preferences
- Achievement synchronization across devices
Version: 1.0
Last Updated: 2024
Status: Active Development
Built With
- css3
- dom
- html5
- javascript
- manifest
- text
Log in or sign up for Devpost to join the conversation.