GithubHelp home page GithubHelp logo

doc22940 / cosha Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robinloeffel/cosha

1.0 1.0 0.0 583 KB

Colorful shadows for your images. 🎨

Home Page: https://npm.robinloeffel.ch/cosha

License: MIT License

JavaScript 100.00%

cosha's Introduction

cosha

latest version on npm npm downloads a month required node version dependency status package license

Colorful shadows for your images. 🎨

cosha lets you add colorful shadows to your images. Try it out and look for yourself—the bundle is only less than 1kb small and it couldn't be easier to set up!

How

yarn add cosha
<img src="my-dope-pic.jpg" alt="mmmhm" class="colorful-shadow"/>
import cosha from 'cosha';
cosha({
    className: 'colorful-shadow',
    blur: '10px',
    brightness: '125%',
    saturation: '110%',
    x: '2px',
    y: '6px'
});

Alternatively, if that module-bundler stuff isn't for you, you can get it directly from https://unpkg.com/cosha.

<script src="https://unpkg.com/cosha"></script>

Config

Everything in the config is optional. You can also use it by just calling cosha(). The default values are:

cosha({
    className: 'cosha',
    blur: '5px',
    brightness: 1,
    saturation: 1,
    x: 0,
    y: 0
});

Gotcha

It runs in every browser except Internet Explorer. This is because of missing support for CSS filter properties. In case cosha detects it's running in a browser that doesn't have NodeList.prototype.forEach available, which at this point is only IE <= 11, it simply doesn't do anything.

License

MIT

cosha's People

Contributors

robinloeffel avatar

Stargazers

Acampbell avatar

Watchers

 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.