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.
Customize falling snow particles with pure CSS or canvas. Adjust speed, size, and wind. Copy the code for your website.
Create a pure CSS scroll progress indicator using animation‑timeline: scroll(). No JavaScript. Copy the complete code.
Limit browser gestures on an element: pan‑x, pinch‑zoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Create a custom element with named slots and see content projection in action. Learn Web Components basics.
Pixelate or censor parts of an image by dragging. Adjust block size for mosaic effect. Useful for hiding faces or sensitive data. Client-side processing.
See the View Transitions API in action. Cross‑fade and morph between two states. Copy the JavaScript starter code.
Apply content‑visibility: auto to off‑screen sections and see the rendering cost drop. Demos for infinite scroll optimization.
Register and apply a custom paint worklet to draw a background pattern dynamically. Write the paint function in the browser.
A customisable Matrix‑style digital rain animation. Adjust speed, characters, and colors. Fullscreen mode for ambiance.
Toggle content‑visibility: auto on long blocks and see the rendering time difference. Understand this powerful property.
Draw shapes and experiment with globalCompositeOperation. See Porter‑Duff operators in action. Great for game devs.
Define the initial scroll position for a scroll container with scroll‑start. Test with and without snapping. New feature.
Pixelate selected areas of an image to hide faces or sensitive data. Adjust block size. Download the censored result.
Visually create the glassmorphism effect: background blur, transparency, and border. Copy the complete CSS. Modern UI design.
Adjust root, margin, and threshold. See a live log of intersection events as you scroll. Debug lazy loading.
Help the bird fly through pipes without touching them. Click or tap to flap. Track your high score in localStorage. Classic time‑waster.
Move your mouse or finger to create colorful paint splatters on canvas. Great stress reliever. Download as PNG.
Write a paint worklet in JavaScript and see it used as a CSS background instantly. Experiment with Houdini. Local.
Open a modal and see how focus is trapped and restored. Copy the lightweight focus‑trap code. Accessible pattern.
Upload a small image and see it tiled as a canvas pattern. Export the pattern or copy the JavaScript.
Add many complex CSS styles and measure frames per second. Isolate expensive properties. Practical performance lab.
Write JavaScript using element.animate() and see the result in a live preview. Compare with CSS keyframes. Debugger included.
Type raw HTML and see the escaped version, then see how it renders when unescaped. Understand encoding better.
Generate a complete <head> section with meta charset, viewport, SEO, favicon, and social tags. Customize and copy.
Render the classic Stanford Bunny with a basic WebGPU pipeline. Rotate and zoom. Check if your browser supports WebGPU.
Run a CPU‑heavy calculation (e.g., prime numbers) in a Web Worker and see the UI stay responsive. Code snippet provided.
Write Mermaid syntax inside Markdown blocks and instantly see rendered flowcharts, sequence diagrams, and Gantt charts. Copy SVG.