A responsive photo gallery with real-time search and lightbox viewing. Built with vanilla JavaScript to showcase modern frontend development skills including DOM manipulation, CSS Grid layout, and accessibility best practices.
- Real-time Search β Instantly filter photos by caption or title as you type
- Custom Lightbox β Full-screen image viewer with smooth navigation
- Responsive Design β Seamless experience across mobile, tablet, and desktop
- Keyboard Navigation β Arrow keys and Escape for accessibility
- Modern UI β Clean interface with smooth hover effects and transitions
- Performance Optimized β Fast loading with thumbnail images and efficient CSS Grid
- HTML5 β Semantic markup with ARIA labels for accessibility
- CSS3 β CSS Grid layout, Flexbox, custom properties, and smooth animations
- JavaScript (ES6+) β Vanilla JS with class-based architecture and modern DOM APIs
- No frameworks or libraries β In transition from Fancybox to pure vanilla JavaScript implementation
# Clone the repository
git clone https://github.com/brianwalkerdev/interactive-photo-gallery-vanilla-javascript.git
# Navigate to project directory
cd interactive-photo-gallery-vanilla-javascript
# Open in browser (no build required for development)
open index.html# Install dependencies (optional - only needed for npm scripts)
npm install
# Start local development server at http://localhost:8080
npm start# Generate optimized static files in dist/ folder
npm run buildThe build script copies all necessary files to the dist/ directory, ready for deployment.
This project works out-of-the-box on all static hosting platforms. Choose your preferred service:
- Push your code to GitHub
- Navigate to Settings β Pages
- Select your branch and root folder
- Your site will be live at
https://yourusername.github.io/repo-name/
Option 1: Drag and Drop
- Run
npm run buildto create thedist/folder - Drag the
dist/folder to Netlify Drop
Option 2: Git Integration
- Connect your GitHub repository
- Set build command:
npm run build - Set publish directory:
dist
# Install Vercel CLI globally
npm install -g vercel
# Deploy to production
vercel --prodWorks with any static hosting service (Firebase Hosting, Surge, Render, etc.). Simply upload the root files or run npm run build and upload the dist/ folder.
interactive-photo-gallery-vanilla-javascript/
βββ css/
β βββ normalize.css # CSS reset for cross-browser consistency
β βββ styles.css # Main styles with CSS Grid and animations
βββ js/
β βββ lightbox.js # Custom lightbox implementation
β βββ search.js # Real-time search filter
βββ photos/
β βββ thumbnails/ # Optimized thumbnail images (220px height)
β βββ *.jpg # Full-resolution images
βββ index.html # Main HTML file
βββ thumbnail.png # Project thumbnail (1280x640)
βββ package.json # Project metadata and scripts
βββ build.js # Production build script
βββ LICENSE # MIT License
The search feature filters images in real-time by matching input against photo titles and captions. Uses case-insensitive comparison and provides instant visual feedback.
Built from scratch without external libraries, the lightbox provides:
- Smooth fade-in animations
- Keyboard navigation (β β arrows, Escape to close)
- Click navigation with Previous/Next buttons
- Background click to close
- Image captions with titles
- Body scroll lock when active
Uses CSS Grid with auto-fill and minmax() for fluid layouts that adapt to any screen size. Breakpoints at 768px and 480px ensure optimal viewing on all devices.
- Add full-size image to
photos/folder - Add thumbnail (220px height) to
photos/thumbnails/ - Add new
<li>item inindex.htmlgallery section:
<li>
<a href="photos/your-image.jpg"
title="Your Title"
data-caption="Your caption here">
<img src="photos/thumbnails/your-image.jpg" alt="Your Title">
</a>
</li>Modify CSS variables and styles in css/styles.css. Key sections are clearly marked with comments.
This project is licensed under the MIT License - see the LICENSE file for full details.
Brian Walker
- Portfolio: brianwalker.dev
- GitHub: @brianwalkerdev
- Photography from free stock photo sources
- Inspired by modern gallery interfaces and best practices in web accessibility
Built as a portfolio project to demonstrate vanilla JavaScript proficiency, modern CSS techniques, and accessibility-first development.