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

@plasma-platform/plasma-banner-scripts

v1.0.55

Published

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

Downloads

8

Readme

Table of Contents

Main

start project npm i && npm start

Initiators

Promotion

Parameters

  • args Object arg only for FlipClock

Examples

const promotion = new Promotion();

Promotion#run

Run promotion banner

Examples

const promotion = new Promotion();
promotion.run();

it

Get

it

hasClass

it

addClass

it

removeClass

it

removeAttribute

it

attr

it

data

it

prepend

it

getAll

getAll

Get all elements by selector

Parameters

Returns any

get

Get element by selector

Parameters

  • selector

Returns any

data

Get data attributes

Parameters

  • element

Returns {}

addClass

Add class

Parameters

  • element
  • classList

Returns any

attr

Attributes

Parameters

  • element
  • key
  • value

Returns any

prepend

Prepend

Parameters

  • parent
  • element

Returns any

removeClass

Parameters

  • element
  • classList

Returns any

hasClass

Parameters

  • element
  • className

Returns boolean

removeAttribute

Remove Attribute

Parameters

  • element
  • name

Returns any

dispatch

Dispatch Event

Parameters

  • options

Returns boolean

Initiators/FlipClock/Faces

FlipClock.js has a fully extendible API to create any clock face you need. More clock faces will be added over time, so be sure to fork the code and make a pull request if you want to see your clock face appear in the core library.

numberize

Formats any array of numbers into a valid array of numbers

Returns Array current time for Daily face

getPlasmaHourlyLabels

Generate array with translate labels for Hourly face

Returns Array translate labels for Hourly face

getPlasmaHourlyCounter

Generate array with current time for Hourly face

Returns Array current time for Hourly face

getPlasmaHourlyCounter

Generate array with current time for Daily face

Returns Array current time for Daily face

getPlasmaDailyLabels

Generate array with translate labels for Daily face

Returns Array translate labels for Daily face

DailyCounterFace

Transform default counter to Plasma standard counter with day counter

Type: Object

HourlyCounterFace

Transform default counter to Plasma standard counter without day counter

Type: Object

Initiators/FlipClock/Language

Ukraine

Object with lang variable for Ukraine

Type: Object

France

Object with lang variable for France

Type: Object

Poland

Object with lang variable for Poland

Type: Object

Initiators/FlipClock

FlipClockInitiator

Parameters

Examples

const flipClock = new FlipClockInitiator({selector: '.Promotion__timer'});

FlipClockInitiator#addExtension

Private method for init extension

FlipClockInitiator#run

Run timer

Examples

const flipClock = new FlipClockInitiator({selector: '.Promotion__timer'});
flipClock.run();

Initiators/UI

UiBanner

Parameters

Examples

const uiBanner = new UiBanner({});

UiBanner#run

run banner function

Parameters

  • tagManager Object manager for dataLayer variable

Examples

const uiBanner = new UiBanner({});
uiBanner.run();

UiBanner#showBanner

show banner function

Examples

const uiBanner = new UiBanner({});
uiBanner.showBanner();

UiBanner#hideBanner

hide banner function

Examples

const uiBanner = new UiBanner({});
uiBanner.hideBanner();

UiPopup

Parameters

Examples

const uiPopup = new UiPopup({});

UiPopup#run

run popup function

Parameters

Examples

const uiPopup = new UiPopup({});
uiPopup.run();

UiPopup#showBanner

show popup function

Examples

const uiPopup = new UiPopup({});
uiPopup.showPopup();

UiPopup#hideBanner

hide popup function

Parameters

Examples

const uiPopup = new UiPopup({});
uiPopup.hidePopup();

UiPopup#outTarget

outTarget popup click function

Parameters

Examples

const uiPopup = new UiPopup({});
$(document).on('click', uiPopup.outTarget);

Initiators/Analytics

TagManager

Parameters

Examples

const tagManager = new TagManager({});

TagManager#onClickBanner

Tag manager event click banner

Examples

const tagManager = new TagManager({});
tagManager.onClickBanner();

TagManager#onShowBanner

Tag manager event show banner

Examples

const tagManager = new TagManager({});
tagManager.onShowBanner();

Utils

Other instruments for normal working project

Parameters

Parameters

  • selector string selector to main wrapper for promotion block

Examples

const params = parameters.parse('.Promotion');

Parameters#parse

Parse and return all params

Parameters

  • selector string jQuery selector

Examples

const params = new Parameters();
params.parse('.Promotion');

Returns Object

Parameters#update

Parse and return all params

Parameters

Examples

const params = new Parameters();
params.update({});

Returns Object

Parameters#prepareData

prepare data for all initiators

Parameters

Returns Object data

Parameters#validate

prepare data for time

Parameters

Returns Object validate data

Parameters#other

prepare data for other

Parameters

Returns Object data

Parameters#lang

prepare data for lang

Parameters

Returns Object data

Parameters#time

prepare data for time

Parameters

Returns Object data

Parameters#flipClock

prepare data for flipClock

Parameters

Returns Object final Data

Parameters#banner

prepare data for banner and popup

Parameters

Returns Object final Data