Radiobox.css – Tiny set of CSS3 animations meant for your radio inputs
720kb.github.io
720kb.github.io
A couple of use cases I can think of:
* Attracting attention to options in a demo
* A game for kids, or otherwise 'wacky' pages
If we restricted web browsers to what developers think we should use, we'd still be using plain green text on black terminals.
* making it more obvious that it's a CSS-only solution (which is a very good thing)
* showing how to add them - i.e. you just include a CSS file and add a class to the label
* show which browsers are supported, including touchscreens
And possibly a feature request: can you animate as an event? For example, I might want to draw attention to a radio element without checking it.
$('.focus').prop('checked', true);
But if I wanted to attract attention to the radio box, the only way of animating it with this library would be to check it, and that might cause problems if I've got listeners for the 'change' event. So if I could just do something like: $('.focus').addClass('bounce');
that would be nice.Just: .my-class{ animation: boing 2s etc...}
I do, because I can guarantee that some self-proclaimed web designer will use them for absolutely no reason at all.
> The fact that it's possible is good to know as one day it might be a good solution for a problem I'm facing, and then I'll be happy that it exists.
This argument is so useless. "Well maybe someone wants to shoot themselves in the foot. Nobody can come up with any examples, but maybe."
> Attracting attention to options in a demo
None of the effects are really useful for that. Apart from them being too wacky ("did something break?"), anything transitive is bad for that anyway, because what if the user gets distracted for the split-second your animation runs? Fade in some persistent element for that.
> If we restricted web browsers to what developers think we should use, we'd still be using plain green text on black terminals.
Command-line tools are popular for a reason: They get shit done, and don't distract people with useless crap.
If a designer mis-uses them... well that's the designer's fault. People mis-use hammers, but it makes no sense to blame the hammer.
Some people do like to see 'useless crap' on some websites, and their opinions are just as valid as yours.
I'd wager that there are more developers scared of the commandline than are comfortable with it.
That's basically what AMP and Facebook Pages are. They're far nicer to browse on mobile than 'unrestricted' news sites.
Still, I agree these have valid uses.
Be still, my beating heart ;)
Also, because flashy web gimmics receive disproportionate amount of attention compared to less glamorous but practical concepts. Even here, on an ostensibly technical website.
One can use these, for example, as an easter egg or to add some emotion to the selected item. Sparingly, of course. Surprise people when they are bored of all those forms :)
I think you should keep a list of all the sites using these, so that people can get inspired.
I'm on mobile and wanted to zoom but you've used this in the demo page:
meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"
I'm curious why? The hit targets were too small for me initially, hence the desire to zoom.On topic: I like them, used sparingly or in the right context I think they'd be very good. Thanks for sharing.
Realistically, I may only use something like this in a situation where one of the radio selection options has an effect that you want to call extra attention to.
I can't come up with a representative example right now, but I'm sure there's one out there.
Your point is well taken though... for the vast majority of cases where this could remotely be useful there exist better ways to encode the information you are trying to convey.
It is a fun set of experiments, so I give the author props for that.
[1] https://github.com/720kb/radiobox.css/blob/master/lib/scss/b...
If you have ideas, specially on how to improve it, feel free to open an issue on github, it's just more comfortable to discuss code things.
Why?
But the OP is releasing this for free, and that helps other people. By crapping on their project with random, unfounded opinions, we discourage them from open sourcing their other code, and that makes the world a worse place. If you don't like an open source project and it's existence isn't doing the world any harm, then just be quiet and move on - or even better, release your own better version.
The reason I mentioned its stars and upvotes is precisely to point out that some people may have a valid use case for this, and you can't rule it out completely for every radio button on every website.
What about the inconsistency factor? If my radio boxes get animations, all other form fields should get them too.
If not, no one should get them.
You know how it's with kids.
Websites are means to an end, and that end is not staring in amazement at animations (or in frustration at your battery gauge).
( ) launch nuclear missile
( ) send flowers
You probably want to really draw attention to which radio button is selected so the user doesn't absentmindedly choose the wrong one.
I always find lack of good non-animation css for radio buttons and drop down select elements to be lacking.
e.g.
%focus { ... }
%boing { ... }
.some-label { @extends %focus; }