Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@huangjs888/transform

huangjs88816MIT1.2.2TypeScript support: included

Style transform

huangjs, huangjs888, transform, matrix

readme

transform

样式变换

安装使用


npm install @huangjs888/transform --save

css3样式:


body{
  transform: matrix3d(
    1, 0, 0, 0,
    0, 1, 0, 0,
    0, 0, 1, 0,
    0, 0, 0, 1
  );
}

使用方法


import Transform from '@huangjs888/transform';

const transform = new Transform({ a: 0, k: 1, x: 0, y: 0 });
const raw = transform.toRaw();
raw.a += 1;
raw.k *= 2;
raw.x += 1;
raw.y += 1;
document.body.style.transform = transform.toString();