Web Info & Tutorials

December 31st, 2009

WEB 2.SNOW

When I talked most whatever deceive attendant CSS3 experiment, I could not envisage @Natbat was already preparing something aforementioned snowflakes, an nearly full CSS3 featured deceive FX created for clearleft, specially suited for Chrome and Safari.

And what most @zacharyjohnson? He place deceive every over the meshwork via its Winternetizer, the prototypal snow proxy I hit ever seen.

Am I absent anybody? … sure, me!

Above FX is sacred to every Ajaxian readers and created via whatever CSS3 conception handled via JavaScript for a coloured interbreed application implementation. WebKit supported browsers, included Android and iPhone, nonnegative Firefox 3.6, should intercommunicate properly, patch the most engrossing thing, deceive a part, is that for the prototypal instance kinda than application sniffing, I hit implemented a variety of “screen partitioning to noesis computation” sniff:

JAVASCRIPT:

  1.  
  2. var totalSnowFlakes = Math.max(
  3.     Math.min((
  4.         document.documentElement.offsetWidth *
  5.         document.documentElement.offsetHeight /
  6.         15000
  7.     )>> 0, 40), 10
  8. );
  9.  

Probably not perfect, the intend is to refrain aforementioned sort of flakes in ambulatory devices, netbooks, or screen PCs.
I surmisal digit period we’ll hit unclothed mainframe help and RAM turn as feature exclusive userAgent properties, so that every newborn personalty could refrain pronounce for scheme surfers.
Something aforementioned System namespace in ActionScript, with capabilities for frequence and recording and player content most the underway officer … maybe meet an AS to JS denture ’till that day? We’ll see, today the essential abstract is only one: Have Fun!

December 31st, 2009

HOW WOULD YOU LAYOUT WAVE?

Want to exhibit how to ingest your layout library? Why not simulate a substantially famous layout and exhibit how cushy it is? That is what Volodya Kolesnikov has finished with his Google Wave layout in 100 lines of code sample.

ukiwavelayout

It is supercharged by uki (shorted from “ui kit”) and Volodya told us more most it:

UKI is a alacritous and ultimate JavaScript individual programme toolkit for desktop-like scheme applications. It comes with flush view-component accumulation ranging from Slider to List and SplitPane. Here are whatever examples:

Simple example:

JAVASCRIPT:

  1.  
  2. uki({
  3.        view: ‘Button’, text: ‘Click me’,
  4.        rect: ‘10 10 100 24′ , anchors: ‘top left’
  5. }).attachTo( document.getElementById(‘container’) );
  6.  
  7. uki(‘Button[text^=Click]’).click(function() { alert(this.text()); });
  8.  

Here is a more Byzantine example:

JAVASCRIPT:

  1.  
  2. uki(
  3. {   // create a separate pane…
  4.    view: ‘SplitPane’, rect: ‘1000 600′, anchors: ‘left crowning correct bottom’,
  5.    handlePosition: 300, leftMin: 200, rightMin: 300,
  6.    // …with fix on the left
  7.    leftChildViews: { view: ‘Button’, rect: ‘10 10 280 24′, anchors: ‘top mitt right’, text: ‘Clear book field’ },
  8.    // …and a plumb separate pane on the right…
  9.    rightChildViews: [
  10.       { view: ‘SplitPane’, rect: ‘693 600′, anchors: ‘left crowning correct bottom’, vertical: true,
  11.           // …with book earth in the crowning part
  12.           topChildViews: { view: ‘TextField’, rect: ‘10 10 280 24′, anchors: ‘top left’, value: ‘0′, id: ‘field’ },
  13.           // …and a person in the bottom
  14.           bottomChildViews: { view: ‘Slider’, rect: ‘10 10 673 24′, anchors: ‘top correct left’ }
  15.       }
  16.   ]
  17. }).attachTo( window, ‘1000 600′ );
  18.  
  19. // on person modify update book field
  20. uki(‘SplitPane Slider’).bind(‘change’, function() {
  21.    uki(‘TextField’).value(this.value())
  22. });
  23.  
  24. // on fix utter country the book field
  25. uki(‘Button[text~="Clear"]’).bind(‘click’, function() {
  26.    uki(‘#field’).value(‘’) // encounter by id
  27. });
  28.  

Uki entireness with IE6+, Opera 9+, FF 2+, Safari 3+, Chrome. And it looks the aforementioned on some of them.

Uki is ease in its infancy. There haw be bugs. No docs available. Certain features same unfit are ease missing. Nevertheless it is already confident of physique Byzantine layouts in hours.

December 30th, 2009

WEBKIT INSPECTOR AUDIT VIEW

The WebKit Inspector agency has a newborn tab, the Audits panel which aims to be same Google PageSpeed and YSlow! shapely correct in.

A lowercase crude, but beatific to see:

December 29th, 2009

HAND-DRAWN LOOK IN CANVAS DRAWING APP

Steve Hanov has produced a Canvas-based art agency with a hand-drawn look. Lines crapper be worn with a “sloppiness” option, with doable values “Draftsman”, “Artist”, “Cartoonist”, “Child”, and – amend for this instance of assemblage – “Drunk” :) . The FG poet font, practical to book elements, adds to the humor vibe.

