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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kissmybutton/mc-attr

v0.0.3

Published

MotorCortex Effect plugin for animating SVG and DOM element attributes

Readme

mc-attr

MotorCortex Effect plugin for animating SVG and DOM element attributes.

Animates any numeric attribute directly on the element — SVG geometry (x1, y1, cx, r, width, ...), presentation (stroke-width, fill-opacity, ...), and composite attributes (viewBox, stroke-dasharray).

Installation

npm i @kissmybutton/mc-attr

Usage

import { loadPlugin, HTMLClip } from "@donkeyclip/motorcortex";
import Player from "@donkeyclip/motorcortex-player";
import AttrPlugin from "@kissmybutton/mc-attr";

const McAttr = loadPlugin(AttrPlugin);

Animate SVG line endpoints

clip.addIncident(
  new McAttr.Attr(
    { animatedAttrs: { x2: 500, y2: 300 } },
    { selector: "#myLine", duration: 1000, easing: "easeInOutCubic" }
  ),
  0
);

Animate circle geometry

clip.addIncident(
  new McAttr.Attr(
    { animatedAttrs: { cx: 200, cy: 150, r: 80 } },
    { selector: "#myCircle", duration: 800, easing: "easeOutBack" }
  ),
  500
);

Animate stroke properties

clip.addIncident(
  new McAttr.Attr(
    { animatedAttrs: { strokeWidth: 5, strokeDashoffset: -100 } },
    { selector: "#myPath", duration: 1200 }
  ),
  0
);

Animate viewBox (composite)

clip.addIncident(
  new McAttr.Attr(
    { animatedAttrs: { viewBox: { minX: 100, minY: 100, width: 400, height: 300 } } },
    { selector: "svg", duration: 2000, easing: "easeInOutCubic" }
  ),
  0
);

Supported attributes

SVG geometry

| Attribute | Element(s) | |-----------|-----------| | x, y | rect, image, text, foreignObject | | width, height | rect, image, foreignObject, svg | | cx, cy, r | circle | | rx, ry | ellipse, rect | | x1, y1, x2, y2 | line | | dx, dy | text, tspan | | rotate | text, tspan | | pathLength | path, line, circle, etc. | | textLength | text | | startOffset | textPath | | offset | stop (gradient) |

SVG presentation

| JS name | SVG attribute | |---------|--------------| | opacity | opacity | | strokeWidth | stroke-width | | strokeOpacity | stroke-opacity | | fillOpacity | fill-opacity | | strokeDashoffset | stroke-dashoffset | | strokeMiterlimit | stroke-miterlimit | | fontSize | font-size | | letterSpacing | letter-spacing |

Composite attributes

| Attribute | Sub-keys | SVG output | |-----------|----------|------------| | viewBox | minX, minY, width, height | "0 0 800 600" | | strokeDasharray | dash, gap | "10 5" |

How it works

  • Extends MC's Effect base class
  • getScratchValue() reads the current attribute value from the element via getAttribute(), parsed as a number
  • onProgress(ms) computes the interpolated value at ms / duration and sets it via setAttribute()
  • CamelCase attribute names are auto-mapped to kebab-case for SVG (e.g. strokeWidthstroke-width)
  • Composite attributes split into sub-effects per MC convention; each sub-value is interpolated independently and combined into the attribute string on every frame
  • All MC features work: easing, chaining, initialValues, seek, reverse

Development

npm install
npm start     # builds lib + starts demo on localhost:8091
npm run build # production build

License

MIT