# cobo

> CoBo - Colorful Border

Latest version **3.0.0** (published 2022-02-28) · GPL-3.0-only license · 0 weekly downloads

## Install

```sh
npm install cobo
pnpm add cobo
yarn add cobo
bun add cobo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2022-02-28 |
| First published | 2020-03-15 |
| Weekly downloads | 0 |
| License | GPL-3.0-only |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 35.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Rovshan Badirkhanov |
| Maintainers | ezio_mercer |
| Keywords | blur, blurred, border, color, colorful, dom, filter, html, img, image, light, shadow |

## Links

- npm: https://www.npmjs.com/package/cobo
- Repository: https://github.com/EzioMercer/cobo
- Homepage: https://github.com/EzioMercer/cobo#readme
- Issues: https://github.com/EzioMercer/cobo/issues
- npm.io page: https://npm.io/package/cobo

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2022-02-28
- 2.1.1 — 2021-06-11
- 2.1.0 — 2021-06-04
- 2.0.1 — 2021-02-16
- 2.0.0 — 2020-03-25
- 1.0.0 — 2020-03-19
- 0.1.1 — 2020-03-18
- 0.1.0 — 2020-03-17
- 0.0.5 — 2020-03-17
- 0.0.4 — 2020-03-17
- 0.0.3 — 2020-03-15
- 0.0.2 — 2020-03-15
- 0.0.1 — 2020-03-15

## README

# cobo
**Co**lorful **Bo**rder

## Install
```
npm install cobo --save
```

## Usage

This package contains two files:

 * `cobo.js` -- unminified version for development purposes
 * `cobo.min.js` -- minified production-ready version

Just include either of those files and import `Cobo` in your code.

```js
/**
 * @param {HTMLImageElement} img - Required
 * @param {boolean} [hoverMode] - Optional
 * @param {number} [borderSize] - Optional
 */
Cobo({
    img,
    hoverMode: false,
    borderSize: 8
});
```

`Cobo` offers two modes: `static` (default) and `hover`. To activate `static` mode,
you just need to pass an `HTMLImageElement` in image initialization function:

```js
Cobo({
    img: e.target
})
```

To activate `hover` mode, you need to pass a `hoverMode` parameter too and set to `true`: 

```js
Cobo({
    img: e.target,
    hoverMode: true
})
```

To control border size you need to pass `borderSize` parameter

```js
Cobo({
    img: e.target,
    borderSize: 32
})
```

Calling `Cobo({img: e.target, hoverMode: false})` is equal to calling `Cobo` in `static` mode.

## Example

Insert script `test.js` inside the `head` element of your `index.html` file as module:

```html
<head>
    <title>CoBo</title>
    <script type="module" src="test.js"></script>
</head>
```

Import `Cobo` from `cobo.min.js` in the file `test.js` 

```js
import Cobo from './cobo.min.js';
```

then set onload function of the image like shown below:

```js
const img = document.createElement('img');

img.src = "/path/to/image";
img.onload = (e) => Cobo({
    img: e.target,
    hoverMode: true,
    borderSize: 16
});

document.body.appendChild(img);
```

## License
GPL-3.0-only

---
_Source: https://npm.io/package/cobo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
