Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

anm

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anm

Page animations by mouse and touch moves

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-12.5%
Maintainers
1
Weekly downloads
 
Created
Source

anm

Page animations by mouse and touch moves

Install

npm install --save anm
component install andrepolischuk/anm

Usage

var anm = require('anm');

anm('.element')
  .x(15)
  .y(-15)
  .scale(10)
  .opacity(50);

API

anm(element)

Create animation

anm('.element')
anm(document.querySelector('.element'))

.set(prop, val)

Set transform factor

anm('.element').set('scale', 50);

or transform function

anm('.element').set('x', function(cursor) {
  return cursor.x * 0.5;
});

All factors set in percent of max value. Positive values set direct motion, negative - inverse (excluding opacity).

.opacity(val)

Set opacity

anm('.element').opacity(50);

.x(val)

Set horizontal movement

anm('.element').x(-15);

.y(val)

Set vertical movement

anm('.element').y(-15);

.scale(val)

Set rescaling

anm('.element').scale(75);

.rotate(val)

Set rotation

anm('.element').rotate(25);

anm.on()

Enable animations

anm.off()

Disable animations

anm.toggle()

Toggle enabled of animations

Support

  • Chrome
  • Safari
  • Firefox
  • Opera
  • IE 9+

License

MIT

Keywords

FAQs

Package last updated on 02 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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