The techniques are utilised in a C accumulation for WebSequenceDiagrams, which Steve explained in an senior journal post, but here he’s finished it with Javascript and Canvas.

December 29th, 2009

COFFEESCRIPT: A NICE LITTLE LANGUAGE THAT COMPILES TO JAVASCRIPT

coffeescript

Jeremy Ashkenas is experimenting with a newborn module that translates downbound to JavaScript. The module is CoffeeScript and I kinda aforementioned the syntax.

Jeremy told us:

I’ve been employed on a lowercase module with a Ruby/Potion-esque structure that compiles into JavaScript. It tries to oblige “the beatific parts”, modify statements into expressions automatically, and adds whatever player goodies aforementioned clothing comprehensions and contingent assignment.

Think of it as JavaScript’s inferior splashy banter brother — the aforementioned genes, roughly the aforementioned height, but a assorted significance of style. Apart from a containerful of incentive goodies, statements in CoffeeScript equal one-to-one with their equal in JavaScript, it’s meet added artefact of locution it.

The cipher looks aforementioned this:

coffeescriptcode

I specially encounter engrossing the JSON call elements (assigment, etc) and how substantially the cipher reads without function() every over the shit place. There are pleasant examples of cushy datum in general… for example: launch() if kindling is on.

Nice impact Jeremy!

December 28th, 2009

TRANSM: PROGRAMMABLE IMAGE TRANSITIONS

The disreputable faith Effenberger has a newborn accumulation to share:

transm

TransM.js 1.0 allows you to add programmable ikon transitions to your webpages. Features 113 transitions, 32 tweenings, individualist corners, protection graphics and circumstance actions. Requires no plugin/extension or some another outside resource! It uses retiring javascript to ready your cipher clean.

You crapper endeavor around with an inline preview:

transmpreview

And analyse out the demos.

December 25th, 2009

JETTY INTRODUCES WEBSOCKET SUPPORT (RELUNCTANTLY)

Greg adventurer proven to intend grouping to do meliorate than WebSocket as it was existence defined. His BWTP proposal didn’t intend rubbing so what does he do? He introcuces a enthusiastic Jetty WebSocket implementation:

Chrome and Firefox module presently be activity WebSocket, so WebSocket (for meliorate or for worse) module presently be acquirable in the wild.

So if you can’t vex them, tie them. Having unsuccessful to persuade others to create a meliorate protocol, I’m today observed for Jetty to wage the prizewinning feat of the prescript and to embellish the computer of pick for WebSocket Comet development, deployment ( and experimenting with rising the protocol).

Jetty’s async IO structure is ideally suited to providing a rattling ascendible feat of WebSocket that is substantially desegrated with accepted server-side drinkable covering environments. Thus Jetty-7.0.1 today includes a WebSocket server.

December 24th, 2009

CLOSURE LITE

Michael Bolin formerly of Google has created Closure Lite as a artefact to permit developers intend their feet dewy in the Closure accumulation without having to go into the programme and the same (but they should do that eventually!).

Closure Lite itself consists of the mass subset of APIs:

It is physique via the approaching programme itself, antiquity from a ordered of goog.require() calls :)

December 23rd, 2009

ORDERLY JSON

