If you are visiting this page with either Safari or Chrome, then you just saw some pretty cool 3D-effects happening with the Drupal logo lifting itself off the page and flying across your screen, don't you think?
And you may wonder: how many lines of jQuery, Flash and what have you went into that !?!
The answer: zero.
Yep, that's right. 5 HTML tags plus a stylesheet of a meagre 40 lines is all it took to bring this movie to your screen.
Want to try it out on your site? Copy the code below into just about any page on your Drupal 7 site and you should enjoy the same show, pretty much regardless of the theme you happen to be using. Just click the Edit tab on a page or article on your site, disable the rich text editor and paste the following lines at the top. Make sure to set the Text format to "Full HTML" or "PHP code" before you press Save.
<link rel="stylesheet" type="text/css" href="http://flink.com.au/sites/default/files/fly.css"> <div id="rotate-home"> <div id="rotateXY"> <div id="rotateZ"> <img src="/themes/seven/logo.png"> </div> </div> </div>
Works inside blocks too!
Where's all the CSS magic? Here.
The CSS was inspired by this great The Art of the Web article. This article will also tell you that while Firefox (v9) supports most animation functions, it only features in-plane (i.e. z-axis) rotations, not x- and y-axes rotations. So you can't create the 3D effects on this page.
Mircrosoft may catch up with Safari and Chrome in IE version 10.
Comments
This is possible in Drupal 6?
Hi,
I like 3d move
Is this possible in D6?
Yes this is possible in D6 too.
Not just Safari and Chrome
This effects work with any browser based on a recent version of Webkit too, not just Safari and Chrome; I tested with Epiphany (http://projects.gnome.org/epiphany/), for instance, and I can see the animation.
BTW, we have to keep in mind that other rendering engines may never support the '-webkit-animation-*' rules, the common ground will be what is specified by the W3C (http://www.w3.org/TR/css3-animations/).
Regards,
Antonio
That was one step away from
That was one step away from flashing gifs ;)
Netscape vs. Internet Explorer
"If you are visiting this page with either Safari or Chrome..."
Please, let's not return to the old days of browser segmentation! ;)
Would be heaven if we didn't have to...
Other browsers most likely
Other browsers most likely will never support anything beginning with -webkit- and should never do so. In fact, no one calling themselves "experts" should be using just 1 vendor's CSS rules... especially when other vendor's have their own versions.
WHOA! That was cool. There
WHOA! That was cool. There seems to be a problem though. The cool Slidebox that's supposed to pop up at the corner of the web browser is now showing up in the bottom right corner of the node itself. I've refreshed all other pages and they are working fine. I'm using the latest Chrome Canary browser.
Thanks!
Yes duh...
Unfortunately there is a
Unfortunately there is a large amount of people who don't know about vendor prefixed CSS (or don't care, or just use pre-made CSS) and so we end up with people just using webkit based CSS.