327 points · by hising · 12y ago · 70 comments
(Nice work, btw, like the animations =)
That's kind of the point.. you should not need to have a page to showcase different techniques for something this basic.
I, for one, does not have to deal with this. But as and outsider it seems strange that simple things are so hard. Maybe web developers have gotten so used to dealing with things like this that they don't see how convoluted it is?
The use "currently" itself should set of a number of alarms in a sane person.
Then, to top it, you add: "showcases a number of techniques".
Centering should be an built-in, simple, capability. As simple as making some div red or adding a 2px border.
Not a "technique" or a "workaround" and surely not "many of them" (incompatible and each with different tradebacks).
You don't see "techniques" for making divs have a certain background color -- that's because there's a single instruction for that, and it bloody works all the time.
Also, auto-flowing text split between columns as a "column" property of some kind would be nice.
The list you provided is handy, but it shouldn't require knowing that you have to look up specific cases.
Ah, but unfortunately CSS isn't about layout at all. Hence proposals like css-regions (see comment below) -- which are about layout. It's a common mistake: We came to html (with our designer hats on), and thought: Oh, we can layout text with tables! We were wrong, and we got css -- and we thought: Oh, we can layout text with CSS -- but we were still wrong. We could do some minor (and as it turned out pretty major) styling with CSS -- but it was never really meant for layout. We do need a system for layout, and perhaps the most sane thing to do these days is to wrap CSS into a tool that does styling and layout. But CSS of today isn't quite there.
See: http://www.w3.org/TR/WD-css1-951117.html#abstract
"This document specifies level 1 of the Cascading Style Sheet machanism (CSS1). CSS1 is a simple style sheet language that allows authors and readers to influence the presentation of HTML documents. E.g., a publisher can suggest font families, colors and layout for a document, while the reader can ask for the document to be magnified. By attaching style to HTML elements, document structure and device-independence is preserved."
Over-eager use of emphasis mine. While it contains the word layout, it's set in the context of HTML documents -- and I think that was a mistake. Still it brought us forward from what things was like before the mid 90s!
Those are called "indeterminate progress indicators".
Not everything on the web has some specific state info or progress percentage to declare.
Just showing that "something is running" is still very useful for those situations, and can have a huge impact on the users perception of the page responsiveness.
(As has lots of other "theater", which is not to be dismissed -- e.g the mobile practice of showing a screenshots of the apps last state while you load it, making the user thing it loaded faster).
Windows 8 Loading with pure CSS3
.spinner > div { width: 22px; height: 18px; background-color: #333;
border-radius: 100%;
display: inline-block;
-webkit-animation: bouncedelay 1.4s infinite ease-in-out;
animation: bouncedelay 1.4s infinite ease-in-out;
}.spinner .bounce1 { -webkit-animation-delay: -0.32s; animation-delay: -0.32s; }
.spinner .bounce2 { -webkit-animation-delay: -0.16s; animation-delay: -0.16s; }
@-webkit-keyframes bouncedelay { 0%, 80%, 100% { -webkit-transform: scale(0.0) } 40% { -webkit-transform: scale(1.0) } }
@keyframes bouncedelay { 0%, 80%, 100% { transform: scale(0.0) } 40% { transform: scale(1.0) } }
Oh and it doesn't work in Opera 12 .
(HTTP overheads are not factored since HTML + CSS is one less request than HTML + CSS + Image resource.)
https://github.com/dawjan/Open_Me/tree/master/JQ%20busy%20in...
Sorry no preview
On a project that targeted tablets (iPads and Androids), we eventually went back to good ol' gifs because of how bad SVG and CSS animations rendered and performed.
Ugly aliasing in Firefox though.