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

ngx-count-animation

v3.0.0

Published

A package that elegantly animates number changes, creating a visually engaging transition from one value to another, perfect for counting or displaying real-time data updates.

Downloads

70

Readme

npm version NPM monthly downloads NPM total downloads License: MIT Issues Web Demo

Table of contents

About

A package that elegantly animates number changes, creating a visually engaging transition from one value to another, perfect for counting or displaying real-time data updates.

Getting started

Installation

npm install ngx-count-animation

Import the directive

import { Component } from "@angular/core";
import { NgxCountAnimationDirective } from "ngx-count-animation";

@Component({
  selector: "app-root",
  standalone: true,
  templateUrl: "./app.component.html",
  styleUrl: "./app.component.scss",
  imports: [NgxCountAnimationDirective],
})
export class AppComponent {}

Add provideNgxCountAnimations to your app.config.ts file as shown below.

export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    provideClientHydration(),

    /// Add the code below
    provideNgxCountAnimations(),
  ],
};

Inputs

| Option | Type | Default | Comment | | :-------------------------- | :------ | :------ | :---------------------------------------------------------------------------------------------------------------------------- | | ngxCountAnimation | number | | Sets the target count for the count animation. | | maximumFractionDigits | number | 0 | The maximum number of fraction digits to display. | | minimumFractionDigits | number | 0 | The minimum number of fraction digits to display. | | duration | number | 2000 | Sets the duration of the count animation. | | durationFromValue | number | | Sets the duration based on the given value. | | enableLayoutChangeDetection | boolean | true | When enableLayoutChangeDetection is set to true, there is always an interval listener active that detects layout changes. |

Outputs

| Option | Type | Comment | | :------------- | :----------------- | :-------------------------------------------- | | startAnimation | output | Emits an event at the start of the animation. | | endAnimation | output | Emits an event at the end of the animation. |

Simple example

<div ngxCountAnimation="1000000"></div>

Complete example demonstrating all properties

<div ngxCountAnimation="123456789" duration="2000" maximumFractionDigits="0" minimumFractionDigits="0" enableLayoutChangeDetection="true"></div>

Contributing

I welcome contributions from the open-source community to make this project even better. Whether you want to report a bug, suggest a new feature, or contribute code, I appreciate your help.

Bug Reports and Feature Requests

If you encounter a bug or have an idea for a new feature, please open an issue on my GitHub Issues page. I will review it and discuss the best approach to address it.

Code Contributions

If you'd like to contribute code to this project, please follow these steps:

  1. Fork the repository to your GitHub account.
  2. Clone your forked repository to your local machine.
git clone https://github.com/hm21/ngx-count-animation.git