Image Lightbox - Interactive Demo Guide
๐ฌ How to Experience the Featureโ
This page demonstrates the image lightbox functionality. Try clicking on any image below to see it in action!
Example: Try It Nowโ
Below is a test scenario. If you have any images in your documentation, they will now support fullscreen viewing.
What You'll Seeโ
1๏ธโฃ Hover Stateโ
When you hover over any image:
- Cursor changes to ๐ (zoom-in)
- Image slightly enlarges (2% scale)
- Subtle shadow appears
- Magnifying glass icon appears in corner
2๏ธโฃ Click to Openโ
When you click an image:
- Screen darkens with smooth fade
- Image appears centered in fullscreen
- Close button (ร) appears in top-right
- Background blurs slightly
3๏ธโฃ Closing Optionsโ
You can close the lightbox by:
- Option A: Click anywhere on the dark background
- Option B: Click the image itself
- Option C: Click the ร close button
- Option D: Press the
ESCkey
Keyboard Shortcutsโ
| Key | Action |
|---|---|
ESC | Close lightbox |
Mouse Click | Close lightbox (on overlay or image) |
๐ฏ Features in Actionโ
โ Automatic Detectionโ
- No special markup needed
- Works with all markdown images:
 - Works with HTML images:
<img src="path" /> - Works with figure elements:
<figure><img /></figure>
โ Smart Filteringโ
The lightbox intelligently excludes:
- Navigation bar logos
- Footer icons
- Very small images (< 100px width)
- Decorative icons
โ Responsive Designโ
- Desktop: Large, centered image with close button
- Mobile: Full-screen with touch-friendly close button
- Tablet: Optimized for both orientations
โ Theme Supportโ
- Light Mode: White close button, subtle overlay
- Dark Mode: Dark close button, deeper overlay
- Automatic adaptation based on your theme
๐จ Visual Indicatorsโ
Before Clickโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ โ
โ โ
โ [Your Image] โ โ Slightly scaled up on hover
โ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Cursor: zoom-in
After Clickโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโ ร โโโ โ Close button
โโโ โโโ
โโโ โโโโโโโโโโโโโโโโโโโโ โโโ
โโโ โ โ โโโ
โโโ โ โ โโโ
โโโ โ [Full Image] โ โโโ
โโโ โ โ โโโ
โโโ โ โ โโโ
โโโ โโโโโโโโโโโโโโโโโโโโ โโโ
โโโ โโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Dark overlay (95% opacity)
๐งช Test Casesโ
Try these scenarios to test the lightbox:
Test 1: Basic Clickโ
- Find any documentation page with images
- Click on an image
- Verify it opens in fullscreen
- Click outside the image to close
Test 2: Keyboard Navigationโ
- Click an image to open lightbox
- Press
ESCkey - Verify lightbox closes
Test 3: Close Buttonโ
- Click an image to open lightbox
- Click the ร button in top-right corner
- Verify lightbox closes
Test 4: Page Navigationโ
- Click an image to open lightbox
- Close it
- Navigate to another page
- Click another image
- Verify it still works
Test 5: Theme Switchingโ
- Open an image in lightbox (light mode)
- Close it
- Switch to dark mode
- Open another image
- Verify dark mode styling
๐ฑ Mobile Testingโ
On mobile devices:
- Tap image to open
- Tap anywhere to close
- Swipe gestures don't affect lightbox
- Close button is touch-friendly (40px size)
๐ญ Animation Timelineโ
Click Image โ 300ms fade in โ Lightbox Open โ Click Close โ 300ms fade out โ Closed
Animation Details:โ
- Fade In: 300ms ease transition
- Scale Effect: Image starts at 90%, scales to 100%
- Overlay: Fades from 0% to 95% opacity
- Fade Out: 300ms ease transition on close
๐ Advanced Usageโ
Multiple Images on Pageโ
- Each image maintains its own state
- Lightbox reuses the same overlay
- Smooth transitions between images
Dynamic Contentโ
- Lightbox auto-detects new images
- Works with dynamically loaded content
- MutationObserver watches for changes
๐ ๏ธ Developer Infoโ
CSS Classes Addedโ
.lightbox-enabled- Added to clickable images.image-lightbox-overlay- The dark background.image-lightbox-container- Image wrapper.image-lightbox-img- The fullscreen image.image-lightbox-close- Close button
Eventsโ
click- Image click handlerkeydown- ESC key handlerMutationObserver- DOM change detection
Performanceโ
- First Click: ~5ms (creates overlay)
- Subsequent Clicks: ~1ms (reuses overlay)
- Memory: Minimal (single overlay reused)
- No Layout Shift: Fixed positioning
๐ Browser Supportโ
| Browser | Support | Notes |
|---|---|---|
| Chrome 90+ | โ Full | Recommended |
| Firefox 88+ | โ Full | Fully tested |
| Safari 14+ | โ Full | Works perfectly |
| Edge 90+ | โ Full | Chromium-based |
| Chrome Android | โ Full | Touch optimized |
| Safari iOS | โ Full | Touch optimized |
๐ก Tipsโ
- Best Practice: Use high-resolution images for better fullscreen quality
- Performance: Images lazy-load, no performance impact
- Accessibility: Always include
alttext for images - Mobile: Ensure images are responsive in markdown
๐ Enjoy!โ
The lightbox feature is now active on all your documentation images. Happy documenting! ๐
This feature works automatically - no configuration needed.