CSS Mask Image Generator - Online Reveal Effects
Create CSS mask‑image effects with custom shapes, gradients, and SVGs. Visually see the mask applied to an image. Copy the CSS.
UD5 Toolkit
Scroll to reveal the magic ✨
mask-image property with scroll-driven animation to create stunning reveal effects. A mask defines which parts of an element are visible (opaque mask areas) and which are hidden (transparent areas). By dynamically shifting the mask-position as the user scrolls—at a different speed than the content—you achieve a parallax-like depth effect. This technique is perfect for hero sections, image reveals, and creative storytelling layouts.mask-image is supported in all modern browsers: Chrome 120+, Safari 15.4+, Firefox 53+, and Edge 120+. For the best cross-browser compatibility, always include the -webkit-mask-image prefixed version alongside the standard property. Safari and older Chrome versions require the -webkit- prefix. As of 2024, global support exceeds 95%. Note that mask-clip and mask-composite have slightly different support profiles—test thoroughly for production use.mask-composite. Use clip-path for geometric shapes; use masks for organic, smooth transitions.background-attachment: fixed on a pseudo-element with a mask, or leverage the newer @scroll-timeline API (still experimental). However, for reliable cross-browser mask parallax, a lightweight JavaScript scroll listener (with requestAnimationFrame throttling) updating mask-position remains the most robust method. The JS overhead is minimal—typically under 1ms per frame.will-change: mask-position sparingly on elements that will animate. (2) Throttle scroll handlers with requestAnimationFrame. (3) Avoid animating masks on large full-screen elements on mobile. (4) Test with Chrome DevTools Performance panel. (5) Consider using transform: translateZ(0) to promote the masked element to its own compositor layer for GPU-accelerated rendering.mask-image. For example: mask-image: radial-gradient(...), linear-gradient(...); Each layer stacks and combines based on mask-composite (add, subtract, intersect, exclude). This enables incredibly creative effects—combine a circular spotlight with a gradient wipe, or layer a texture mask over a shape mask for unique parallax reveals.<video> elements. For the most dramatic parallax reveals, use high-contrast, vibrant images or rich CSS gradients as the element's background. The mask controls visibility, so the more visually striking the underlying content, the more impressive the reveal effect. WebP and AVIF offer smaller file sizes for production use.mousemove events. Track the cursor position relative to the element, then set mask-position to those coordinates. Combine with a radial-gradient mask for a flashlight/spotlight effect. Example: element.style.maskPosition = (x - maskWidth/2) + 'px ' + (y - maskHeight/2) + 'px'; Add a CSS transition of ~0.15s on mask-position for smooth following. This technique is popular for interactive portfolio reveals.Create CSS mask‑image effects with custom shapes, gradients, and SVGs. Visually see the mask applied to an image. Copy the CSS.
See how overflow: visible, hidden, scroll, and auto behave with real content. Clone to test with your text.
Create an animation that advances with scroll using animation‑timeline: scroll(). See the visual timeline editor. Modern CSS.
Place multiple grid items into the same cells to create overlapping layouts. Learn the technique visually. Copy code.
Control image‑orientation: from-image vs none. See how the browser interprets EXIF rotation. Fix portrait photos.
Experiment with scroll‑state container queries to style elements when they are stuck, snapped, or overflowed. Experimental.
Create a pure CSS scroll progress indicator using animation‑timeline: scroll(). No JavaScript. Copy the complete code.
Hover over tiles to see every CSS cursor value in action. Quick visual reference for choosing the right UI feedback.
Configure how your PWA launches: focus existing or create new. Test with the launch_handler manifest field.
Build a horizontal scroll‑snap container with configurable snap‑type and alignment. Perfect for image galleries.
Compare all CSS easing presets side by side on a bouncing ball. See which curve fits your UI animation.
Query the permission state of camera, microphone, geolocation, and more. See the response and learn the API.
Process audio faster than real‑time with OfflineAudioContext. Apply filters and export the result. Dev tool.
Drop files onto a zone and see a preview with name, size, and type. Copy the JavaScript pattern for your site.
Request notification permission and create a push subscription. See the subscription object. Learn how web push works.
Demonstrate how to add custom headers and POST‑like functionality to EventSource using a polyfill. Code and example.
Scroll a container and see how sticky elements behave. Adjust top, bottom, and scroll margins. Copy the code.
Try all object‑fit values (fill, contain, cover, scale‑down) on an image. Adjust object‑position. Copy the CSS.
See the difference between clone and slice on inline boxes that break across lines. Useful for multi‑line headings.
Toggle between normal, nowrap, pre, pre‑wrap, and pre‑line to understand how whitespace is handled. Live text example.
See the roving tabindex pattern in action. Use arrow keys to navigate a list. Copy the accessible JavaScript pattern.
Render the classic Stanford Bunny with a basic WebGPU pipeline. Rotate and zoom. Check if your browser supports WebGPU.
See how scroll‑padding and scroll‑margin affect the position of elements when using anchor links or scroll‑snap. Visual.
See how align‑items: baseline works in grid to align different font sizes on the same baseline. Visual guide.
Test the experimental Translation API to translate text between languages directly in the browser, without cloud calls. Check support and copy the JavaScript starter.
Apply a convolution filter (blur, sharpen) using a Web Worker. See the UI stay responsive while processing. Learn multithreading in the browser.
Toggle scrollbar‑gutter: stable to reserve space for the scrollbar and avoid content jumps. Visual demo with two columns.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Register a periodic background sync to fetch fresh data even when the tab is closed. Understand the API and limits.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.