npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cosha

v3.0.2

Published

Colorful shadows for your images. 🎨

Downloads

241

Readme

cosha

version on npm weekly downloads on npm types minified size license

Colorful shadows for your images. 🎨

cosha lets you add colorful shadows to your images. Try it out and look for yourself—it really couldn't be easier to set up!

How

npm i 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 type="module">
  import cosha from "https://unpkg.com/cosha";

  cosha();
</script>

Config

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

cosha(options);

options.className

Type: string Default: "cosha"

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

options.blur

Type: number | string Default: "5px"

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

options.brightness

Type: number | string Default: 1

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

options.saturation

Type: number | string Default: 1

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

options.x

Type: number | string Default: 0

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

options.y

Type: number | 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 standard CSS filter functions.

License

MIT