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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@donkeyclip/motorcortex-flubber

v2.1.0

Published

**Table of Contents**

Readme

MotorCortex-Flubber

Table of Contents

Demo

Check it out here

Intro / Features

Motorcortex-Flubber plugin brings flubber library's capabilities into MotorCortex, available as Incident. "The goal of this library is to provide a best-guess interpolation for any two arbitrary shapes (or collections of shapes) that results in a reasonably smooth animation, without overthinking it."

This Plugin exposes one Incident:

  • Flubber

Getting Started

Installation

$ npm install @donkeyclip/motorcortex-flubber
# OR
$ yarn add @donkeyclip/motorcortex-flubber

Importing and loading

import { loadPlugin } from "@donkeyclip/motorcortex";
import FlubberPluginDefinition from "@donkeyclip/motorcortex-flubber";
const FlubberPlugin = loadPlugin(FlubberPluginDefinition);

Creating Incidents

Flubber

Flubber Incident accepts on its animatedAttrs property the d parameter which defines the final state of the svg path to be transformed. The Incident should target the svg path to transform (via the selector of its props). Here's is an example which include both the creation of the incident and the creation of the clip where the incident will be applied:

// Don't forget to import also HTMLClip from "@donkeyclip/motorcortex" in order to create a clip.
import { HTMLClip } from "@donkeyclip/motorcortex";
// Νotice the svg path with id "flubber" on the html of the clip. 
// This is the path we will apply the Flubber transformation to.
const myClip = new HTMLClip({
  host: document.getElementById("clip-container"),
  html: `<svg xmlns="http://www.w3.org/2000/svg" width="960" height="500">
            <g transform="translate(240 10) scale(30 30)">
                <path id="flubber" d="M1,0 L2,2 L0,2 Z"></path>
            </g>
        </svg>`,
  css: `#flubber{
        fill: #8b00ff;
        display:block;
    }
    svg{
        margin-top:150px;
    }`,
});

const flubberIncident = new FlubberPlugin.Flubber(
  {
    animatedAttrs: {
      d: [
        [0, 0],
        [2, 0],
        [2, 1],
        [1, 2],
        [0, 1],
      ],
    },
  },
  {
    selector: "#flubber",
    duration: 2000,
  }
);

Notice that we passed the new d parameter of the svg path. d can be defined via various ways (have a look here for more info: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d. According to the provided definition an alternative way to define the new d value can be:

const fubberIncident2 = new FlubberPlugin.Flubber(
  {
    animatedAttrs: {
      d: "M2 1 h1 v1 h1 v1 h-1 v1 h-1 v-1 h-1 v-1 h1 z",
    },
  },
  {
    selector: "#flubber",
    duration: 2000,
  }
);

Adding Incidents in your clip

clipName.addIncident(incidentName,startTime);

Contributing

In general, we follow the "fork-and-pull" Git workflow, so if you want to submit patches and additions you should follow the next steps:

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

License

MIT License

Sponsored by