1.0.12 • Published 5 months ago

@simpleimg/decode-blurhash v1.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Simple Image Cloud - Blurhash Decoder

This module transform blurhash string into base64 image, making it possible to use blurhash as a placeholder for images easily.

Install

yarn add @simpleimg/decode-blurhash

or

npm install @simpleimg/decode-blurhash

Documentation

You can find the documentation for the Decode Blurhash here.

Quick Usage - React

import decode from '@simpleimg/decode-blurhash';
import {
    useEffect,
    useState
} from 'react';

export default () => {
    const [
        background,
        setBackground
    ] = useState('');

    /* will generate a base 64 encoded image with 32px by 32px */
    useEffect(() => {
        setBackground(decode('LGF5]+Yk^6#M@-5c,1J5@[or[Q6.'));
    }, []);

    /* then use it with background-image and background-size: cover */
    return (
        <div style={{
            backgroundImage: `url(${background})`,
            backgroundSize: 'cover',
            width: 400,
            height: 400
        }}/>
    );
};

Feedback

We want to hear your issue reports and feature requests at support@simpleimagecloud.com

1.0.12

5 months ago

1.0.11

1 year ago

1.0.10

2 years ago

1.0.2

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

3 years ago