Accessible <image-compare> Web Component (no Shadow DOM)


Control how much of the first image is shown initially by adding an exposure attribute (0-100).
E.g: <image-compare exposure="0" > will hide the first image, a value of 100 will hide the second image, and a value of 50 will show half of each.

Example 1: Just two <img> tags

Alt text Alt text

Example 2: With a caption & wrapped in a <figure>

Alt text Alt text
Before/After