Giter Club home page Giter Club logo

Comments (14)

oquirozm avatar oquirozm commented on May 27, 2024 1

@bluebill1049 sure, will do in a bit

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

hey,

can you try with applyAspectRatio?

from react-simple-img.

Alfrex92 avatar Alfrex92 commented on May 27, 2024

Yes, that's the prop that I'm using.

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

oh ok, did you supply image width and height when you are using applyAspectRatio? For aspect ratio to work, it required to having image width and height.

Yea, I think I can expose an image style prop, so you can apply your own style.

from react-simple-img.

Alfrex92 avatar Alfrex92 commented on May 27, 2024

Thanks for your quick response. Yes, I added the width and height when using applyAspectRatio. The library is working perfect. The CSS is what needs improvement.

You can replace the previous code and add this:

  position: absolute;
    left: -10000%;
    right: -10000%;
    top: -10000%;
    bottom: -10000%;
    margin: auto auto;
    min-width: 1000%;
    min-height: 1000%;
    object-fit:cover;
    -webkit-transform: scale(.1);
    transform: scale(.1);

Yess, it would be awesome if you can expose the style :D

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

I will expose the style for you, I will work on it this week.

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

https://github.com/bluebill1049/react-simple-img/releases/tag/v2.3.0

you can try with imgStyle

from react-simple-img.

Alfrex92 avatar Alfrex92 commented on May 27, 2024

Hi, thanks for adding the new feature.

How can I use it?

like this?

 <SimpleImg
        src={
          ""
        }
        imgStyle={{
          position: "absolute"
        }}
      />

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

Yes

from react-simple-img.

Alfrex92 avatar Alfrex92 commented on May 27, 2024

It's not working :S

https://codesandbox.io/s/lazyloadingsimplereactimg-58kwy

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

https://codesandbox.io/s/lazyloadingsimplereactimg-zpcvg
fixed
[email protected]

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

Hey,

Did you take another look? please close the issue if its resolved

thanks
bill

from react-simple-img.

oquirozm avatar oquirozm commented on May 27, 2024

@bluebill1049 this prop is super useful but I had to search through the issues to find it. Any chance it can be added to the documentation?

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

sure @oquirozm u want to submit a PR to update readme?

from react-simple-img.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.