2.0.3 • Published 7 years ago

anim-panel v2.0.3

Weekly downloads
47
License
MIT
Repository
github
Last release
7 years ago

AnimPanel

A utility panel to make working with Greensock Animation Platform timeline animations easier.


Intro

AnimPanel simplifies the process of building complex timeline-based animations using the Greensock Animation Platform by adding a handful of extremely useful debugging tools, including:

  • Play, Pause, and Restart buttons
  • A visual playback scrubber
  • Buttons to dynamically change the playback speed (1x, 0.5x, 0.2x, etc)
  • A display of the current timeline time
  • For TimelineMax timelines, automatically-added buttons to jump to each label in the timeline
  • The ability to easily set custom loop in and out ranges for focusing on a specific span of the overall timeline, including making these in/out points persistent between page refreshes
  • Keyboard shortcuts for common actions

Demo

View the demo on CodePen

Install

You can install AnimPanel via npm:

npm install anim-panel --save

or simply include it in your HTML:

<script src="anim_panel.js"></script>

Use

// Require the module if you're using something like browserify or webpack
var AnimPanel = require('anim-panel')

// Create your Greensock timeline using TimelineLite or TimelineMax
// (using TimelineMax gets you extra goodies like label buttons)
var tl = new TimelineMax({});

// Add some stuff to your timeline (see the gsap docs if you don't know how to do this)
tl.add(…);

// Create the AnimPanel, passing it your Timeline instance
new AnimPanel(tl);

Keyboard Shortcuts

AnimPanel includes keyboard-shorcuts for a variety of common actions.

ActionKeyboard Shortcut
Toggle play/pausespace
Set speed to 1x1
Set speed to 0.5x2
Set speed to 0.25x3
Set range startb
Set range endn
Toggle rangeshift + space
Clear rangesshift + x
Jump forward 0.1 secondsalt + right arrow or page down
Jump backward 0.1 secondsalt + left arrow or page up
Jump forward 1 secondshift + alt + right arrow or shift + page down
Jump backward 1 secondshift + alt + left arrow or shift + page down
Jump forward 0.03 secondscontrol + alt + right arrow
Jump backward 0.03 secondscontrol + alt + left arrow
Jump to start of timeline/rangereturn or enter
Expand range by 0.1 secondsalt + up arrow
Contract range by 0.1 secondsalt + down arrow
Expand range by 1 secondshift + alt + up arrow
Contract range by 1 secondshift + alt + down arrow

Customizing Shortcuts

If any of these shortcut defaults don't work for you, you can customize them when initializing AnimPanel:

new AnimPanel(tl, {
  shortcuts: {
    togglePlay: 'tab',
    setRangeStart: 'i',
    setRangeEnd: 'o'
  }
});

Dev

npm start: Automatically builds on file change and starts a live reload server with an example at http://localhost:3000/example/

npm run build: Builds production-ready files

Changelog

See the release page.

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago