Comments (4)
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.
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
supportbackground-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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fitie.