Metal.js Animation Utility

2.0.1 · abandoned · verified Sun Apr 19

metal-anim is an animation utility specifically designed for the now-deprecated Metal.js JavaScript framework. Released as version 2.0.1, it provided capabilities for animating UI components and elements within the Metal.js ecosystem. The parent framework, Metal.js, was officially deprecated in September 2023 and is no longer actively maintained or supported in its open-source form by Liferay, Inc. As such, `metal-anim` is also considered abandoned, with no further updates, bug fixes, or new features expected. Developers seeking animation solutions are advised to consider actively maintained libraries, as this package is tied to an unmaintained framework and may have compatibility issues with modern JavaScript environments or browsers. It was last published seven years ago, aligning with the deprecation status of its core dependency.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates animating a DOM element's position, color, and rotation using assumed `animate` and `easing` functions from `metal-anim`.

import { animate, easing } from 'metal-anim';

const element = document.createElement('div');
element.id = 'animated-box';
element.style.width = '100px';
element.style.height = '100px';
element.style.backgroundColor = 'blue';
element.style.position = 'absolute';
element.style.left = '0px';
document.body.appendChild(element);

// Basic animation: move the box to the right
animate({
  element: '#animated-box',
  properties: {
    left: '500px',
    backgroundColor: 'red',
    transform: 'rotate(360deg)'
  },
  duration: 1000, // milliseconds
  easing: easing.easeInOutQuad,
  onComplete: () => {
    console.log('Animation complete!');
    // Animate back or start a new sequence
    animate({
      element: '#animated-box',
      properties: {
        left: '0px',
        backgroundColor: 'blue',
        transform: 'rotate(0deg)'
      },
      duration: 800,
      easing: easing.easeOutBounce,
      delay: 500
    });
  }
}).start();

// Note: The specific API (`element`, `properties`, `duration`, `easing`, `onComplete`, `start()`) is inferred based on common JavaScript animation libraries due to the absence of direct documentation for metal-anim.

view raw JSON →