Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-pharkas-blurhash

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-pharkas-blurhash

An Observable-First, Zone-Free wrapper for Blurhash

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Angular-Pharkas-Blurhash

This library provides an Observable-First, Zone-Free wrapper for the Vanilla JS library Blurhash built with the angular-pharkas component framework.

It's key benefits are:

  • Zone-Free
    • ChangeDetectionStrategy.OnPush tells Angular that it doesn't need to work to detect any template changes

The Inevitable Angular Compatibility Chart

Library versionSupported Angular
2.0.0Angular 15
<=1.0.0Angular 13

Usage

Import PharkasBlurhashModule and use <pharkas-blurhash>. The API:

<pharkas-blurhash [image]="blurhashDescriptionObservable"></pharkas-blurhash>

[image] is an Observable<BlurhashDescription> where BlurhashDescription is a simple interface describing image metadata including the relevant blurhash.

BlurhashDescription

{
  width: '100%',
  canvasWidth: 1024,
  height: '100%',
  canvasHeight: 728,
  blurhash: 'xyz…',
  blurhashPunch: 1,
  imageSrc: 'https://…',
  imageAlt: 'An example image of…'
}

Required:

  • blurhash is the Blurhash to display
  • imageSrc is the image to display
  • imageAlt is the alternate description
  • width is the width of the container (for both the blurhash and the image) as either a number (of pixels) or CSS size
  • height is the height of the container (for both the blurhash and the image) as either a number (of pixels) or CSS size

Optional:

  • blurhashPunch is a dial of the "punch" of a blurhash and defaults to 1.
  • canvasWidth is the size of canvas the blurhash is painted on, in pixels. It falls back to the width when provided as a number and otherwise defaults to 160 (for an assumption of 16x9 photos as default)
  • canvasHeight is the size of canvas the blurhash is painted on, in pixels. It falls back to the height when provided as a number and otherwise defaults to 90 (for an assumption of 16x9 photos as default)

Keywords

FAQs

Package last updated on 01 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc