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

yo-marquee

v1.0.9

Published

YoMarquee is an easy-to-use, customizable, and lightweight JavaScript library for creating marquee effects.

Downloads

52

Readme

YoMarquee

YoMarquee is an easy-to-use, customizable, and lightweight JavaScript library for creating marquee effects.

Features

  • Auto-fill: Automatically fills the blank space in the marquee with copies of the children.
  • Play/Pause: Play or pause the marquee animation.
  • Pause on Hover/Click: Pause the marquee when hovered or clicked.
  • Direction: Control the direction of the marquee.
  • Speed: Set the speed of the marquee animation.
  • Gradient: Add gradient overlay for a smooth visual effect.
  • Callback Functions: Add callbacks for loop completion and finishing.

Usage

To use YoMarquee in your project, follow these steps:

NPM

The recommended installation method is NPM. Install the latest version with the following command:

$ npm install yo-marquee

Hosting Files

You can download the YoMarquee package from the following link:

Download

Go to the dist directory, and import the yo-marquee.min.js file with the tag:

<script src="path-to-the-file/yo-marquee.min.js"></script>

Basic Example

Here's a basic example of how to use YoMarquee:

HTML: Add a container for the marquee effect.

<div id="marquee-container" class="marquee">
	<p>Your scrolling text goes here.</p>
	<p>Your scrolling text goes here.</p>
</div>

JavaScript: Initialize YoMarquee on your elements.

const marquee = new YoMarquee('#example-container', {
	autoFill: true, // Automatically fills the marquee with content
	speed: 50, // Speed of the marquee
	direction: 'left', // Direction of the marquee (left, right, up, down)
});

marquee.init();

Files

You will find two files in the dist directory:

  • yo-marquee.min.js
  • yo-marquee.css

Options

autoFill (boolean)

Description: Automatically fills blank space in the marquee with copies of the children. Default: false Example: autoFill: true

play (boolean)

Description: Whether to play or pause the marquee. Default: true Example: play: false

pauseOnHover (boolean)

Description: Whether to pause the marquee when hovered. Default: false Example: pauseOnHover: true

pauseOnClick (boolean)

Description: Whether to pause the marquee when clicked. Default: false Example: pauseOnClick: true

direction (string)

Description: The direction the marquee is sliding. Options: "left", "right", "up", "down" Default: "left" Example: direction: 'right'

speed (number)

Description: Speed calculated as pixels/second. Default: 50 Example: speed: 100

delay (number)

Description: Duration to delay the animation after render, in seconds. Default: 0 Example: delay: 2

loop (number)

Description: The number of times the marquee should loop. 0 is equivalent to infinite. Default: 0 Example: loop: 3

gradient (boolean)

Description: Whether to show the gradient or not. Default: false Example: gradient: true

gradientColor (string)

Description: The color of the gradient. Default: "white" Example: gradientColor: 'rgba(255, 255, 255, 0.5)'

gradientWidth (number|string)

Description: The width of the gradient on either side. Default: 200 Example: gradientWidth: '10%'