Resources/js/d/about.js
author Mahlon E. Smith <mahlon@martini.nu>
Mon, 02 Sep 2013 02:22:21 -0700
changeset 0 80c32ef237c6
child 1 b3419d05eabb
permissions -rw-r--r--
Initial commit.


// Animate the background image.
//
var set_frame = function( frame ) {
	var frames = 8;
	var speed  = 100;
	var next   = frame + 1;
	var body   = $( 'body' );

	if ( next > frames + 1 ) return;
	body.css({ backgroundImage: "url(app://img/about/" + frame + ".jpg)" });
	D.delay( function(){ set_frame( next ) }, speed );
};


$( window ).ready( function() {
	$( '#name' ).html( D.name );
	$( '#version' ).html( D.version );
	$( '#tide-version' ).html( D.ti_version );
	$( '#platform' ).html( D.platform );
	$( '#arch' ).html( D.architecture );

	$( 'body' ).bind( 'click', function() { Ti.UI.currentWindow.close(); });

	// preload animation images to prevent flicker.
	for ( var i = 1; i < 9; i++ ) {
		var img = new Image( 600,432 );
		img.src = "app://img/about/" + i + ".jpg"; 
	}

	D.delay( function(){ set_frame( 1 ) }, 5000 );
});