GithubHelp home page GithubHelp logo

dannyfeliz / anix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adajuly/anix

1.0 3.0 0.0 1.13 MB

Super easy and lightweight transitions animation library

Home Page: https://a-jie.github.io/AniX/

CSS 7.13% HTML 7.94% JavaScript 46.48% TypeScript 38.45%

anix's Introduction

AniX

Super easy and lightweight transitions animation library。

Overview

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...

Install and Include

Install and manage with npm.

$ npm install anix --save-dev
...

import { AniX } from 'anix';

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>

Usage

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()
});

Documentation

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>

Test and Build

build all task

git clone [email protected]:a-jie/AniX.git
npm install
npm run all

build jq and umd

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/

debug the test page

view the ./test/test.html

License

The BSD License.

anix's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.