I was thinking of fanning out some cards to demonstrate options for one of our sites, and I wanted to do it in CSS, so I came up with this (Plan for fall-back in non-supporting browsers is just a button that shows the options). The plan is to show all options in full when the stack is clicked on, but right now it just fans out on hover.
This isn't anything terribly ground-breaking or difficult, but it is a nice, fun effect so I thought I'd share.
Edit:
I updated the link and code here to point to an updated version of the code that uses the css3 :target
selector to spread out the cards when a link is clicked, and collapse them when it's closed.
(See the full page example for better effect)
I used SASS to do handle some of the incremental and procedural parts, but did not leverage Compass, since I am not using it.
Really, all I'm doing is absolutely positioning div
s on top of each other,
making the transition origin to the bottom center, and rotating around the Z axis between -45° and 45° in regular intervals (determined by the number of cards).
I also added a drop-shadow for kicks that gets bigger as the cards go up - though this makes it look more like stairs, it does add a little depth.
Note that there was no javascript used in this example!
For an example of this in the wild, see the AWV Architectural Finishes page
Comments
Post a Comment