Super easy and lightweight transitions animation library。
AniX is a lightweight and easy-to-use animation library with excellent performance and good compatibility for modern browsers.
It uses the native css transition attribute, better than js simulation animation performance. And can use hardware acceleration.
AniX is less than 10k in size, and it does not change your coding habit as much as possible. There are multiple versions of the AniX option, umd version, jQuery version and react version...
$ npm install anix --save-dev
...
import { AniX } from 'anix';
The umd version anix.umd.js. Check out the UMD repository for more details.
<script src="./js/anix.umd.ts" type="text/javascript"></script>
jQuery plugin anix.jq.js, that supports chain syntax.
<script src="./js/jquery.js" type="text/javascript"></script>
<script src="./js/anix.jq.ts" type="text/javascript"></script>
use the pure AniX library.
AniX.to(dom, 1, {
width: "200px",
height: "100px",
delay: 0.5,
onComplete: function(){
alert("over");
}
});
use jquery plugin anix.jq.js
$('.con').css({'left':'0px'}).to(.5, {
'left': Math.random() * $(window).width() + 'px',
'background-color': getRandomColor()
});
vist on https://a-jie.github.io/AniX/
the jquery plugin anix.jq.js
//AniX.to
$(..).to(time: number, args: {ease?:string; delay?:number; [propName:string]:any;})
//AniX.fromTo
$(..).fromTo(time: number, fromArgs: Object, toArgs: Object)
//AniX.kill
$(..).kill(complete?: boolean)
//AniX.get
$(..).getTransform(param: any)
//AniX.ease
$.ease.easeOut
about the React version react-anix
//1. import module
import { Anix } from 'react-anix';
<Anix
anis = {[
{ left: '120px', background: '#000', time: .5 },
{ background: color, width: 0, time: .5, onComplete: this.aniComplete.bind(this), disAppear: true },
{ time: .5, from: { width: '0px' }, to: { width: '350px', background: color, delay: .1 }, appear: true }
]}
or
ani={{ left:'20px', time:.5, delay: 1 }}
or
appear={{ left:'20px', time:.5 }}
control animation play
play={this.state.play}
>
...
</Anix>
git clone [email protected]:a-jie/AniX.git
npm install
npm run all
npm run jq
npm run umd
test and build example (the document page) made by create-react-app
cd ./example
npm install
npm start
npm run build
view on http://localhost:3000/
view the ./test/test.html
anix's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.