Skip to content

Instantly share code, notes, and snippets.

@grittyninja
Last active August 21, 2025 07:11
Show Gist options
  • Select an option

  • Save grittyninja/788cb5aed47321d4f3272810ef7949a7 to your computer and use it in GitHub Desktop.

Select an option

Save grittyninja/788cb5aed47321d4f3272810ef7949a7 to your computer and use it in GitHub Desktop.
=== LaundyBench ===
You are an expert frontend developer specializing in modern, high-performance landing pages with exceptional attention to visual design and user experience. Create a visually stunning laundry service landing page for "GoGoWash" that captures users' attention with contemporary design trends. Structure your solution as three separate files: index.html, style.css, and script.js. Design with a blue and white color scheme featuring smooth, subtle microanimations distributed evenly across ALL sections (not just the first two). Implement non-intrusive floating bubble animations that enhance rather than distract from the content, ensuring they work seamlessly on both desktop and mobile devices.
Build the page with exactly 5-7 distinct sections following this logical flow: (1) Hero section with animated headline and CTA, (2) Services showcase with hover effects, (3) Features/benefits with scroll-triggered animations, (4) Pricing or process explanation with interactive elements, (5) Testimonials with subtle transitions, (6) Contact/booking form with validation feedback, and (7) Footer with links and social media. Critical requirements: Implement smooth scrolling between all sections, ensure full mobile responsiveness with proper breakpoints, create a sticky navigation header that changes on scroll, apply microanimations consistently throughout EVERY section (avoid front-loading animations), use CSS transforms and transitions for performance, and include JavaScript for interactive elements like form validation, scroll effects, and dynamic content loading. The bubble animation should use CSS keyframes with varying sizes and speeds, creating depth without overwhelming the clean, professional aesthetic expected from a modern laundry service.
=== 8PoolBench ===
# Expert-Level 8-Ball Pool Game Development Prompt
## Role Assignment
You are a **senior full-stack game developer** with 10+ years of experience in physics-based web games, HTML5 Canvas API, and real-time interactive applications. Your expertise includes advanced collision detection, realistic physics simulation, and smooth user interactions.
## Primary Objective
Create a **professional-grade 8-ball pool game** with realistic physics using exactly three files: one HTML, one CSS, and one JavaScript file. The game must deliver a premium gaming experience comparable to commercial pool games.
## Technical Requirements & Implementation Strategy
### Phase 1: Foundation Architecture
```
Step 1: Set up HTML5 Canvas with proper scaling and responsive design
Step 2: Initialize physics engine with accurate ball mechanics
Step 3: Implement realistic collision detection system
Step 4: Create smooth rendering loop with proper frame timing
```
### Phase 2: Physics Implementation (Critical Priority)
**Ball Physics Requirements:**
- **Realistic momentum conservation** during ball-to-ball collisions
- **Friction coefficient** that gradually slows balls naturally
- **Spin mechanics** (top spin, back spin, side spin) affecting ball trajectory
- **Rail bouncing** with proper angle reflection and energy loss
- **Rolling resistance** that creates authentic ball deceleration
- **Mass-based collision response** (all balls same mass, but cue ball user-controlled force)
**Advanced Physics Features:**
- Implement **elastic collision formulas** for accurate ball interactions
- Add **angular velocity** for realistic ball spinning
- Include **surface friction** that affects rolling vs sliding
- Create **cushion compression** simulation for rail bounces
### Phase 3: Game Logic & Rules
**Core 8-Ball Pool Rules:**
- Proper ball racking (triangle formation, 8-ball in center)
- Turn-based gameplay (solids vs stripes assignment after first legal pot)
- Legal shot validation (hitting your group first)
- Foul detection and ball-in-hand penalties
- Win/lose conditions (pot 8-ball after clearing your group)
### Phase 4: User Interface & Controls
**Essential UI Components:**
- Cue stick visualization with aiming line
- Power gauge with visual feedback
- Player turn indicators
- Ball count tracking per player
- Shot trajectory prediction (dotted line)
- Game state notifications
## Code Structure Requirements
### HTML File Specifications:
```html
- Single HTML5 file with semantic structure
- Canvas element optimized for full physics rendering
- Responsive viewport configuration
- Embedded CSS and JavaScript (no external dependencies)
```
### CSS Styling Requirements:
```css
- Modern, clean interface design
- Smooth animations and transitions
- Responsive layout that works on different screen sizes
- Dark theme with green felt table appearance
- Professional typography and spacing
```
### JavaScript Architecture:
```javascript
- Modular code organization with clear separation of concerns
- Physics engine class with proper encapsulation
- Game state management system
- Event handling for mouse/touch interactions
- Optimization for 60fps performance
```
## Implementation Guidelines
### DO Implement:
✓ **Realistic physics calculations** using proper mathematical formulas
✓ **Smooth user interactions** with responsive controls
✓ **Professional visual polish** with attention to detail
✓ **Robust game state management** handling all edge cases
✓ **Performance optimization** for smooth 60fps gameplay
✓ **Mobile-friendly touch controls** alongside mouse support
### DO NOT Include:
✗ External libraries or frameworks (pure vanilla implementation)
✗ Placeholder physics or "fake" ball movement
✗ Simplified collision detection that breaks realism
✗ Laggy or choppy animations
✗ Incomplete game rules or missing win conditions
## Success Criteria
### Technical Excellence:
1. **Physics Accuracy**: Ball movements must feel indistinguishable from real pool
2. **Performance**: Consistent 60fps with 16 balls moving simultaneously
3. **Responsiveness**: Input lag under 16ms for professional feel
4. **Visual Quality**: Smooth animations with proper interpolation
### Gameplay Quality:
1. **Rule Compliance**: Perfect implementation of official 8-ball rules
2. **User Experience**: Intuitive controls that feel natural
3. **Game Flow**: Seamless transitions between turns and game states
4. **Polish Level**: Production-ready quality with no obvious bugs
## Expected Output Format
Provide exactly three code files:
```
1. index.html - Complete HTML structure with embedded CSS and JS
2. styles.css - All styling and visual design
3. game.js - Complete game logic and physics engine
```
## Chain-of-Thought Development Process
**Think through this step-by-step:**
1. **Physics Foundation**: "How do real pool balls behave? What are the mathematical formulas for elastic collisions, friction, and angular momentum?"
2. **Collision Detection**: "What's the most efficient way to detect when balls collide while maintaining accuracy for fast-moving objects?"
3. **User Interaction**: "How can I make the cue stick feel responsive and intuitive? What visual feedback helps players aim accurately?"
4. **Game State**: "How do I track which balls belong to which player? When should fouls be called? How do I handle the 8-ball endgame?"
5. **Performance**: "What optimizations ensure smooth gameplay even with complex physics calculations running every frame?"
## Final Quality Check
Before submitting, verify that your implementation:
- [ ] Passes realistic physics tests (balls behave like real pool balls)
- [ ] Implements complete 8-ball rules without exceptions
- [ ] Provides smooth, responsive user experience
- [ ] Works flawlessly across different browsers and devices
- [ ] Demonstrates professional-level code quality and organization
**Remember**: This should be a production-ready game that showcases your expertise in physics simulation, game development, and web technologies. The end result should feel like a commercial-quality pool game that players would genuinely enjoy using.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment