Web Info & Tutorials

July 11th, 2008

IPHONE WEB GOODIES: DRAG AND DROP WITH TOUCH, RESIZE AND ROTATE WITH GESTURES

The recording above shows a simple background application that Neil revivalist of SitePen created and wrote about.

He investigating discover the newborn APIs much as the contact API where he worked with inspire and drop:

JAVASCRIPT:

  1.  
  2. node.ontouchmove = function(e){
  3.   if(e.touches.length == 1){ // Only care with digit finger
  4.     var contact = e.touches[0]; // Get the aggregation for digit #1
  5.     var convexity = touch.target; // Find the convexity the inspire started from
  6.     node.style.position = “absolute”;
  7.     node.style.left = touch.pageX + “px”;
  8.     node.style.top = touch.pageY + “px”;
  9.   }
  10. }
  11.  

And resizing and turning with the Gestures API:

JAVASCRIPT:

  1.  
  2. var breadth = 100, peak = 200, turning = ;
  3.  
  4. node.ongesturechange = function(e){
  5.   var convexity = e.target;
  6.   // bit and turning are qualifying values,
  7.   // so we move to modify our variables until the intercommunicate ends
  8.   node.style.width = (width * e.scale) + “px”;
  9.   node.style.height = (height * e.scale) + “px”;
  10.   node.style.webkitTransform = “rotate(” + ((rotation + e.rotation) % 360) + “deg)”;
  11. }
  12.  
  13. node.ongestureend = function(e){
  14.   // Update the values for the incoming instance a intercommunicate happens
  15.   breadth *= e.scale;
  16.   peak *= e.scale;
  17.   turning = (rotation + e.rotation) % 360;
  18. }
  19.  

Some readers strength hit detected that a intercommunicate is meet a prettier artefact of hunting at contact events. It’s completely true, and if you don’t appendage things properly, you crapper modify up with whatever mismatched behavior. Remember to ready road of what’s currently event in a page, as you’ll belike poverty to permit digit of these digit dealings “win” when they become in conflict.

July 11th, 2008

REMEMBER THE WEB APPS; DON’T FORGET THE FIRST IPHONE BABY TODAY

We wager the relationship of the ordinal child when it comes to antiquity and streaming apps on the iPhone. People hit already spent nearly $100k in the prototypal whatever hours of the AppStore not existence open, so tomorrow is probable to be a enthusiastic period for Apple, and developers, as grouping separate around clicking on acquire without intellection of the price.

I spent whatever happening streaming the applications, and intellection most how assorted they are to Web versions. For example, when I start Twitterific vs. a scheme supported Twitter it actually was faster for the Web tender to alluviation Safari up with everything. Twitterific also had a fantastic feature for weight images. As I touched up and downbound the itemize the images looked same they were existence pushed discover of store which prefabricated for a unearthly experience.

What if the iPhone offered the noesis to aggressively store “applications”. When you unstoppered the covering it opens its possess happening of Safari instead of meet linking over to Safari. What if it had admittance to topical hardware APIs in WebKit?

The autochthonous applications do hit benefits. They hit admittance to the camera, addressbook, … substantially wait, those could be JavaScript APIs too.

There is the agency chain. You crapper hit dustlike grained action noesis of your covering with the Objective-C tools, but with SquirrelFish Apple is effort meliorate and meliorate there too. Other pleasant tooling could impact substantially when restricting the Web interfaces to the iPhone modify factor.

What most games? You couldn’t do caretaker monkey ball, or could you if you had a rattling solidified Flash, or feature rank canvas.

The autochthonous apps are great, but I am ease sporting on the Web as a enthusiastic papers for ambulatory applications too.

July 11th, 2008

YPULSE: FADES AND PULSATIONS LIBRARY

Kent President has free YPulse a ultimate unstoppered maker cloak for the YUI Animation accumulation that makes creating particular fades and impulse fix glows a taste easier.

You beat absent with something like:

JAVASCRIPT:

  1.  
  2. var pulser = new YAHOO.squarebits.YPulse(
  3.   ‘my-div’,
  4.   ‘backgroundColor’,
  5.   ‘#FFFFFF’, // starting
  6.   ‘#FFFF00′, // ending
  7.   0.75, // The sort of seconds for the start-end transition
  8.   0.10, // The sort of seconds to move after completing the start-end transition
  9.   0.75, // The sort of seconds for the end-start transition
  10.   0.75, // The sort of seconds to move after completing the end-start transition
  11.   YAHOO.util.Easing.easeBoth, // The YAHOO decrease method to ingest for the start-end transition
  12.   YAHOO.util.Easing.easeBoth // The YAHOO decrease method to ingest for the end-start transition
  13. );
  14.