Product Detail Lens
A magnified detail window lets shoppers inspect texture within a product photograph.
A magnified detail window lets shoppers inspect texture within a product photograph.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
<div class="tbx-1082" tabindex="0" aria-label="Canvas bag detail preview"><div class="tbx-1082__pic" aria-hidden="true"><span class="tbx-1082__strap"></span><span class="tbx-1082__bag"></span><span class="tbx-1082__lens">TEXTURE<br><b>× 2.0</b></span></div><div class="tbx-1082__body"><b>CANVAS TOTE</b><small>Inspect the canvas texture</small></div></div>
.tbx-1082{width:min(267px,100%);background:white;border:1px solid #d6e2e7;border-radius:10px;overflow:hidden;font:11px/1.4 system-ui,sans-serif;color:#314e59;transition:border-color .3s}
.tbx-1082__pic{position:relative;height:145px;background:radial-gradient(circle at 40% 38%,#f3e4ca 0 10%,#dfc4a0 72%);display:grid;place-items:center;overflow:hidden}
.tbx-1082__strap{position:absolute;top:20px;width:78px;height:78px;border:11px solid #aa7a4f;border-radius:50% 50% 15% 15%;filter:drop-shadow(2px 3px 2px #765a3c3d)}
.tbx-1082__bag{position:absolute;bottom:7px;width:130px;height:102px;background:repeating-linear-gradient(90deg,#d0ad7e 0 3px,#c6a576 4px 6px);clip-path:polygon(3% 0,97% 0,100% 100%,0 100%);box-shadow:inset -10px 0 #9c754e46;border-bottom:8px solid #ac835b}
.tbx-1082__lens{position:absolute;right:14px;top:14px;width:82px;height:82px;border-radius:50%;display:grid;align-content:center;justify-items:center;gap:2px;background:repeating-linear-gradient(45deg,#c99c68 0 3px,#e6c598 4px 7px);border:4px solid white;box-shadow:0 6px 18px #513e362d;transform:translate(22px,20px) scale(.5);opacity:0;transition:transform .4s,opacity .35s;text-align:center;color:#503a2a;font:800 9px/1.2 system-ui,sans-serif}
.tbx-1082__lens b{font-size:13px}.tbx-1082__body{display:flex;justify-content:space-between;gap:10px;padding:14px 15px}.tbx-1082__body b{font-size:10px}.tbx-1082__body small{font-size:9px;color:#8298a2}
.tbx-1082:is(:hover,:focus-visible){border-color:#af8b64}.tbx-1082:is(:hover,:focus-visible) .tbx-1082__lens{opacity:1;transform:translate(0,0) scale(1)}
.tbx-1082:focus-visible{outline:3px solid #c79e65;outline-offset:3px}
@media(prefers-reduced-motion:reduce){.tbx-1082,.tbx-1082 *{transition:none!important}}
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for ec sections and product detail sections.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile: Ensure the interactive content remains accessible without hover on touch devices.
Browser: Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion: Check that prefers-reduced-motion is respected.