Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 376510be6f
Fetching contributors…

Cannot retrieve contributors at this time

56 lines (46 sloc) 2.054 kB
<script src="burst-core.js"></script>
<script>
function loaded(){
var redBox = document.getElementById('redBox');
var greenBox = document.getElementById('greenBox');
// Invoke Burst Controller
burst
// Create a Timeline (name, start-frame, frames-length, speed-ratio, looping, callback)
.timeline('ArbitraryTimelineName',0,100,1,true,function(){ alert('All done!'); } ) // Callbacks do not fire on looping timelines
// Create a Shape Object (name, object-reference)
.shape('ArbitrarilyNamedRedBox',redBox.style)
// Create a Track (property-reference)
.track('left')
// Create a Key (frame, value-of-referenced-property, easing-type)
.key(0,0,'inOutBounce')
// Create another Key: Keys can be created in any order
.key(100,50)
// Create a second Shape with it's object reference
.shape('ArbitrarilyNamedGreenBox',greenBox.style)
// Create a Track (property-reference)
.track('top')
// Create a Key (frame, value-of-referenced-property, easing-type)
.key(0,0,'inOutBounce')
// Create another Key: Keys can be created in any order
.key(50,50)
.track('width')
// Create a Key (frame, value-of-referenced-property, easing-type)
.key(0,50)
.key(50,50)
.key(75,200)
.key(100,50)
// Close the timeline declaration
;
// Load a timeline into the Burst Player
burst.load('ArbitraryTimelineName');
// Unload a timeline from the Burst Player
//burst.unload('ArbitraryTimelineName');
// Begin playback of all loaded timelines
burst.play();
// Stop playback of all loaded timelines
// burst.stop();
}
addEventListener('DOMContentLoaded', function(){ loaded(); }, false);
</script>
<div id="redBox" style="background:red;position:absolute;left:0;top:0;width:50px;height:50px"></div>
<div id="greenBox" style="background:limegreen;position:absolute;left:50;top:0;width:50px;height:50px"></div>
Jump to Line
Something went wrong with that request. Please try again.