New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

anix

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anix - npm Package Compare versions

Comparing version 0.1.8 to 0.2.2

gettransform.d.ts

15

anix.d.ts
import { IEase } from './ease';
import { ITransform } from './cssx';
import { InputValue } from './gettransform';
/**

@@ -47,11 +48,4 @@ * AniX

kill(ele: any, complete?: boolean): void;
getTransform(param: {
x?: string | number;
y?: string | number;
scale?: string | number;
rotate?: string | number;
pre?: string | Object;
no?: Object;
[propName: string]: any;
}): ITransform;
getTransform(param: InputValue): ITransform;
get(param: InputValue): ITransform;
private start(ele, transition, time, args);

@@ -70,2 +64,5 @@ /**

private addCallback(ele, time, args);
/**
* get style key name
*/
private getPureStyleKeys(args);

@@ -72,0 +69,0 @@ /**

40

anix.js

@@ -7,2 +7,3 @@ "use strict";

var gethtmlelement_1 = require("./gethtmlelement");
var gettransform_1 = require("./gettransform");
/**

@@ -61,7 +62,7 @@ * AniX

//transition += CssX.convertStyleMode(styles[i], "css");
transition += ' ' + time + 's';
transition += " " + time + "s";
if (args.ease)
transition += ' ' + args.ease;
transition += " " + args.ease;
if (args.delay)
transition += ' ' + args.delay + 's';
transition += " " + args.delay + "s";
}

@@ -95,28 +96,7 @@ if (this.compatible && !this.support)

AniXClass.prototype.getTransform = function (param) {
var transform = "";
if (param.x !== undefined || param.y !== undefined) {
var x = typeof param.x == "string" ? param.x : (param.x || 0) + 'px';
var y = typeof param.y == "string" ? param.y : (param.y || 0) + 'px';
transform += " translate(" + x + ", " + y + ")";
}
if (param.scale)
transform += " scale(" + param.scale + ", " + param.scale + ")";
if (param.rotate)
transform += " rotate(" + param.rotate + "deg)";
if (param.pre)
transform = param.pre + " " + transform;
var css = {
"transform": transform,
"-webkit-transform": transform,
"-ms-transform": transform,
"-o-transform": transform,
"-moz-transform": transform
};
if (param.no) {
for (var key in param.no) {
css[key] = param.no[key];
}
}
return css;
return gettransform_1.getTransform(param);
};
AniXClass.prototype.get = function (param) {
return gettransform_1.getTransform(param);
};
AniXClass.prototype.start = function (ele, transition, time, args) {

@@ -183,3 +163,5 @@ ele = gethtmlelement_1.getHTMLElement(ele);

};
//get style key name
/**
* get style key name
*/
AniXClass.prototype.getPureStyleKeys = function (args) {

@@ -186,0 +168,0 @@ if (args.all || args.css || args.className)

@@ -9,3 +9,3 @@ export declare class CssXClass {

getPrefix(mode?: number): string;
css(ele: HTMLElement, props: Object, type?: number): void;
css(ele: HTMLElement, props: any, type?: number): void;
css2(ele: HTMLElement, style: string, value: any): void;

@@ -21,4 +21,4 @@ css3(ele: HTMLElement, style: string, value: any): void;

hasClass(ele: HTMLElement, className: string): any;
addEventListener(ele: HTMLElement, event: string, handler: any): void;
removeEventListener(ele: HTMLElement, event: string, handler: any): void;
addEventListener(ele: any, event: string, handler: any): void;
removeEventListener(ele: any, event: string, handler: any): void;
}

@@ -31,4 +31,13 @@ export interface ITransform {

"-moz-transform": string;
[prop: string]: any;
}
export interface ITransform2 {
'webkitTransform': string;
'OTransform': string;
'msTransform': string;
'MozTransform': string;
'transform': string;
[prop: string]: any;
}
declare let CssX: CssXClass;
export { CssX };

@@ -35,11 +35,11 @@ "use strict";

};
var el = document.createElement('p');
document.body.insertBefore(el, null);
var ele = document.createElement('p');
document.body.insertBefore(ele, null);
for (var t in transforms) {
if (el.style[t] !== undefined) {
el.style[t] = "translate3d(1px, 1px, 1px)";
has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
if (ele.style[t] !== undefined) {
ele.style[t] = "translate3d(1px, 1px, 1px)";
has3d = window.getComputedStyle(ele).getPropertyValue(transforms[t]);
}
}
document.body.removeChild(el);
document.body.removeChild(ele);
return (has3d !== undefined && has3d.length > 0 && has3d !== "none");

@@ -46,0 +46,0 @@ };

@@ -5,3 +5,3 @@ "use strict";

if (!ele)
throw "ele is null";
throw "AniX Error :: element is null!";
if (ele.nodeName)

@@ -8,0 +8,0 @@ return ele;

{
"name": "anix",
"version": "0.1.8",
"version": "0.2.2",
"license": "BSD",
"keywords": [
"react",
"motion",

@@ -15,8 +14,12 @@ "animation",

"devDependencies": {
"@types/node": "^7.0.18",
"npm-run-all": "^4.0.2",
"prepend-file": "^1.3.1",
"shx": "^0.2.2",
"ts-loader": "^2.0.3",
"tslint": "^5.2.0",
"typescript": "^2.3.2"
"typescript": "^2.3.2",
"webpack": "^2.5.1"
},
"typings": "index.d.ts"
}

@@ -25,10 +25,10 @@ # AniX

//2. use
//<button (click)="animation(rect)">click animate</button>
//<div class="rect" #rect></div>
private animation(dom: ElementRef) {
this.AniX.to(dom, 1, {
width: "200px",
height: "100px"
});
}
AniX.to(dom, 1, {
width: "200px",
height: "100px",
delay: .5,
onComplete: ()=>{
alert("over");
}
});
```

@@ -41,3 +41,3 @@

```
view on http://localhost:4200/
view on http://localhost:3000/

@@ -44,0 +44,0 @@ ## License

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc