News for hackers. Stuff that matters.
Re:Pure CSS Twitter Fail Whale by alain94040 on Monday June 14, 2010 @12:52AM (#1428933)
From the article:

... stranger angles (such as the strings) are masked using containers with overflow: hidden

Hum, am I the only one who wonders why we have to reinvent, in 2010, a graphics language, and everyone seems to think it's cool?

Even on the Apple II you didn't to do such ugly hacks. Why now?

Re:Pure CSS Twitter Fail Whale by psadauskas on Monday June 14, 2010 @12:58AM (#1428943)
Its not that you have to, its that you can. This would absolutely be much better suited as SVG or canvas, but it does a good job of demonstrating how amazingly powerful CSS3 is.

If everyone only did something the "right" way, and the simplest way, the world would be a very uninteresting place.

Re:Pure CSS Twitter Fail Whale by pmjordan on Monday June 14, 2010 @08:34AM (#1429485)
I don't know about you but pretty much every live site I've been involved in has used some non-intuitive CSS and markup to achieve the intended result. CSS is great for its intended use of styling marked up text documents; as soon as you try to do anything that falls outside of that zone, such as implementing a contemporary website layout & design, you end up working against the language. It works, but it's a lot like inferring that Brainfuck must be a good programming language because it's Turing complete.

Yes, we have SVG, canvas, etc., but they aren't supported widely enough. Even if you ignore that and focus on the browsers with the best (X)HTML+SVG support, do the layout & design using SVG and the typesetting with HTML/CSS, the resulting markup and CSS aren't pretty at all - again, SVG is good for vector art, not laying out interactive pages.

Canvas is generic enough to do pretty much anything, but it's very low level. It's like the X server - you still need all the toolkit infrastructure on top to get anything done in most cases. This is fine for animations, games, etc. of course.

So yes, this particular animation could have been better implemented using SVG or canvas. Sure, it's interesting doing it with CSS3, but the sad thing is that it's more than that: the weird hacks required aren't far removed from the ones you need to use in practice, because the 'right' way you mention currently doesn't exist for the vast majority of what we do on the web.

It's more than a cool hack - it's a demonstration (intentional or not) that it's 2010 and we're still fighting our presentation languages.

Re:Pure CSS Twitter Fail Whale by moron4hire on Monday June 14, 2010 @07:42AM (#1429395)
If I cut down a 50 foot tall tree with a swiss army knife, it would not be a testament to the "power" of the knife, it would be a testament to my own stupidity.
Re:Pure CSS Twitter Fail Whale by mcobrien on Monday June 14, 2010 @08:39AM (#1429493)
If you cut down a 50 foot tall tree with a swiss army knife, I'd like to see how you did it. I think it's clear the author isn't stupid and did this to see what was possible with a limited tool.
Re:Pure CSS Twitter Fail Whale by moron4hire on Monday June 14, 2010 @09:59AM (#1429683)
My point was that, with enough perseverance, one can do practically anything with anything (or nothing). Just because something is possible doesn't make doing it an intelligent thing if it's just a brute force effort. While herculean efforts of perseverance are commendable displays of stamina (like (http://links.zigzo.com/files/2007/10/coat_20hanger_20gorilla...) this gorilla made out of coat hangers), once the basic theory has been demonstrated, the intellectual interest is over. See also, X program implementation in Y Turing-complete language (I'm specifically reminded of a chess engine written in the infamous Brainf*, which was really just a C chess engine converted to BF).
Re:Pure CSS Twitter Fail Whale by sjs on Monday June 14, 2010 @10:54AM (#1429821)
Perseverance and stamina are rare qualities, and that gorilla is a very nice work of art. A ported BF chess engine not so much. Now, a C-to-BF compiler would be interesting.

The recent "X in pure CSS" theme is important as it shows how advanced CSS3 is. They are tech demos, which as we know are often not meant to be anything more than that. They display how far you can bend CSS and nothing more. Just like the Blendtech ads, if someone cut down a tree with a pocket knife in an afternoon I bet 1/2 of us would run out to buy that knife.

If an artist had done this using more standard tools and rendered it as SVG no one would care. I think you've completely missed the point.

edit: It seems that psadauskas made this point some time ago. http://news.ycombinator.com/item?id=1428943

Re:Pure CSS Twitter Fail Whale by GrandMasterBirt on Monday June 14, 2010 @01:37PM (#1430338)
I'm sorry but this is a tiny fraction of CSS3. Lets see some real cool stuffs.

However, "look what I can do in CSS3" is always fun to see, because it introduces techniques not necessarily just the technology.

Re:Pure CSS Twitter Fail Whale by zepolen on Monday June 14, 2010 @11:26AM (#1429919)
The very definition of hacking is using something in a way it was not meant to be used. Last time I checked, the top left of this site still said 'Hacker News'. If you find hacks stupid, why are you here?
Re:Pure CSS Twitter Fail Whale by nnash on Monday June 14, 2010 @11:13AM (#1429877)
You act like its a pointless pursuit to try something experimental for fun just because you're bored. That is your point, no?
Re:Pure CSS Twitter Fail Whale by GrandMasterBirt on Monday June 14, 2010 @01:34PM (#1430327)
The only html5 think here is border-radius. Now this just shows that we can encode weird shapes using borders which is a well known fairly old technique.

Perhaps we can have a small image maker took which generates html5 vs an image.

Now that is great and all and is probably a really nice experiment into doing stuff with CSS, but this is a tiny fraction of what CSS can do being used, but practically, an image takes less memory/cpu to render.

Re:Pure CSS Twitter Fail Whale by imagii on Monday June 14, 2010 @03:58PM (#1430774)
I'm not trying to be a dick, but I think you mean CSS3. HTML5 and CSS3 aren't the same thing.
Re:Pure CSS Twitter Fail Whale by Subcide on Monday June 14, 2010 @03:40AM (#1429129)
The HTML/CSS all up is about 34kb, but could be a lot less if minified, and the CSS was made for ease of drawing over optimization :) You could get a PNG down to less than 10kb easily (but of course, that was hardly the point hehe). Cheers for the comments guys!
Re:Pure CSS Twitter Fail Whale by kwamenum86 on Sunday June 13, 2010 @11:06PM (#1428733)
A very clever hack. I wonder how much total memory is used versus the image-based version? A couple potential disadvantages: more http requests and more dom nodes. But I'm guessing the author did this just because they could, not as a demonstration of how things should be done.
Re:Pure CSS Twitter Fail Whale by thwarted on Sunday June 13, 2010 @11:26PM (#1428769)
You mean fewer HTTP requests. The CSS is entirely in the document. So unless you base64 encode the failwhale image and put it in a data: url in an img tag, it's one less request compared to an HTML page containing a single image.
Re:Pure CSS Twitter Fail Whale by kwamenum86 on Monday June 14, 2010 @12:15PM (#1430067)
By that logic it is the same number of HTTP requests. Embedding images in the document is trivial at this point.
Re:Pure CSS Twitter Fail Whale by Groxx on Monday June 14, 2010 @12:52AM (#1428932)
Awww, if you scale it up it gets horizontal gaps in the whale :'(

Other than that, very nice job. Wonder if Twitter would use it.

Re:Pure CSS Twitter Fail Whale by jrockway on Monday June 14, 2010 @01:32AM (#1428993)
A fail whale that failed to render correctly would be amusing.
Re:Pure CSS Twitter Fail Whale by wushupork on Monday June 14, 2010 @04:46PM (#1430929)
I think if I did this using purely tables and background colors, I'd probably get tons of down votes. Just saying.
Re:Pure CSS Twitter Fail Whale by trezor on Monday June 14, 2010 @02:08AM (#1429035)
Works neatly in Firefox and even better in Chrome, but fails horribly on my iPhone. Might just be due to the small screensize but I haven't tested that properly yet.

Impressive none the less.

Re:Pure CSS Twitter Fail Whale by grandalf on Monday June 14, 2010 @02:33AM (#1429065)
Works on ipad
Re:Pure CSS Twitter Fail Whale by uptown on Monday June 14, 2010 @09:46AM (#1429650)
That's because it's magical.