Gutenberg: Cover: Video - Add position controls

Created on 20 May 2020  ·  5Comments  ·  Source: WordPress/gutenberg

At the moment, the horizontal and vertical background positioning controls only work for Cover images. Cover videos lack this feature.

Screen Capture on 2020-05-20 at 17-33-12

I think it would be helpful to add feature parity with video backgrounds.

To achieve the same positioning MATH, <video /> styles can use object-position.

This will also give as an opportunity to improve the FocalPointPicker component a bit.

I've done some explorations! I've added couple of enhancements, including adding our new UnitControl components as well as a Grid overlay. It feels really nice!

Screen Capture on 2020-05-20 at 17-19-09

Note: This does not work on IE 11. However, video backgrounds already use object-fit: cover. So this update should not introduce a regression on IE 11.

[Block] Cover [Feature] Design Tools [Type] Enhancement

Most helpful comment

focal-demo

@mtias Aww yiss!

(Also in the demo, pressing keyboard arrows to adjust position. Shift jumping is supported)

All 5 comments

This is great. I think the grid should always show up _while you drag_ instead of being a toggle.

@mtias Oh interesting!!! That makes it easier. We can do that ❤️ !

focal-demo

@mtias Aww yiss!

(Also in the demo, pressing keyboard arrows to adjust position. Shift jumping is supported)

Looks amazing, Q! Here's a visual tweak to the field:

Focal point picker

What do you think?

@jasmussen Sure thing! I can give it a shot ✨

I opened a draft PR:
https://github.com/WordPress/gutenberg/pull/22531

We can collab and iterate there 😊

Since we're working on this component... I think it would be a good opportunity to explore any UI/UX ideas.

The "wouldn't it be cool if..." ones.

I think the 9x9 grid as a good example of this. Made better by @mtias 's interaction suggestion

Was this page helpful?
0 / 5 - 0 ratings