An open API service indexing awesome lists of open source software.

https://github.com/thaddeusjiang/vue-blurhash-canvas

Only 31 lines implement blurha.sh for Vue.js
https://github.com/thaddeusjiang/vue-blurhash-canvas

blurhash vuejs

Last synced: 5 months ago
JSON representation

Only 31 lines implement blurha.sh for Vue.js

Awesome Lists containing this project

README

        

# vue-blurhash-canvas

> Vue components for using the [blurhash algorithm](https://blurha.sh) in your Vue projects

## Install
```
yarn add blurhash vue-blurhash-canvas
```

## Usage

```vue

import Blurhash from "vue-blurhash-canvas";

export default {
components: {
Blurhash,
},
};

```

### Props

| name | description |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `hash` (string) | The encoded blurhash string. |
| `width` (int \| string) | Width (CSS) of the decoded image. |
| `height` (int \| string) | Height (CSS) of the decoded image. |
| `resolutionX` (int) | The X-axis resolution in which the decoded image will be rendered at. Recommended min. 32px. Large sizes (>128px) will greatly decrease rendering performance. (Default: 32) |
| `resolutionY` (int) | The Y-axis resolution in which the decoded image will be rendered at. Recommended min. 32px. Large sizes (>128px) will greatly decrease rendering performance. (Default: 32) |
| `punch` (int) | Controls the "punch" value (~contrast) of the blurhash decoding algorithm. (Default: 1) |

## Contribute

```sh
$ yarn
$ yarn add --peer vue blurhash core-js
$ yarn dev
```