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-quote-looper

v1.1.0

Published

NgxQuoteLooper is an Angular library made up of a single component. This component takes an array of quotes and cycles through them, gracefully fading in and out.

Downloads

11

Readme

NgxQuoteLooper

NgxQuoteLooper is an Angular library made up of a single component. This component takes an array of quotes and cycles through them, gracefully fading in and out.

Installation

Use npm to install NgxQuoteLooper. Use the command below or copy it from the Install field provided in the column to the right.

npm i ngx-quote-looper

Component Inputs

  • inputQuotes - any[] - Pass in an array of quotes and associated authors.
  • authorCSS - { [key: string]: string } - Key-string value pair to style the HTML element with the authorCSS class.
  • quoteCSS - { [key: string]: string } - Key-string value pair to style the HTML element with the quoteCSS class.
  • looperCSS - { [key: string]: string } - Key-string value pair to style the HTML element with the looperCSS class.
  • fadeDuration - number - A number to control the duration of the fade in and fade out. This number should be treated as a millisecond value (3000 = 3 seconds). Default is 3000 (3 seconds).
  • loopDuration - number - A number to control the duration of the full loop for a quote (both the fading in and out). This number should be treated as a millisecond value (3000 = 3 seconds). This value should be at least double the amount of the fadeDuration value. Default is 6000 (6 seconds).
  • randomize - boolean - Controls whether the order of the quotes array should be randomized. Default is false.

Usage

HTML

<ngx-quote-looper 
           [inputQuotes]="quoteData" 
           [authorCSS]="{'text-align': 'right'}" 
           [quoteCSS]="{'text-align': 'justify', 'font-size': 'var(--font-body)'}"
           [looperCSS]="{'padding': '2rem'}"
           [fadeDuration]="4000"
           [loopDuration]="10000"
           [randomize]="true"
                >
</ngx-quote-looper>

TypeScript

import { NgxQuoteLooperComponent } from 'ngx-quote-looper';

// If Standalone:
imports: [ NgxQuoteLooperComponent ],

Styling

You can make use of the authorCSS, looperCSS, and quoteCSS properties to style the elements using the ngStyle directive.

OR you can add the styles directly to the apps root styles file:

.ngx-author {
    text-align: right;
} 

.ngx-quote {
    text-align: justify;
    font-size: var(--font-body);
}

.ngx-looper {
    padding: 2rem;
}

Quote array example

The inputQuotes property has a type of any[]. It should be made up of a quote and author to achieve the intended effect for this package.

quoteData = [
    {quote: `Work hard in silence, let your success be your noise.`},
    {quote: `It's no use going back to yesterday, because I was a different person then.`, author: `Lewis Carroll`},
    {quote: `Experience is one thing you can't get for nothing.`, author: `Oscar Wilde`},
    {quote: `If you take too long to decide what to do with your life, you'll find you've done it.` },
    {quote: `The grass is greener where you water it.`, author: `Neil Barringham`},
    {quote: `Show me a person who never made a mistake, and I will show you a person who never did anything.`, author: `William Rosenberg`},
    {quote: `Seek inspiration for it's a state of mind that can make a man divine.`, author: `Vishal Kapoor`},
    {quote: `Always go too far, because that's where you'll find the truth.`, author: `Albert Camus`},
]

License

MIT