Resources/js/d/about.js
changeset 0 80c32ef237c6
child 1 b3419d05eabb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/js/d/about.js	Mon Sep 02 02:22:21 2013 -0700
@@ -0,0 +1,34 @@
+
+// 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 );
+});
+
+