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

vanilla-infinite-marquee

v1.0.12

Published

Infinite Horizontal & Vertical Marquee animation based on CSS and controlled with JS

Downloads

1,352

Readme

Vanilla Infinite Marquee

npm npm downloads npm license

Installation

CDN Usage

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/infinite-marquee.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/infinite-marquee.bundle.js"></script>

If you're using npm, in the command prompt run:

npm install vanilla-infinite-marquee

If you're using yarn, run:

yarn add vanilla-infinite-marquee

Demo

Usage

To use the component, first import CSS styles into your CSS/SCSS file:

@import 'node_modules/vanilla-infinite-marquee/infinite-marquee.css'; //OR
@import 'node_modules/vanilla-infinite-marquee/infinite-marquee.scss';

Basic HTML Input

<div class="marquee-container">
    <p>Horizontal Marquee Item 1</p>
    <p>Horizontal Marquee Item 2</p>
</div>

import InfiniteMarquee into your JS file:

import InfiniteMarquee from 'vanilla-infinite-marquee';

new InfiniteMarquee({
	element: '.marquee-container',
	speed: 25000,
	smoothEdges: true,
	direction: 'right',
	gap: '15px',
	duplicateCount: 2,
	mobileSettings: {
		direction: 'top',
		speed: 20000
	},
	on: {
		beforeInit: () => {
			console.log('Not Yet Initialized');
		},

		afterInit: () => {
			console.log('Initialized');
		}
	}
});

Options

| Option | Type | Default | Description | |:---------------------|:-----------------|:-----------------------------------------|:-------------------------------------------------------------------------------------------------| | element | string, Node | null | Selector | | direction | string | "left" | Direction of Marquee animation, "left", "right", "top", "bottom" | | spaceBetween | string | "0px" | Gaps to be used for "left" or "right" direction ONLY | | gap | object | {vertical: "5px", "horizontal: "0px" } | Gaps to be used for "top" or "bottom" direction ONLY | | speed | number | 10000 | Speed of animation in ms | | smoothEdges | boolean | false | Whether to smooth covered edges or not | | fullContainer | boolean | true | Fill the full width of container(DESKTOP ONLY), for "left" or "right" direction ONLY | | fullContainerWidth | number | 100 | Full width container size with number value that later converts into percentage | | pauseOnHover | boolean | false | Pause animation on hover | | destroyOnDesktop | boolean | false | Destroy Marquee structure and animation on "Desktop" | | destroyOnMobile | boolean | false | Destroy Marquee structure and animation on "Mobile" | | debugging | boolean | false | Debug in console each event of Marquee lifecycle | | elementClass | string | marquee-container | Class of Container that will be used to destroy Marquee | | duplicateCount | number | 1 | Count of marquee be duplicated to show an effect of continuous flow | | breakpointSize | number | 991.8 | "max-width" breakpoint for responsive devices, accepted only single breakpoint | | mobileSettings | object | {} | Responsive options (works only for spaceBetween, gap, speed and direction properties) | | on | object | {} | Object to contain callback functions below | | beforeInit | function | null | A callback function that invokes before marquee initialization | | afterInit | function | null | A callback function that invokes after marquee initialization | | pauseAnimation | function | null | A callback function that invokes on Pause | | resumeAnimation | function | null | A callback function that invokes on Resume |