Path menu in pure CSS3
lab.victorcoulon.fr
lab.victorcoulon.fr
Things have changed and more and more people run with javascript enabled, and more and more website stakeholders are willing to put up with things being broken for users who don't have it enabled. I know that's a contentious statement, but it's true. If Google Analytics and ads aren't being pushed down to you because javascript is disabled, most site owners are willing to put up with the experience being broken for you too. I'll sidestep the debate of graceful degradation.
Now however, there are performance reasons for going "pure CSS". A lot of CSS transforms and animations are hardware accelerated and/or just animate more fluidly than they would if they were animated via javascript. Javascript is single threaded, and when a webpage is doing a ton of varied activities, it's hard to ensure fluid animation when the only tools at your disposal for drawing frames are pretty crude methods like setTimeout.
At BigDoor, we ship the same JavaScript code to many different partners, but their widgets can have very different form factors and visual effects. It's nice to not have to distribute a bunch of animation code to every partner just in case one partner's theme happens to use it – we can keep it in the CSS and just swap that out.
Soon I think people will see that using JavaScript for the simple animations they've been performing all this time (fade out, slide in, etc.) is just creating a tightly coupled system.
Using CSS for non-turing-complete interactions which are limited in their computational ability to a simple automaton means that CSS can be trusted much more than JS, and that there are stricter guarantees on performance. It's also semantically cleaner when used for things like visual effects on windows, because even if CSS doesn't load, the markup representing the menu will be intact. JS systems have the ability to load markup asynchronously or generate it from other data in the page and destroy all notion of graceful degradation.
More complexity leading to bigger surface area for potential attacks, yes. GPU and file access, yes. But nothing to do with turing completeness.
Here's a non turing complete language I wouldn't like to be able to run in a web context. It has a single command: rm {path}
On the other hand a turing complete language that has no access to any IO, DOM manipulation etc. I would be perfectly happy to let run.
It isn't the power that comes from turing completeness that makes javascript a potential security vulnerability, it's the interactions it can have outside of computation.
By using the language of Least Power (timbl@w3c.org) that still accomplishes your task, you achieve a more concise and more analyzable document.
I wouldn't call that "nothing to do with TC".
Non TC languages can be sufficiently complex as to make analysis difficult.
I don't see any of the risks of js as linked to TC in any meaningful way beyond a very hand-wavey "TC tends to lead to complexness".
There might be some inherent value of avoiding javascript, but I think this is just a hack for the satisfaction of being able to do it.
CSS transitions are faster than JavaScript animations[1].
Browser could easily optimize them (since each keyframes are predefined) vs. DOM manipulation, which is always slow.
http://jsfiddle.net/necolas/RGYUg/
The benefit of using JS to calculate the positioning (especially in an environment where JS will always be enabled) is that you can have the menu items correctly positioned irrespective of the number of items.
Edit: This is also an interesting approach: http://beaucollins.github.com/radial-menu/
This implementation is unsettling to me, while the original Path version is pleasant. It's hard to pin down - they're very close. (I think it's the animation speed and rapidly spinning icons mostly.)
As someone put it in another post it's the difference between the works of Google/Microsoft et. al. and the Works of Apple, Path, etc. The former would see this and sign off - "it works" like we specified, while at latter, this would be a good first pass and then "make 10 refinements" to get it to "feel" right.
No offense Beau, I'm just using yours as an example.
Can anyone comment on how the iOS path app behaves when you scroll?
[edit; saw typo in fiddle, updated link]
There are a ton of people who like to bitch at open source developers about not including or fixing something and for projects like this tht isn't cool. This is just a guy showing off some cool thing he did. If you want to use it, have at it! Make it better? Contribute! Have a complaint? Go fuck yourself.
It's not meant for people who have constructive criticism or are just discussing the merits of the code or technique like us.
Yeah, this is an excellent way to deflect criticism from open source projects. I've seen it frequently stop what could be a useful discussion in its tracks.
(And this isn't a comment to you specifically, but that sentiment combined with closed-source-software-as-unethical turns my stomach.)
Again, I know what you mean, I've seen it, and it's lame but I see this as an exception where it makes sense.
// Generate keyframes
// Sass interpolation doesn't work with keyframe. CF : https://github.com/nex3/sass/issues/46
// so I use a tricks ==> "appear-'#{$i}'" - And it doesn't work in Firefox.
It's impossible to generate @-moz-Keyframes + interpolation with Sass yet. That's why the experiment works only in Webkit.
Do people here think that Path should have been granted some type of protection so that others couldn't copy its look and feel so quickly, or it is okay that competitors have come out almost immediately?
I am just asking the question, I'm not sure how I feel about the issue. I'm against software patents, but I could certainly understand if Path's GUI designers are pissed that people are copying them so quickly, and making them lose their advantage.
Repeat after me: The arrangement of a popup-menu is not patent-worthy.
Also, speaking as a designer, I would be thrilled if I saw people so fervently duplicating an interaction scheme I had created. "Imitation is the sincerest form of flattery," and all that.
http://playground.mobily.pl/jquery/mobily-blocks/demo.html
It's a short breath away from what Path have done.
I love the aesthetics of both, I have to say. Great work.
Of course not. If so, the same would have had to be said for any number of design elements created in the past.
all i've seen are people being inspired by Path, saying as much, then cleverly recreating the effect for themselves. these same people turn around and share their own code with the rest of the world via blog post or GitHub.
if anything this has helped spread the word about Path. this was how i first heard of them. throw in a bunch of people sharing and learning code techniques and it's a win for everyone.
> i'm sorry, i don't understand who is competing or how
> this hurts Path.
>
> all i've seen are people being inspired by Path, saying
> as much, then cleverly recreating the effect for
> themselves. these same people turn around and share
> their own code with the rest of the world via blog post
> or GitHub.
Looking at this from the perspective of Path, who have probably spent a fair amount of time thinking and conceiving the menu widget. Not just in how to implement it, but actually coming up with the idea, creating mock ups / wire frames, iterating on those mock ups, designing the icons, the animations, etc. All this for the sole purpose to give the user experience something new, and also to add a bit of delight to an app which could have easily become "yet another social networking app".Then someone comes along and copied all their hard work (without figuring out the concept, the design, the animation, etc) and (as if to rub salt into the wounds) released it for free for everyone to use.
Honestly, if I were Path I'd be rather frustrated that this has happened though as a developer I love the fact that someone has done this and shared their work :)
All I was trying to say was that in the field of UI, it is very hard to innovate though very easy to copy, and I can't help but feel that's what's happened here.
Path have made a very sexy looking widget which definitely added that certain something to their application, and someone has copied their hard work and made it free for everyone to use.
I wouldn't have found out about Path without this post, so I imagine that Path are happy about the publicity. It looks like a cool app.
What the the licensing implications of using this code & interaction model?
Luckily Path don't seem to have a patent on this, otherwise you'd have to change the circles to squares...
I'd add that vendor prefixes are one of the best reasons to use LESS (or SASS or SCSS, I just prefer LESS). Write one mixin (6 lines of code if you line break between each property) and you've just saved yourself countless keystrokes.
(another uselss comment tho)
.circle-outlines-star (@radius: 15px) {
-o-border-radius: @arguments;
...other prefixes, shortened for brevity...
}
Then you'd just add that in wherever you want some radius like so:
.star-container {
.circle-outlines-star(optional radius override here);
...and more styles...
}
Yeah, super simple and just off the top of my head but hopefully I addressed the question about loops. I don't know if you mean loops in code or literally like spinning animated loops. It's like 3am, got insomnia, and I'm effing commenting all night. Shoot me.I think you answered that question...