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

ng-ghosts-loading

v0.1.2

Published

ng-ghosts-loading is a graphical interface library that you can generate phantom or skeleton components for an angular application, an objective as simple as using ng-ghosts-loading. :smile:

Downloads

4

Readme

ng-ghosts-loading

ng-ghosts-loading is a graphical interface library that you can generate phantom or skeleton components for an angular application, an objective as simple as using ng-ghosts-loading. :smile:

Getting started

ng-ghosts-loading it is an easy way to build page loading elements that make the user more calm. And ng-ghosts-loading also soothes the angular application developer, because it saves work on developing CSS code with complex animations.

Install

you can download ng-ghosts-loading via npm:

npm i ng-ghosts-loading

Or you can download the zip file from the github repository 🐙 :

https://github.com/SergioNoivak/ng-ghosts-loading

Import to your application

In the general module app.module.ts of your application you must import NgGhostsLoadingModule into your angular application.


import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
    // add here

import { NgGhostsLoadingModule} from 'projects/ng-ghosts-loading/src/public-api';

//app.module.ts
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,

    // and add here
    NgGhostsLoadingModule

  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

The ghost-loading tag

The ghost-loading tag is the basic loading container that the framework works.a basic example of using the tag is the creation of a phantom square, as below:

The html code is very simple, as shown below:

<!-- app.component.html -->

<ghost-loading [width] = "100" [height] = "100"   >
</ghost-loading>

When creating a tag ghost-loading, it must have the attributes height and width, which must be passed in pixels.

circular ghost tag

You can create a circular ghost tag by adding the circular property. As below:

<!-- app.component.html -->

<ghost-loading [width] = "100" [height] = "100" circle="true"  >
</ghost-loading>

Adding child tags to ghost-loading

Only with the ghost-loading tag is it not possible to create complex styles, so to develop complex styles it is possible to have children of ghost-loading that will automatically be ghosts. The entire style application will still be preserved for your children from ghost-loading:


<!-- app.component.html -->
<div class="center">
  <ghost-loading [width] = "100" [height] = "100" circle="true"  >
    <img width="100" height="100" style="border-radius: 50%;" src="./image.png" alt="" class="">
  </ghost-loading>
</div>

in this example the image will also be applied by ghosts because it is a child of ghost-loading tag

delay property

The delay property of ghost-loading allows tags to have different ghosts animations. If no delay value is provided, the ghost component will assume 1.5 seconds of animation, but it is possible to provide the delay property with a value in seconds, as follows:


<!-- app.component.html -->

  <ghost-loading [width] = "100" [height] = "10"   >
  </ghost-loading>

  <ghost-loading [delay]="2.0" [width] = "100" [height] = "10"   >
  </ghost-loading>

It is observed that the two ghosts elements are not synchronized, this is due to the delay property.

Example 1 : Dog contact ghost

In this example we are going to create a loading page with a photo of a beautiful dog with four ghost lines. The ghostly style is applied to the dog's photo because he is the son of the tag ghost-loading .Please note below:


 <ghost-loading [width]= "200"  [height]= "200" [circle]="true">
          <img style="border-radius: 50%;" width="200" height="200" [src]="imgSrc" alt="" class="">
 </ghost-loading>

   <div style="margin-top: 10px;">
    <ghost-loading [width]= "200"  [height]= "10" ></ghost-loading>
  </div>
  <div style="margin-top: 10px;">
    <ghost-loading [width]= "200"  [height]= "10" ></ghost-loading>
  </div>
  <div style="margin-top: 10px;">
    <ghost-loading [width]= "200"  [height]= "10" ></ghost-loading>
  </div>
  <div style="margin-top: 10px;">
    <ghost-loading [width]= "200"  [height]= "10" ></ghost-loading>
  </div>

Example 2 : friend's list

In this example we are going to create a list of ghost friends, which can be used on a social network, for example. The vector [1,2,3,4,5] can be created in the component, but it is not the objective here, the example demonstrates how ghosts can be combined in a list to create complex elements, like a list of friends in a network Social.


<!-- app.component.html -->

  <div *ngFor="let item of [1,2,3,4,5]" style="margin-bottom: 5px;" >
    <ghost-loading [width] = "300" [height] = "50"   >
      <div style="display: flex;">
        <ghost-loading [delay]='2.0' [width] = "45" [height] = "45" [circle]="true" ></ghost-loading>
        <div style="flex-direction: column; ">
          <div *ngFor="let x of [1,2,3]" style="margin-bottom: 5px; margin-left: 10px; ">
          <ghost-loading   [delay]='2.0' [width] = "240" [height] = "8" ></ghost-loading>
        </div>
        </div>
      </div>
  </ghost-loading>

  </div>

In this example, asynchronicity is guaranteed thanks to the delay attribute. As the external delay for the root node ghost-loading was not informed, a delay of 1.5 seconds is assumed for this. For the other ghosts elements, there is an informed delay property equal to 2.0 seconds

Tag attributes

List of possible attributes of a ghost-loading:

Contact me

@[email protected]