News for hackers. Stuff that matters.
Re:CSS Raindrops on a Window by elwell on Tuesday November 26, 2013 @07:32PM (#6805369)
Works with animated gif of carlton: http://codepen.io/anon/pen/Atpgn
Re:CSS Raindrops on a Window by chriscoyier on Wednesday November 27, 2013 @10:46AM (#6808671)
It's amazing you can see the reflection through the raindrops change as well.
Re:CSS Raindrops on a Window by lbebber on Tuesday November 26, 2013 @08:04PM (#6805511)
Hahahhah this is great
Re:CSS Raindrops on a Window by nairteashop on Wednesday November 27, 2013 @01:17AM (#6806755)
I love these demos. A JS version of this was posted on HN a while back: http://maroslaw.github.io/rainyday.js
Re:CSS Raindrops on a Window by rwl4 on Wednesday November 27, 2013 @03:09AM (#6807061)
This one is by far my favorite. But the one just posted is very cool too. :)
Re:CSS Raindrops on a Window by rkv on Wednesday November 27, 2013 @11:12AM (#6808878)
This one is amazing: http://maroslaw.github.io/rainyday.js/demo012_4.html. Thanks for the link.
Re:CSS Raindrops on a Window by adamwong246 on Tuesday November 26, 2013 @06:59PM (#6805199)
Bonus points if you can you make the drops dribble downwards like so: http://www.netanimations.net/water-rainy-day_window_animated...
Re:CSS Raindrops on a Window by lbebber on Tuesday November 26, 2013 @07:18PM (#6805300)
If I can get to work on this again I will do that. I'm gonna have to use JS however.
Re:CSS Raindrops on a Window by adamwong246 on Tuesday November 26, 2013 @07:48PM (#6805443)
Cool. Sounds really hard though. To look realistic, the drops would have to merge into one another and also follow down previously established paths. It's pretty cool that you did this in just css but I think we have veered into WebGl territory.
Re:CSS Raindrops on a Window by lbebber on Tuesday November 26, 2013 @08:03PM (#6805508)
Yeah probably. Though still can be done with good enough results without WebGL I believe.
Re:CSS Raindrops on a Window by BHSPitMonkey on Tuesday November 26, 2013 @07:56PM (#6805478)
Re:CSS Raindrops on a Window by lbebber on Tuesday November 26, 2013 @08:01PM (#6805499)
Well that is impressive. However I don't know if there's a way to check for collisions that don't include the mouse pointer in CSS. (and I would like that if one drop falls over another they both merge)
Re:CSS Raindrops on a Window by BHSPitMonkey on Wednesday November 27, 2013 @04:42AM (#6807303)
(Note: I am not the author of this link; See its original HN discussion[1] for details.)

[1] https://news.ycombinator.com/item?id=6780008

Re:CSS Raindrops on a Window by mlader on Tuesday November 26, 2013 @11:32PM (#6806409)
Just figured out that you can make your ship temporarily disappear by right clicking =)
Re:CSS Raindrops on a Window by lloeki on Wednesday November 27, 2013 @03:24AM (#6807094)
Just for the sake of it, I swear that one[0] had a better video of the effect in the background, but they changed it.

[0]: http://www.rainymood.com/

Re:CSS Raindrops on a Window by cjfont on Tuesday November 26, 2013 @09:14PM (#6805783)
A simple improvement would be to make overlapping drops unite into one big oval, but it's otherwise very realistic.
Re:CSS Raindrops on a Window by drakaal on Tuesday November 26, 2013 @10:38PM (#6806160)
Very Cool. A couple of neat additions I can think of to make more realistic.

If two drops touch they become a large drop.

Drops over a certain size run down the window and consume any drops they touch.

Drops "dry" through decay at a set rate.

Re:CSS Raindrops on a Window by Angostura on Wednesday November 27, 2013 @06:57AM (#6807605)
Enthusiastic noob here. I can usually fathom what is going in these neat CSS demos, but this one baffles me. Could someone provide a few pointers as to how it's doing what it does?
Re:CSS Raindrops on a Window by lbebber on Wednesday November 27, 2013 @10:06AM (#6808357)
Hey, I made this thing.

Each rain drop takes an image, scales it down, rotates it 180ΒΊ, positions it according to the drop's position and crops in a round shape. Then a small border is added according to the drop's size. The trick is getting all those values right.

Re:CSS Raindrops on a Window by Angostura on Wednesday November 27, 2013 @11:29AM (#6809022)
Many thanks for answering. Much appreciated. Conceptually, I understand each of those steps. I'm much less clear on how the drop appears to refract the underlying image.
Re:CSS Raindrops on a Window by shrikant on Wednesday November 27, 2013 @07:32AM (#6807700)
Appears to be using cubic bezier CSS3 Transitions. https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using...
Re:CSS Raindrops on a Window by codygman on Wednesday November 27, 2013 @07:47AM (#6807745)
For some reason codepen tells me I don't have javascript enabled even though I do. Perhaps it doesn't like firefox on ubuntu?
Re:CSS Raindrops on a Window by zero-error on Wednesday November 27, 2013 @08:09AM (#6807822)
Works fine for me.

FF 25.0.1 on Ubuntu 13.10

Re:CSS Raindrops on a Window by trentmb on Wednesday November 27, 2013 @04:00AM (#6807181)
Why does codepen require cookies to work?
Re:CSS Raindrops on a Window by zghst on Wednesday November 27, 2013 @03:04AM (#6807049)
CSS filters work in IE11??