Git Product home page Git Product logo

js-background-blend-mode's Introduction

js-background-blend-mode

A JavaScript based polyfill for browsers that don’t support CSS background-blend-mode property.

npm version

Browser Support:

  • CSS background-blend-mode: many browsers but IE11- and some mobile Can I Use....
  • Canvas blend modes: any browser but IE11- Can I Use....

Demo:

Codepen

js-background-blend-mode

Usage

  1. Add the js-background-blend-mode.js file to your HTML

  2. Define an element using data-blend attribute and one of those values:

    normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity

  3. Add an image to blend using the data-blend-image attribute.

  4. Add a color to blend using data-blend-color attribute.

  5. Add a little CSS for fallback if the browser support CSS background-blend-mode (js-background-blend-mode.css file).

Example:

<div class="blend" data-blend="overlay" data-blend-image="demo.jpg" data-blend-color="rgba(255, 0, 0, 0.5)"></div>

TODO

  • Polish code
  • Check for better crossbrowser support
  • Better performance (it is still slow to render)
  • Gruntify
  • Get rid of CSS file
  • Bowerify
  • NPM module

Credit

License

Original License: ABRSL.

Forked License: MIT

js-background-blend-mode's People

Contributors

juanbrujo avatar idevsoftware avatar

Watchers

James Cloos avatar  avatar  avatar

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.