Live data from Hacker News

Realistic CSS3 Box Shadow trick with generated content

ballyhooblog.com

11–13 of 13 posts

Re: Realistic CSS3 Box Shadow trick with generated content

#12
post #10
post #8

Earlier quoted context omitted.

Someone posted another way to do this the other day: http://matthamm.com/box-shadow-curl.html ( http://news.ycombinator.com/item?id=1988977 ) It looks much nicer. Plus, calling the curl effect "realistic" is quite the exaggeration.

Please don't use this version of the effect. I've seen in on a couple of websites, and it seriously pains me to see it. Because the "page" doesn't actually "curl", it looks more like background has been pushed down in places.

I’m guessing they used it on a large element. Something like this is definitely meant for a sub-300px element, where the eye would get tricked into thinking there was a page curl.

Re: Realistic CSS3 Box Shadow trick with generated content

#13
post #6

Earlier quoted context omitted.

The lighting is incorrect. The shadow makes it look like the post-it note is actually just a ring of paper. A real shadow wouldn't just magically turn white/transparent as it gets further in from the edge, especially since the part that looks odd is tucked under the paper, and, in the physical world, would be darker since it's more hidden from the light source. I wrote a blog entry a few months ago on how to achieve…

You're correct. However, I think the described technique with generated content and transforms of multiple box shadows can be used to achieve realistic simulations of lighting, like the kinds in your blog post. The author's idea of realistic lighting effects indeed doesn't take into account the perspective of the curl on the note, and therefore looks a bit unnatural. P.s.: Great post.

Agreed. It’s one of the simplest guides to adding subtle texture to widgets out there, with the added bonus of being concise.
Post reply on HN