Giter Club home page Giter Club logo

Comments (4)

fvsch avatar fvsch commented on July 18, 2024

Looking at fitie.js, you're wrapping the img or video element in a custom element (duplicating a lot of CSS styles from that element to the wrapper), and then you have a little bit of complexity to support img and video and fill, contain and cover.

I guess that's needed for supporting <video>, but can you confirm that for <img> only we can go with background-image and avoid the complexity of doing the math (and live updates) ourselves?

from fitie.

fregante avatar fregante commented on July 18, 2024

Most of what you suggested has been published here: https://github.com/bfred-it/object-fit-images

  • browser does the math through background-image
  • object-position support
  • background-color is not overridden (2.2.0)
  • global function
  • automatic new content detection
  • srcset support

fitie's disadvantages are necessary to support <video> so it's unlikely that they are implemented here.

from fitie.

DanielRuf avatar DanielRuf commented on July 18, 2024

I recommend archiving this project. Other solutions have better support and it is irritating when there are multiple polyfills (come on devs, GitHub is actually for collaboration ;-) ) and you have to decide which one to use.

from fitie.

jonathantneal avatar jonathantneal commented on July 18, 2024

Iā€™m okay with someone contributing to this project (with a non-failing PR) and eventually taking it over to make such a decision. That being said, bfred-it wrote:

fitie's disadvantages are necessary to support

Unless you have evidence to show this is no longer the case, Iā€™m not sure what you are basing your opinion on, other than your personal convenience and current non-video needs.

from fitie.

Related Issues (8)

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.