New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rfx-image-loader

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rfx-image-loader

RfxImageLoader - better image loading

  • 1.0.0-beta.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

RfxImageLoader

Better image loading

Features

  • Customize fade-in duration
  • Customize fade-in timing function
  • add your content to image (eg. loader)

Installation

Install the npm package:

npm install rfx-image-loader

Import module:

import { RfxImageLoaderModule } from 'rfx-image-loader';

@NgModule({
  imports: [
    RfxImageLoaderModule
  ]
})

Usage

1. add libRfxImageLoader to your container

<div libRfxImageLoader></div>

2. pass array of images (RfxImageInterface) to [imageUrls]

public images: RfxImageInterface[];

[...]

this.images = [
  { imageUrl: './assets/image.jpg', priority: 2 },
  { imageUrl: './assets/placeholder_super_low_quality.jpg', priority: 0 }
  { imageUrl: './assets/placeholder_low_quality.jpg', priority: 1 }
];
<div libRfxImageLoader [imageUrls]="images"></div>

3. pass ORIGINAL image width and height to the component

(eg. width: 8480px, height: 5600px)

<div libRfxImageLoader [imageUrls]="images" [imageWidthPx]="8480" [imageHeightPx]="5600"></div>

4. set image placeholder color (optional)

<div libRfxImageLoader [imageUrls]="images" [imageWidthPx]="8480" [imageHeightPx]="5600" placeholderColor="#fafafa"></div>

Configuration

imageUrls: RfxImageInterface[]

  • array of image urls with priority;
  • lower priority = lower quality image;
  • the highest priority is the main image.
RfxImageInterface:
interface RfxImageInterface {
  imageUrl: string;
  priority: number;
}

placeholderColor: string

(default value: "transparent")

imageWidthPx: number

ORIGINAL image width in pixels

imageHeightPx: number

ORIGINAL image height in pixels

animationDurationMs: number

(default value: 300) animation duration in milliseconds

animationTimingFunction: string

(default value: "cubic-bezier(0.4, 0.0, 0.2, 1)") animation timing function

onImageLoaded: EventEmitter<boolean>

Demo

TODO

License

This project is licensed under the MIT License out the Angular CLI Overview and Command Reference page.

Keywords

FAQs

Package last updated on 18 Nov 2021

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