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

pm-animated-banners

v1.0.0

Published

An api for designers to costumise animated banners in partnermarketing.com Campaign Builder

Downloads

3

Readme

pm-animated-banners

Build Status Coverage Status

Partnermarketing front-end API for mapping user data to animate CC html5 banners. Currently only supports animate CC insertion but will eventually support native canvas insertion.

npm install pm-animated-banners

Running the tests

To run eslint and unit tests use the command npm test

Usage

Include dist/pmAnimatedBanners.min.js above the closing </body> tag of the template. Custom properties are to be defined independently from the lib using the window.pmAnimatedBannersConfig method. Add the following JavaScript to the template to start customisation.

Mapping data to animation

  window.pmAnimatedBannersConfig = function(conf) {

    conf.map({
      reference: 'logo',
      image: 'logo.png',
      align: {
        x: 'center',
        y: 'top'
      }
    });

    conf.map({
      reference: 'intro',
      text: 'This is an awesome banner!',
      link: 'http://www.partnermarketing.com',
      onClick: function(layer) {
      	// Handle click event
      }
    });

    conf.map({
      reference: 'stage',
      link: 'http://www.partnermarketing.com'
    });

  };

Requesting user data from api

Data can be retrieved from the api using the getPmData() method, it accepts two arguments. The first is the type this can be either image, text, colour, link and the second is the name as defined in the editor.

  window.pmAnimatedBannersConfig = function(conf) {

    conf.map({
      reference: 'scene1',
      link: getPmData('link', 'scene-1-link')
    });

  };

When using this API references must first be defined inside animate CC before using them in the config. pm-animated-banners animate CC example

Options

reference

Type: string

Options: stage, the animate cc reference example: myIntro, myLogo

Default: null

The shapes reference in animate CC, if using stage this will target the entire animation

image

Type: string

Default: null

An image src to load into this container reference, when inserting images they will auto scale to fit the container references dimensions

text

Type: string

Default: null

A text string to replace the dynamic text in this container text reference

link

Type: string

Default: null

Link to open if this shape reference is clicked

onClick

Type: function

Default: null

Callback function for click event, will fire before window location changes

align.x

Type: string

Options: left, right, center

Default: center

The horizontal alignment of this layer relative to the container reference

align.y

Type: string

Options: top, bottom, center

Default: center

The vertical alignment of this layer relative to the container reference

License

MIT © partmermarketing