Zachernuk

tnSuperman tanktn oParticles uExtrusion j3d sandy flExtrusion fuelyoursenses meshCam bufferSnake dMap2 dMap pv2 cursorFire opticks faceGame FPSnake pv preOpticks painty youtuber fractalFIngers 2dbals

December 22, 2009

WebKit / Mozilla rotation system

Filed under: doodles — Brandel Zachernuk @ 11:41 pm

Every now and then I start looking at some lightweight, non-flash alternatives for doing silly things on web pages. Recently I switched to using Google Chrome, which uses the Webkit engine for page rendering, which is said to be able to do rotation and the like very quickly. Without a particular goal in mind, I decided I would write a basic move and rotation to see how it performed. If you’re using Firefox 3.5+, Chrome or Safari, you should see an unhelpful black rectangle swinging around in the top left corner. Here’s how you do it:

theElement.style.setProperty("-webkit-transform","rotate("+(new Date().getTime()/500)+"rad)","");
theElement.style.setProperty("-moz-transform","rotate("+(new Date().getTime()/500)+"rad)","");

Not the most advanced CSS experiment by any stretch of the imagination, but it’s a start!

This is in my div
Older Posts »

Powered by WordPress