GithubHelp home page GithubHelp logo

ashwinikumar01 / ngx-image-blur Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hughjdavey/ngx-image-blur

0.0 0.0 0.0 8 KB

Simple image blur loader component for Angular >= 2, inspired by image blur loading on Medium

License: Creative Commons Zero v1.0 Universal

JavaScript 32.73% TypeScript 67.27%

ngx-image-blur's Introduction

NgxImageBlur

Simple image blur loader component for Angular >= 2, inspired by image blur loading on Medium.

Demo can be found here

Installation

  • npm install --save ngx-image-blur
  • Edit your app.module file:
...
import { NgxImageBlurModule } from 'ngx-image-blur';

@NgModule({
  ...
  imports: [
    ...
    NgxImageBlurModule
  ],
  ...
})

Usage

Type Definitions:
  • type LazyMode = 'eager' | 'half-lazy' | 'lazy'
    • eager - image starts loading as soon as the page loads and does its blur transitions as soon as it can
    • half-lazy - image starts loading as soon as the page loads, but delays the blur transition until it comes into view
    • lazy - image starts loading only once it comes into view
@Input() options:
  • height [string] - desired height of image e.g. '50vh' (required)
  • width [string] - desired width of image e.g. '500px' (required)
  • previewSrc [string] - link that can go in a url() (e.g. web link or assets path) to smaller thumbnail version of image (required)
  • width [string] - link that can go in a url() (e.g. web link or assets path) to full image (required)
  • blurPixels [integer] - how much blur to apply to the preview image (defaults to 8)
  • transitionDuration [integer] - time in ms to take for the transition between preview and fill images (defaults to 500, i.e. half a second)
  • objectFit [string] - CSS object-fit for the image (defaults to 'cover')
  • lazyMode [LazyMode] - which LazyMode to use for image loading - see above (defaults to 'eager')

ngx-image-blur's People

Contributors

hughjdavey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.