Activate your free membership today | Log-in

Monday, September 29th, 2008

ZAP: Same timeline for effects across browsers

Category: JavaScript

<p>Mikael Bergkvist was frustrated with how effects in different browsers were far from uniform. They could run around in a modern browser, and lag on old ones. In general many effects seem to be far from smooth, and we have talked about the need to have a Timer thread that you can tie into to get the work smoother.

Well, Mikael decided to develop ZAP:

ZAP is a widgetplus project which boosts javascripts up to eight times the speed without having to resort to a plugin of any sort, by using a completely new approach that takes into account how the javascript engine is actually written. It’s also making sure – automatically – that the set speed remains exactly the same regardless of what browser you use.

Once set to a certain speed, it stays that way – regardless of the browser being used.

This page is a teaser of what is to come, the actual launch is next month, and developers will then have a tool that resolves a very important pain that webdevelopers will be facing now when the new age of browser wars has come to the javascript engine itself.

To see how it works:

HTML:
  1.  
  2. <script type="text/zap">
  3. zap:init:{
  4.  
  5. this.el.style.color="white";
  6. this.el.style.backgroundColor="gray";
  7. zap.next;
  8.  
  9. element(".test").item(0).text:
  10. done;
  11. element(".test").item(0).setstyle("height:;width:200;border:black 1px solid;backgroundColor:orange;color:brown;fontFamily:verdana;fontSize:11;padding:4px;position:absolute;top:10;left:10;display:none");
  12. zap.next;
  13.  
  14. element(".test").item(0).text:
  15. done;
  16. this.a=1;
  17. this.b=0;
  18. this.c=0;
  19. zap.next;
  20.  
  21. element(".test").item(0).textAfter:
  22. <b>Start:</b>  var this.c::
  23. done;
  24. zap.next;
  25.  
  26. element(".test").item(0).runcircle(150,150,1,this.a);
  27. this.a=null;
  28. element(".test").get(0).style.display="block";
  29. this.c++;
  30. element(".test").item(0).textAfter:
  31. var this.c::  done;
  32. zap.next;
  33.  
  34. zap.newspeed(1);
  35. zap.repeat(360,-2);
  36. zap.next;
  37.  
  38. zap.newspeed(25);
  39. element(".test").get(0).style.backgroundColor="yellow";
  40. this.b=0;
  41. element(".test").item(0).text:
  42. <b>You dig?</b>
  43. done;
  44.  
  45. ...
  46.  

Related Content:

Posted by Dion Almaer at 8:43 am
1 Comment

+----
1.4 rating from 55 votes

1 Comment »

Comments feed TrackBack URI

Uh, you forgot to close your link tag… (open a, ZAP: newline, no close a)

Comment by fatlotus — September 29, 2008

Leave a comment

You must be logged in to post a comment.