-
Notifications
You must be signed in to change notification settings - Fork 447
[FEATURE] CSS-only Image Lightbox Gallery (Advanced Component) #7835
Copy link
Copy link
Closed
Labels
GSSoC-26Official GSSoC 2026 issueOfficial GSSoC 2026 issueacceptedContribution approved for integration into EaseMotion CSSContribution approved for integration into EaseMotion CSSanimationAnimation effects, hover interactions, motion ideas, transitionsAnimation effects, hover interactions, motion ideas, transitionsgood first issueGood for newcomersGood for newcomersgssoc:approvedApproved for GSSoC contributionsApproved for GSSoC contributionshelp wantedExtra attention neededExtra attention neededlevel:intermediateRequires moderate project understandingRequires moderate project understandingtype:featureNew functionality or enhancementNew functionality or enhancement
Metadata
Metadata
Labels
GSSoC-26Official GSSoC 2026 issueOfficial GSSoC 2026 issueacceptedContribution approved for integration into EaseMotion CSSContribution approved for integration into EaseMotion CSSanimationAnimation effects, hover interactions, motion ideas, transitionsAnimation effects, hover interactions, motion ideas, transitionsgood first issueGood for newcomersGood for newcomersgssoc:approvedApproved for GSSoC contributionsApproved for GSSoC contributionshelp wantedExtra attention neededExtra attention neededlevel:intermediateRequires moderate project understandingRequires moderate project understandingtype:featureNew functionality or enhancementNew functionality or enhancement
Description
I propose adding another high-difficulty, pure CSS interactive component: an Image Lightbox Gallery. This component will allow developers to display a grid of thumbnail images. When a user clicks a thumbnail, the image smoothly expands to fill the screen in a dark, modal-like overlay, complete with a close button and smooth entry animations.
This implementation will completely avoid JavaScript, relying entirely on the CSS :target pseudo-class and HTML anchor links to manage the state of the lightbox.
Why is this useful for EaseMotion CSS?
Lightboxes are an essential feature for portfolios, e-commerce sites, and blogs. Just like carousels, developers usually import large third-party JavaScript libraries (like Fancybox or Lightbox2) simply to enlarge an image. By providing a pure CSS solution that hooks into the browser's URL hash (via :target), EaseMotion CSS offers an incredibly performant, zero-dependency alternative that is fully accessible and inherently supports the browser's "Back" button to close the image!
HTML Snippet
html
/* Flexbox centering */
display: flex;
justify-content: center;
align-items: center;
/* Hidden state /
opacity: 0;
visibility: hidden;
pointer-events: none;
transition: opacity var(--ease-speed-medium) var(--ease-ease),
visibility var(--ease-speed-medium) var(--ease-ease);
}
/
/
.ease-lightbox-overlay:target {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
/ Invisible clickable area behind the image to close the lightbox /
.ease-lightbox-close-area {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
cursor: zoom-out;
}
/ Centered Image Content /
.ease-lightbox-content {
position: relative;
z-index: 2;
max-width: 90vw;
max-height: 90vh;
}
.ease-lightbox-content img {
max-width: 100%;
max-height: 90vh;
object-fit: contain;
border-radius: var(--ease-radius-md);
box-shadow: var(--ease-shadow-lg);
}
/ Explicit Close Button */
.ease-lightbox-close-btn {
position: absolute;
top: -40px;
right: 0;
color: white;
font-size: 2rem;
text-decoration: none;
line-height: 1;
transition: color var(--ease-speed-fast) var(--ease-ease);
}
.ease-lightbox-close-btn:hover {
color: var(--ease-color-primary);
}
Visual Reference (optional)
N/A
Checklist
I have read the
CONTRIBUTING.md
document.
I have checked for existing issues proposing the same feature.
I understand that my proposed class names or structure may be modified by the maintainer.