Giter Site home page Giter Site logo

Comments (3)

marcolago avatar marcolago commented on August 15, 2024

Hi @ChristianFrisson.
Iā€™m not sure if I had understood your request.
Could you make me a couple of examples of what you want to achieve?

Thanks
marcolago

from flowtime.js.

ChristianFrisson avatar ChristianFrisson commented on August 15, 2024

Hi @marcolago,

For example in your sample slides, section 5, page 2:
http://marcolago.github.io/flowtime.js/#/section-5/page-2
If the height of the window is lower than the height of the image, or if the width of the window is lower than the width of the image, the image is displayed as the maximum size it can get from the window and according to the aspect ratios of both window and image. However, if both width and height of the window are greater than respectively the width and height of the image, the image size stays fixed and doesn't fit the window.

I would like to have a similar behaviour as "fit to screen" for desktop wallpapers.

Thanks,
Christian

from flowtime.js.

marcolago avatar marcolago commented on August 15, 2024

Ok, understood.

To fit an image to the available space, like in the slide you linked, you have to edit the CSS rule .flowtime img like this:

.flowtime img {
  max-width: inherit;
  max-height: inherit;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

This force the image to maximise itself and to maintain the aspect ratio cropping the parts that exceed the area.

If you want not to crop you can use object-fit: contain;.

Please, mind that this solution may not work as expected in every situation depending on how you set the CSS on image containers.

Let me know if this solve your issue and if you need further help for a specific use case feel free to drop a line.

from flowtime.js.

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.