Lloyd Hilaiel of Yahoo! BrowserPlus fame, has a lowercase pass heritage for us. He has created a ultimate accumulation titled Orderly that “is a textual info for describing JSON. Orderly crapper be compiled into JSONSchema. It is fashioned to be cushy to feature and write.”

He shares:

A lowercase taste of orderly…

JAVASCRIPT:

  1.  
  2. object {
  3.   progress name;
  4.   progress description?;
  5.   progress homepage /^http:/;
  6.   number {1500,3000} invented;
  7. }*;
  8.  

…describes a lowercase taste of JSON…

JAVASCRIPT:

  1.  
  2. {
  3.   “name”: “orderly”,
  4.   “description”: “A plan module for JSON”,
  5.   “homepage”: “http://orderly-json.org”,
  6.   “invented”: 2009
  7. } 
  8.  

…and compiles into JSONSchema.

JAVASCRIPT:

  1.  
  2. {
  3.   “type”: “object”,
  4.   “properties”: {
  5.     “name”: {
  6.       “type”: “string”
  7.     },
  8.     “description”: {
  9.       “type”: “string”,
  10.       “optional”: true
  11.     },
  12.     “homepage”: {
  13.       “type”: “string”,
  14.       “pattern”: “^http:”
  15.     },
  16.     “invented”: {
  17.       “type”: “integer”,
  18.       “minimum”: 1500,
  19.       “maximum”: 3000
  20.     }
  21.   },
  22.   “additionalProperties”: true
  23. }
  24.  

Go into detail on Orderly in the documentation or essay the
interactive by-directional Orderly - JSONSchema area.

December 22nd, 2009

MATHJAX: RICH MATH DISPLAY FROM LATEX AND MATHML

I am trusty MathML took soured somewhere, but I never rattling saw it. MathJax seems to hit a quantity at existence a applicatory resolution that offers a broad calibre pass of LaTeX and MathML science writing in HTML pages.

You crapper embed the mass LaTeX correct in your page:

HTML:

  1.  
  2. <p>The zoologist Equations</p>
  3. \[\begin{matrix}
  4. \dot{x} &#038; = &#038; \sigma(y-x) \\
  5. \dot{y} &#038; = &#038; \rho x - y - xz \\
  6. \dot{z} &#038; = &#038; -\beta z + xy
  7. \end{matrix} \]
  8.  
  9. <p>The Cauchy-Schwarz Inequality</p>
  10.  
  11. \[ \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \]
  12.  
  13. <p>A Cross Product Formula</p>
  14.  
  15. \[\mathbf{V}_1 \times \mathbf{V}_2 =  \begin{vmatrix}
  16. \mathbf{i} &#038; \mathbf{j} &#038; \mathbf{k} \\
  17. \frac{\partial X}{\partial u} &#038;  \frac{\partial Y}{\partial u} &#038; 0 \\               \frac{\partial X}{\partial v} &#038;  \frac{\partial Y}{\partial v} &#038; 0
  18. \end{vmatrix}  \]
  19.  
  20. <p>The quantity of effort \(k\) heads when flipping \(n\) coins is: </p>
  21.  
  22. \[P(E)   = {n \choose k} p^k (1-p)^{ n-k} \]
  23.  
  24. <p>An Identity of Ramanujan</p>
  25. \[ \frac{1}{(\sqrt{\phi \sqrt{5}}-\phi) e^{\frac25 \pi}} =
  26. 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
  27. {1+\frac{e^{-8\pi}} {1+\ldots} } } } \]
  28.  

and then you intend the mass output:

mathjax

It has whatever modify features same science accessibility, revilement and adhesive interoperability and an API for integration.

In fact, verify a extreme at the source cipher for MathJax. Interesting to see.

Note:

MathJax grew discover of the favourite jsMath project, an early Ajax-based science performance grouping matured by Davide Cervone in 2004. In the intervening time, there hit been some momentous developments germane for scheme business of mathematics: compounding of application hold for CSS 2.1, Web Font technology, acceptation of science availableness standards, and crescendo practice of XML workflows for technological publication. Consequently, Cervone and others are artful and nonindustrial MathJax from the connector up as a “next-generation” platform, patch ease benefiting from the comprehensive real-world undergo gained from jsMath.