npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

image-quad

v1.0.0

Published

Simple little component to display images in grid with fashion.

Downloads

15

Readme

ImageBlock

This library was created with the latest angular version and is tested against an Angular 17 app.

  • A simple component to be used within Angular applications.
  • This component display images in a grid with fashion.
  • Several behaviour can be and suggested to be configured.
  • It is developed using Angular >=17.0.0 and its introduces features like standalone components, new template controls and recursive component hierarchy.
  • Library location: projects/image-quad directory of this repository.

Examples/Demo

  • A simple Example can be found on Azure: https://proud-dune-0a9216403.4.azurestaticapps.net.

Installation of the library

The library is available as an npm package. To install the package run the following command:

npm i image-quad

API

import { ImageQuadComponent } from 'image-quad' selector: ngx-image-quad

@Inputs()

| Input | Type | Required | Description | | ---------------- | ------- | -------------------------- | --------------------------------------------------------------------------------------------------------- | | mode | Mode | YES | Configure the behaviour of the layout with fixed predefined ones or with custom setups. Also can use random layouts. Available values: 'random', 'fullRandom', 'fixedOne', 'fixedTwo', 'fixedThree', {q1:true, q2:false, q3:true, q4: {q1:true}} | | imagePaths | string[] | YES | The list of images that will be randomly selected. E.g.: ./assets/image.png */ | | size | number | Optional, default: 160 | Size of level 1 image in pixel | | gap | number | Optional, default: 4 | Gap between the images in pixel | | level | number | Optional, default: 1 | Do not set this parameter manually | | animation | string | Optional, default: 'fadeAnimation' | Choose from predefined animations or disable it. Valid Values: 'fadeAnimation', 'spinAnimation', 'scaleAnimation', 'vortexAnimation', 'disabled' |

Usage

Library provides 1 standalone component, which as other modules can be imported to your application in the usual ways.

  1. Register the ImageQuadComponent in your app module.

import { ImageQuadComponent } from 'image-quad';

import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatAutocompleteModule, MatInputModule } from '@angular/material';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ImageQuadComponent } from 'image-quad';
import { AppComponent } from './app.component';

@NgModule({
 declarations: [AppComponent],
 imports: [
   BrowserModule,
   BrowserAnimationsModule,
   FormsModule,
   ReactiveFormsModule,
   MatInputModule,
   MatAutocompleteModule,
   HttpClientModule,
   ImageQuadComponent
 ],
 providers: [],
 bootstrap: [AppComponent]
})
export class AppModule {}
  1. Use (ImageQuadComponent) in your component.
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { AppService } from './app.service';

@Component({
  selector: 'app-root',
  template: `<h3>ImageQuad demo app</h3>
  <div>
    <ngx-image-quad [mode]="'random'" [imagePaths]="imagePaths" [size]="120" [gap]="2"></ngx-image-quad>
  </div>
`
})
export class AppComponent implements OnInit {
  imagePaths = ['./assets/image1.png','./assets/imageAB.png','./assets/image123.png'];

  constructor() {}

}

Configs

As a minimum, you need to specify mode and imagePaths:

<ngx-image-quad [mode]="'random'" [imagePaths]="imagePaths"></ngx-image-quad>

For responsiveness you can detect screen size and set size parameter accordingly:

<ngx-image-quad [mode]="setting!" [imagePaths]="images!" [size]="screenSize == 'Small screen'? 60 : 200" [animation]="'spinAnimation'"></ngx-image-quad>