All Projects β†’ robinloeffel β†’ Cosha

robinloeffel / Cosha

Licence: mit
Colorful shadows for your images. 🎨

Projects that are alternatives of or similar to Cosha

Browser Sec Whitepaper
Cure53 Browser Security White Paper
Stars: ✭ 251 (-74.6%)
Mutual labels:  browser, dom
Dom99
Extend html with directives
Stars: ✭ 37 (-96.26%)
Mutual labels:  browser, dom
Wpt
Test suites for Web platform specs β€” including WHATWG, W3C, and others
Stars: ✭ 3,573 (+261.64%)
Mutual labels:  browser, dom
Browser Monkey
Reliable DOM testing
Stars: ✭ 53 (-94.64%)
Mutual labels:  browser, dom
React Svg
🎨 A React component that injects SVG into the DOM.
Stars: ✭ 536 (-45.75%)
Mutual labels:  images, dom
Vent
jQuery inspired DOM events library
Stars: ✭ 30 (-96.96%)
Mutual labels:  dom
Storage Based Queue
Javascript queue library with persistent storage based queue mechanism for the browsers environments. Specially designed for offline.
Stars: ✭ 33 (-96.66%)
Mutual labels:  browser
Navalia
A bullet-proof, fast, and reliable headless browser API
Stars: ✭ 950 (-3.85%)
Mutual labels:  browser
Radi
πŸŒ€Tiny (in size) front-end framework with no extra browser re-flows
Stars: ✭ 946 (-4.25%)
Mutual labels:  dom
Fileshare
Debian/Ubuntu applet for screenshots and images sharing using popular online services
Stars: ✭ 35 (-96.46%)
Mutual labels:  images
Remirror
ProseMirror toolkit for React πŸŽ‰
Stars: ✭ 973 (-1.52%)
Mutual labels:  browser
Jquery.lazy
A lightweight, fast, feature-rich, powerful and highly configurable delayed content, image and background lazy loading plugin for jQuery & Zepto.
Stars: ✭ 965 (-2.33%)
Mutual labels:  images
Browser Ios
Brave iOS Browser
Stars: ✭ 955 (-3.34%)
Mutual labels:  browser
Onloaded
A tiny (350B) library to detect when images have loaded.
Stars: ✭ 33 (-96.66%)
Mutual labels:  images
Regexanalyzer
Regular Expression Analyzer and Composer for Node.js / XPCOM / Browser Javascript, PHP, Python
Stars: ✭ 29 (-97.06%)
Mutual labels:  browser
Xml
XML without worries
Stars: ✭ 35 (-96.46%)
Mutual labels:  dom
Tator Native
Tator: The video and image annotator
Stars: ✭ 28 (-97.17%)
Mutual labels:  images
Singlebox Legacy
All Your Apps in One Single Window
Stars: ✭ 32 (-96.76%)
Mutual labels:  browser
Photobrowser
Elegant photo browser in Swift. ε›Ύη‰‡δΈŽθ§†ι’‘ζ΅θ§ˆε™¨γ€‚
Stars: ✭ 975 (-1.32%)
Mutual labels:  browser
Unity browser
Open source Unity3d web browser created by Vitaly Chashin https://bitbucket.org/vitaly_chashin/simpleunitybrowser
Stars: ✭ 31 (-96.86%)
Mutual labels:  browser

cosha

latest version on npm npm downloads a month 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 less than 1kb heavy and it really couldn't be easier to set up!

How

yarn add cosha
<!-- on an img tag -->
<img src="palm-tree.jpg" alt="nice vibes" class="colorful-shadow"/>

<!-- on a picture tag -->
<picture class="colorful-shadow">
  <source srcset="palm-tree-1200.jpg 1200w, palm-tree-800.jpg 800w, palm-tree-400.jpg 400w" type="image/jpeg">
  <source srcset="palm-tree-1200.webp 1200w, palm-tree-800.webp 800w, palm-tree-400.webp 400w" type="image/webp">
  <img src="palm-tree-400.jpg" alt="nice vibes"/>
</picture>
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>
<script>
  cosha({ className: 'colorful-shadow' });
</script>

Config

Everything in the config is optional. You can also use it by just calling cosha().

className

Type: string
Default: 'cosha'

The class the plugin looks for. This should be on the original img or picture node(s).

blur

Type: number or string
Default: '5px'

The amount of blur to apply to the image. See the CSS blur function docs on MDN for more details.

brightness

Type: number or string
Default: 1

The amount of brightness to apply to the image. See the CSS brightness function docs on MDN for more details.

saturation

Type: number or string
Default: 1

The amount of saturation to apply to the image. See the CSS saturation function docs on MDN for more details.

x

Type: number or string
Default: 0

The amount of horizontal translation to apply to the image. See the CSS translate function docs on MDN for more details.

y

Type: number or string
Default: 0

The amount of vertical translation to apply to the image. See the CSS translate function docs on MDN for more details.

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].