0

I'm trying to make an image unveil effect with an SVG mask, where a path with a quite complex geometry is scaled via CSS transforms:

  clip-path: url(#aqua-dot-mask);

https://codepen.io/rberneder/pen/pojaNex

I tested the effect in Chrome, Firefox and Safari. The first two browsers are presenting what I want to achieve, but Safari has real troubles and glitches.

It seems Safari still has no full support of the clip-path property, but it should be capable of this particular one. https://caniuse.com/#search=clip-path

Any ideas?

1
  • Pretty sure in Safari you can only apply a mask to an SVG element and not a HTML element. Commented May 6, 2020 at 14:50

1 Answer 1

0

Thanks @Robert for your help. The solution I came up with is to just put the img tag as image tag into the SVG.

Instead of:

<img src="..." style="clip-path(#mask)" />
<svg>
    <defs>
        <clipPath id="mask">...</clipPath>
    </defs>
</svg>

I now have:

<svg>
    <defs>
        <clipPath id="mask">...</clipPath>
    </defs>
    <image href="..." style="clip-path: url(#mask);" />
</svg>

https://codepen.io/rberneder/pen/xxwYmOj

This works for me.

Not the answer you're looking for? Browse other questions tagged or ask your own question.