Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add waves masks on images feature #877

Merged
merged 15 commits into from Sep 17, 2019
Merged

Conversation

AnthonyLedesma
Copy link
Member

  • Closes ISBAT apply a waves mask to images #842.
  • Added waves style for bottom and top of images.
  • CSS is responsive and it tested and working well in Chrome, FireFox, Edge, and using mobile device emulators built into FireFox and Chrome.
  • Tested using Twentynineteen, Twentyseventeen, Twentysixteen, and underscores bare bones theme.
  • Future releases could feature options for SVG horizontal flip, custom colors, and different styles of SVG masks.

I was not able to figure out how to get the IE11 support working here. I was able to get a background image applied but the layering was not working as expected.

There are two bugs that I am still working on tracking down. They are both related to the image-mask not being 'contained'

When first inserted
imageMaskUncontainedNew

When switching page alignment
imageMaskUncontained

@AnthonyLedesma AnthonyLedesma added the [Type] Enhancement Something new that adds functionality label Sep 12, 2019
@AnthonyLedesma AnthonyLedesma self-assigned this Sep 12, 2019
@jrtashjian jrtashjian added this to the Next Release milestone Sep 12, 2019
@jrtashjian
Copy link
Member

@paranoia1906 great work! I'm about to push a few updates that build upon what you've accomplished. We can actually use the mask css properties directly on the image which removes the need for the psuedo element being added and needing to match the width of the image. This solves all the issues you had above and also removes the need for us to hide the caption text.

As for IE11 support, mask is not a supported property and I think in this case it's ok not to have it working. I don't think it would be beneficial to add support for it either. If the browser doesn't support the mask property, it doesn't break the content and the image renders normally.

The major difference is the SVG we're using as the mask. When an SVG is used as a mask, the path added is actually the part of the image that is removed. So in order to get this working properly I made an SVG which is the reverse of the shape. So in your example above the white portion is the SVG shape whereas the new shape would be the red portion.

@jrtashjian
Copy link
Member

One final update: fixing the style preview for that bottom wave style. I'm hiding the caption in the preview and aligning the block so we can see the bottom wave.

Screen Shot 2019-09-17 at 1 34 30 PM

@jrtashjian
Copy link
Member

Preview:

Kapture 2019-09-17 at 13 41 58

@richtabor
Copy link
Contributor

I think it's fine that captions display in the preview (as core allows it). I also removed some extraneous styling that was causing some display errors in the sidebar and aren't really needed.

@richtabor richtabor merged commit 165e68c into master Sep 17, 2019
@richtabor richtabor deleted the bottom-waves-image-style branch September 17, 2019 19:10
@kosiew
Copy link

kosiew commented May 9, 2020

The wave style is broken.

See http://xizunite.com/test-image/

Screenshot
if image does not load, please click on this link : https://d.pr/i/OPyoFi

Screenshot
if image does not load, please click on this link : https://d.pr/i/eGnc83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement Something new that adds functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ISBAT apply a waves mask to images
4 participants