-
Notifications
You must be signed in to change notification settings - Fork 2
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
Comments
Jay,Thank you for your interest in my component. I am at work at the moment but I think the answer to your question is no. The canvas is hard-coded to set the aspect-ratio of the source image, so unless it is exactly the same size and shape as your background element, the image will either get clipped or look weird.This is something that could potentially be fixed but I would need more information on exactly what your design does.On Jul 5, 2023, at 7:00 AM, Jay Smith ***@***.***> wrote:
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 if it's worth pursuing further if the underlying component doesn't really support it.
Thanks!
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thanks so much for replying. Sorry for being so vague! Here's a pen with the desired behaviour: |
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. |
Here's a one-to-one replacement from 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. |
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!
The text was updated successfully, but these errors were encountered: