Giter Club home page Giter Club logo

Comments (12)

humbertqz avatar humbertqz commented on May 27, 2024 1

Nice, thanks. 😄

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024 1

thanks @humbertqz will publish today! thank you for your testing ❤️

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024 1

v1.14.0 released, i will close the issue. feel free to re-open if you find other issues 👍

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

The div is made for the placeholder animation, because you have the actual image and placeholder wrapped inside.

There are two solutions:

  1. provide img width and height and apply applyAspectRatio
  2. i will have to create a minor version, by supply placeholder = false, which will remove placeholder and the wrapping div, plus you will lost the animation from the placeholder.

let me know.

from react-simple-img.

humbertqz avatar humbertqz commented on May 27, 2024

Maybe that could be a feature?

Remove everything but the img tag.

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

sure i can looking into that over the weekend :) but you lost beautiful animation 👍

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

Could you please help on testing? [email protected]

you have to set placeholder={false}

from react-simple-img.

humbertqz avatar humbertqz commented on May 27, 2024

Yes!, but i never used a beta repo, how can i download it? I was using the component in a GatsbyJs project.

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

just yarn add [email protected] or npm i [email protected]. i did testing with my own demo and it works, just want to double check with yours before publishing.

from react-simple-img.

humbertqz avatar humbertqz commented on May 27, 2024

Yes, it works this is my component:

<SimpleImg height={440} src={this.props.imgsrc} placeholder={false} />

This is what is rendered:

<img src="/static/thumb-plaza-cataluna-6106ec93376385a64fbf1cd99450ec09.jpg" srcset="" data-placeholder="false" data-src="/static/thumb-plaza-cataluna-6106ec93376385a64fbf1cd99450ec09.jpg" height="440" style="transition: all 0.3s ease 0s; opacity: 0; visibility: visible;">

Set the opacity: 0; by default, is there a way to change this?

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 27, 2024

thanks for the testing! i forgot to set opacity back to 1 for the animation :(

try this version [email protected]

should only render and animate when finished loading

from react-simple-img.

humbertqz avatar humbertqz commented on May 27, 2024

It's working this is the rendered element:

<img src="/static/thumb-plaza-cataluna-6106ec93376385a64fbf1cd99450ec09.jpg" srcset="" data-placeholder="false" data-src="/static/thumb-plaza-cataluna-6106ec93376385a64fbf1cd99450ec09.jpg" data-end-style="opacity:0;" style="transition: all 0.3s ease 0s; opacity: 1; visibility: visible;">

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.