Tuesday, October 13th, 2009
Firefox Trunk: Accelerometers, WebGL, and CSS Transitions
Paul Rouget shows off some cool new demos that are baking on the trunk of Firefox currently.
First are some nifty new events that get fired if your computer has an accelerometer:
-
window.addEventListener("MozOrientation", function(e) {
-
/* 3 values: e.x, e.y, e.y */
-
}, true)
It works with MacBooks and on Windows and Linux with Thinkpads.
Check out this cool screencast of the orientation event in action:
They also have WebGL and CSS Transitions going in Firefox trunk now as well! There are some demos in the original blog post of WebGL + CSS3 + SVG as well as CSS Transitions + the HTML5 Video tag that are very cool (require Firefox Nightly).
Here's an example code snippet showing how you can use CSS Transitions to change the background color of a DIV over time as well as changing the width and height of an HTML5 Video at the same time:
-
div {
-
-moz-transition-property: background-color, height, width, font-size;
-
-moz-transition-duration: 2s, 1s, 2s, 1s;
-
-webkit-transition-property: background-color, height, width, font-size;
-
-webkit-transition-duration: 2s, 1s, 2s, 1s;
-
}
-
-
div video {
-
-moz-transition-property: width, height;
-
-moz-transition-duration: 2s, 2s;
-
-webkit-transition-property: width, height;
-
-webkit-transition-duration: 2s, 2s;
-
}
Someone's also put together a cool demo that puts the new accelerometer support with some SVG to create a Super Mario Kart clone:














javascript:b=document.getElementsByTagName(”body”)[0];t=b.innerHTML;b.innerHTML=null;w=b.appendChild(document.createElement(”div”));w.innerHTML=t;w.style.height=”100%”;w.style.width=”100%”;w.style.MozTransformOrigin=”50% 0″;b.style.overflow=”hidden”;i=0;window.addEventListener(”MozOrientation”,function(e){if(++i==2)w.style.MozTransform=”skewx(”+-60*e.x+”deg)”;i=i==2?0:i;},true);
Brad, you of all people should know where this “ultimate perversion of SVG filters” is coming from ;)
Shouldn’t the three vales be e.x, e.y, and e.z?
You guys seem it add inline vimeo videos semi-regularly, why don’t you do inline .ogv videos for the (probable) majority of us that can view them? Sorry for the double post.
@tj111 – Probably because they would then be hosting them, instead of getting vimeo to do it for free.
Finally transitions! Sure it’s gonna be a little bit more till they get into public builds but at least I can plug the code in now and when it’s turned on, everything’ll work.
Now, can we get some reflections and gradients in the house!
Current Firefox 3.6 builds already have gradients implemented. See here and here.
Oh, that is excellent news. Didn’t realize they were adding gradients as well.
GH337, as a digital mobile phone, empire wedding dresseswhether it is performance or other aspects are much better than the analog phones could also say that empire waist wedding dresseswas the fashion trend.Ericsson T68: the first color screen mobile phone Ericsson T68 was launched in the finalstrappless empire waist wedding dresses of a cell phone, but also a location in the high-end mobile phones, evening formal dressesit is the emergence of the mobile phone world has become Behind colorful.Ericsson GH398: Custom ring tones plus size evening dressescan be the first mobile phone Ericsson has brought unconventional way this could be composing cheap flower girl dresses ringtones GH398,Unfortunately, mobilephones have not yet popular in that era, which ended in failure.Ericsson T39mc: wedding dressthe first built-in Bluetooth-enabled mobile phone August 2001 Ericsson released the world’s first built-in Bluetooth chip for mobile phones T39mc,Empire Halter Satin WeddingDresswhich is Ericsson’s first tri-band GSM and GPRS high-speed Internet-ready phones.Ericsson R250 PRO: the first three anti-cell phonewedding dressR250 PRO is the first with a waterproof,Empire Halter Chiffon Wedding Dress shockproof, dust-proof function of the “three defenses” outdoor-type mobile phone. It is in the third quarter of 1999 to the market.