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

Object-fit: cover? #7

Open
jayrsmith opened this issue Jul 5, 2023 · 4 comments
Open

Object-fit: cover? #7

jayrsmith opened this issue Jul 5, 2023 · 4 comments

Comments

@jayrsmith
Copy link

jayrsmith commented Jul 5, 2023

Hi @andrewstephens75 . Thanks for this component. I'm hoping to possibly use it in a small festival site that is using diffused dithered images in its marketing campaign.

Can the component be used for a full width and height image background layer that fills the viewport in an object-fit: cover manner?

I've tried a few things but not sure if it's worth pursuing further if the underlying component doesn't really support it.

Thanks!

@andrewstephens75
Copy link
Owner

andrewstephens75 commented Jul 5, 2023 via email

@jayrsmith
Copy link
Author

Hi @andrewstephens75

Thanks so much for replying. Sorry for being so vague!

Here's a pen with the desired behaviour:
https://codepen.io/jaysmith/pen/VwVzBGg

@andrewstephens75
Copy link
Owner

And what exactly happens when you replace the img with as-dithered-image?

You can check the javascript console, there might be more information there.

@jayrsmith
Copy link
Author

Here's a one-to-one replacement from <img>:
https://codepen.io/jaysmith/pen/wvQqYmQ

The aspect ratio of the image is not maintained as it attempts to fill the available viewport. Your explanation above makes sense as to why this is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants