This project delivers an interactive, stylish, and fun Photo Gallery section for the CollegeTips official website. Designed to showcase the vibrant moments of CollegeTips' team, campaigns, and events, this gallery is built using standard web technologies (HTML, CSS, JavaScript) focusing on user experience, responsiveness, and visual appeal.
- Categorized Albums: Photos are organized into intuitive categories:
- Team Vibes
- Different Schemes
- Work Hard, Play Hard
- Behind-The-Scenes
- Office Tour
- Dynamic Filtering: Users can easily sort photos by category using interactive filter buttons.
- Engaging Hover Effects: Each photo item features:
- Zoom-in Effect: A subtle zoom on the image when hovered.
- Caption Overlay: A descriptive caption slides up from the bottom on hover.
- Fullscreen Lightbox View: Clicking on any thumbnail opens a larger, immersive view of the image with its caption.
- Responsive Design: The gallery is fully responsive, ensuring an optimal viewing experience across various devices (desktops, tablets, mobile phones).
- Dark/Light Mode Toggle: A user-friendly switch allows users to toggle between dark and light themes, enhancing accessibility and user preference.
- HTML5: For structuring the web page content.
- CSS3: For styling, layout, animations, transitions, and responsive design (using Media Queries).
- JavaScript (Vanilla JS): For handling all interactive functionalities including filtering, fullscreen view, and theme switching.
- Font Awesome: Used for convenient iconography (sun, moon, category icons).
To set up and view this photo gallery on your local machine, follow these simple steps:
-
Clone or Download: Get the project files. If using Git:
git clone https://github.com/aadithyaa9/gallery.git cd <your-repository-name>
Alternatively, download the ZIP file and extract it.
-
Project Structure: Ensure your folder structure looks like this:
collegetips-gallery/ ├── index.html ├── style.css ├── script.js └── images/ bunch of imagesImportant: Make sure all your image files are placed inside the
images/folder and their filenames match those referenced inindex.html. (e.g.,images/team1.jpg,images/creative1.jpg). -
Open in Browser: Simply double-click the
index.htmlfile. It will open in your default web browser, and you can interact with the gallery.
- Clean Separation of Concerns: HTML for structure, CSS for presentation, and JavaScript for behavior are kept in separate files for better maintainability.
- Semantic HTML: Used appropriate HTML5 tags (
<header>,<main>,<section>,<footer>) for better accessibility and SEO. - CSS Variables (Custom Properties): Employed CSS variables (
--light-bg,--dark-text, etc.) for efficient theme management, making it easy to switch between dark and light modes with minimal code duplication. - Flexible Box (
flexbox) and Grid (grid) Layouts: Utilized modern CSS layout techniques for robust and responsive positioning of elements, especially for the filter buttons and the image gallery grid. - Event Delegation (JavaScript): For filter buttons, event listeners are attached to a parent element where possible to improve performance and manage dynamically added elements.
- Local Storage for Theme: The selected dark/light mode preference is saved in
localStorage, so the user's choice persists across browser sessions. - Accessibility Considerations: Focused on clear visual feedback for interactive elements (hover states, active filter buttons) and keyboard accessibility for the fullscreen overlay (Escape key).
-
Image Aspect Ratios in Grid:
- Challenge: Ensuring all images in the grid had a consistent visual size and layout despite varying original aspect ratios, preventing layout shifts.
- Solution: Applied
height: 250px;andobject-fit: cover;to the<img>tags within.gallery-item. This crops images to fit the container while maintaining their aspect ratio, providing a uniform grid.
-
Responsive Layout for Filters & Gallery:
- Challenge: Making the filter buttons and the main photo grid adapt gracefully to different screen sizes, especially on mobile devices.
- Solution: Employed CSS Flexbox for the filter buttons (
flex-wrap: wrap;) and CSS Grid withrepeat(auto-fit, minmax(Xpx, 1fr))for the gallery items. Media queries (@media (max-width: 768px), etc.) were used to adjust specific properties like font sizes, padding, and button widths for smaller screens.
-
Smooth Dark/Light Mode Transition:
- Challenge: Ensuring a smooth visual transition when toggling between dark and light modes, avoiding abrupt changes.
- Solution: Applied
transition: background-color var(--transition-speed), color var(--transition-speed);to relevant elements likebody,header, andfooter. CSS variables (--transition-speed) helped centralize the transition duration.
-
Fullscreen Overlay Management:
- Challenge: Correctly showing/hiding the fullscreen overlay, handling clicks inside/outside the image, and closing with the Escape key.
- Solution: Used
opacityandvisibilityCSS properties with transitions for smooth fading. JavaScript event listeners were added for the close button, clicks on the overlay background (event delegation), and akeydownlistener for the 'Escape' key.
Thank you for the opportunity to work on this exciting project! I have enjoyed designing and developing a fully responsive, interactive photo gallery that captures the essence of CollegeTips.# gallery