[1+1=2]

OneAndOneIs2

« PillsPowershell history »

Wed, Sep 23, 2009

[Icon][Icon]Just cuz it looks cool...

• Post categories: Omni, Technology

This post relies on Mozilla transforms to make any sense, so if you're not using Firefox, it'll probably just look weird. Sorry!

This is an isometric cube that is generated entirely by using CSS - you'll notice that the text is actually text, that can be highlighted and copied just like normal text.
The cube is made up of three divs, each of which have been rotated and skewed to fit into an isometric cube layout - this is what makes it mozilla-specific.
Absolute positioning of the divs is necessary to make this cube fit together properly - otherwise you just end up with a rather fetching six-pointed star...

Innit clever? :o)

Click below to see how it's done. Click here for a much cooler example.

Follow up:

<style type="text/css">
.cube {
    position: absolute;
}
 
.face {
    position: absolute;
    width: 200px;
    height: 200px;
}
.cubetop {
    -moz-transform: rotate(-45deg) skew(15deg, 15deg);
background-color: #eee;
left: 200px;
}
 
.cubeleft {
    -moz-transform: rotate(15deg) skew(15deg, 15deg);
background-color: #aaa;
top: 156px;
left: 110px;
}
 
.cuberight {
    -moz-transform: rotate(-15deg) skew(-15deg, -15deg);
top: 157px;
left: 290px;
}
</style>
<div class="cube">
    <div class="face cubetop">This is an isometric cube that is generated entirely by using CSS - you'll notice that the text is actually text, that can be highlighted and copied just like normal text.
    </div>
    <div class="face cubeleft">The cube is made up of three divs, each of which have been rotated and skewed to fit into an isometric cube layout.
    </div>
    <div class="face cuberight">Absolute positioning of the divs is necessary to make this cube fit together properly.
    </div>
</div>

6 comments

Dion Moult
Comment from: Dion Moult [Visitor] · http://thinkmoult.com/
What is the web coming to? Uncanny.
23/09/09 @ 23:41
Timmy
Comment from: Timmy [Visitor] · http://blog.tsmacdonald.com
Doesn't work on Firefox 3.0.14 on XP...
24/09/09 @ 02:19
oneandoneis2
Comment from: oneandoneis2 [Member] · http://geekblog.oneandoneis2.org/
No, I believe you need 3.5 - if you don't want to do an upgrade yet, you could grab the Portable Apps version for temporary use
24/09/09 @ 06:22
Andrew Stein
Comment from: Andrew Stein [Visitor] · http://www.andrewsteinhome.com
I think I just fell in love again with Firefox.
03/10/09 @ 13:51
oneandoneis2
Comment from: oneandoneis2 [Member] · http://geekblog.oneandoneis2.org/
Cool, innit? :o)
03/10/09 @ 18:20
Shaunak De
Comment from: Shaunak De [Visitor] · http://shaunak.ws
Wow! This is so totally awesome.

I opened this post up in Opera just to check and sure enough, i got a total mess.

I really do hope that these transforms become standard!
13/10/09 @ 08:01

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)
 

[Links][icon] My links

[Icon][Icon] Hmm.. new look for twitter? I hope it gets less "Ick! Change! Put it back!" nonsense than Facebook..
08/02/12

[Icon][Icon] Facebook Syndication Error
11/02/12

[Icon][Icon] I last listened to:
Johann Pachelbel - Canon in D major

[Icon][Icon] Most recent photo:
Submersible houseboat

[Icon][Icon]About Me

[Icon][Icon]About this blog

[Icon][Icon]My LQ profile

[Icon][Icon]My /. profile

[Icon][Icon]My Wishlist

[Icon]MyCommerce

[FSF Associate Member]


February 2012
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29        

Search

User tools

XML Feeds

eXTReMe Tracker

Valid XHTML 1.0 Transitional

Valid CSS!

[Valid RSS feed]

powered by b2evolution