top | item 2399927

Show HN: CSS3 Animated Glowing Forms

182 points| kaylarose | 15 years ago |kaylarose.github.com | reply

I remember seeing the Dragon Labs Dragonfish Glowing Form Demo[1] when it first came out, and it always stuck in my head. They implement the effect by using a rather large background image and a mask image and move the background image around via Javascript. I was inspired and wanted to see how close I could get with CSS3.

I recommend using a Webkit browser [and you can see an alternate version of the animation on Firefox 4].

[1] http://labs.dragoninteractive.com/panel/demo/

57 comments

order
[+] kaylarose|15 years ago|reply
I remember being impressed by Dragon Lab's Dragonfish Login Form Demo[1] when it first came out. They implement the effect by using a rather large background image and a mask image and move the background image around via Javascript.

I wanted to see how close I could get using CSS3 without any images.

I recommend using a Webkit browser [you can also see an alternate implementation using Firefox 4]

[1]http://labs.dragoninteractive.com/panel/demo/

[+] edandersen|15 years ago|reply
>> They implement the effect by using a rather large background image and a mask image and move the background image around via Javascript.

Scrolling the background image position with javascript can be really slow on even recent browsers, pushing the CPU when software rendering. Mobile Safari also shows image "seams" between mask images when zoomed out.

[+] bmelton|15 years ago|reply
I usually consider these exercises as fun, but pointless. This certainly meets that criteria, but I could actually see using this in a project.

It is very hot.

Are you also creating the 'Log in' button with CSS3? It's a little off on my screen. Browser is Chrome 9 on Windows 7: http://imgur.com/E9tif

[+] kaylarose|15 years ago|reply
The button uses a combination of a border radius and and inset box shadow to achieve the top highlight, and for some reason Chrome doesn't seem to contain the box shadow within the border boundaries.
[+] jarin|15 years ago|reply
Okay, that is just sexy looking. I feel like I need to make a gaming site now or something.
[+] Xurinos|15 years ago|reply
Usability problem: the animation attracts attention, distracts the eye. The moving glow, mixed with the small lettering, makes it hard to read quickly. When the animation finally stopped on my system, I was suddenly able to read the lettering easier.

This is cool-looking, for sure.

[+] jarin|15 years ago|reply
Adding a little bit more padding on the form and making the labels lighter would probably fix that problem.
[+] malnourish|15 years ago|reply
Firefox 4, animation does not restart after focusing a form field, clicking elsewhere, and then re-focusing on it.

I quite like the whole effect, though.

[+] kaylarose|15 years ago|reply
I'm still working out the kinks in the alternate Firefox implementation which was actually my first attempt at this effect.
[+] elii|15 years ago|reply
What's the point of having animated glowing forms if they swallow 50% of the machine's cpu?
[+] jarin|15 years ago|reply
I don't think the goal of an animated glowing form is to minimize CPU usage, so this is a bit of a non sequitur.
[+] melvinram|15 years ago|reply
Am I the only one that thought "hmm, this is <blink> 2011"?
[+] jat850|15 years ago|reply
Maybe, or maybe not, but this is nowhere near as offensive as blink. This is fairly subtle, and if put to a greyscale series, it would be barely even noticeable except as some neat lighting effects.
[+] radley|15 years ago|reply
"The logo is on fire," explains one surfer. "Why is the logo on fire?" she asks. "Uh," he stammers as the enthusiasm in his voice quickly dissipates, "it's a flaming logo."
[+] rhizome|15 years ago|reply
Very nice. I recently tested out a few designs using large CSS3 shadows and it indeed slowed the browser way down when applied to a "FB Wall" number of page elements. Hopefully we don't have to wait for hardware to pick up the slack in implementation here.
[+] kaylarose|15 years ago|reply
The Webkit implementation uses 2 layers of: looped keyframes, color transitions, multi-colorstop gradient backgrounds (which are then animated via background-position animation). And all that sits under two larger inset rgba box-shadows. [+ the gradients and shadows on the inner form itself]

That said, I've actually been pretty pleased performance-wise, I expected worse.

[+] AndyJPartridge|15 years ago|reply
I'm loving that glow!

Great work.

I'm outside on a laptop and can hardly read the grey text though.

[+] kaylarose|15 years ago|reply
Yeah, on some monitors the contrast is pretty low. I'll probably bump it up.
[+] kingsidharth|15 years ago|reply
Whatever happened to usability
[+] JeremyBanks|15 years ago|reply
Is this making some usability mistake? It seems like it has straightforward HTML that will work fine if the spiffy stuff isn't supported.
[+] retlehs|15 years ago|reply
Submit button is broken. Why is it outside of the <form>?

Cool use of animation.

[+] kaylarose|15 years ago|reply
It's not meant to be a working form. Just a tech demo.
[+] zinssmeister|15 years ago|reply
super slick! I can see this work well on an iPhone webview. I want it like ice cream :)

Awesome job man.

[+] kaylarose|15 years ago|reply
Good to hear, I didn't get a chance to test on the iPhone.

Also, I am not a man. But thanks!

[+] NY_USA_Hacker|15 years ago|reply
Remember, about 25% of men are partially red-green color blind. So, a 'fire engine red' such as in the usual banner at HN such men can see, but lots of 'red' in mixtures of colors register as black. An emerald green can be seen, but in lots of mixtures the greens don't register. So, some light greens register as gray.

I'm such a man and mostly can't read that page.

[+] jiaaro|15 years ago|reply
I agree on the importance of accessibility but just wanted to make a note that the only colors on that page are the glowing effect around the form.

the rest of the page actually is grey.

The entire design COULD use a little bump in contrast to aid readability though

[+] kaylarose|15 years ago|reply
Edit: Sorry, other people beat me to it. See other replies re:text colors.

However I agree about the contrast, I checked on my external dev monitor (vs. my super bright MBP screen) and the contrast could definitely use some work.

[+] natrius|15 years ago|reply
The text on the page is actually gray (#444).
[+] biot|15 years ago|reply
A bit of an aside, but to my eyes the HN banner is better described as 'burnt orange' or 'dark carrot' rather than fire engine red.
[+] mkilling|15 years ago|reply
Why does this have 160 upvotes on Hacker News? It's CSS, it doesn't work in all browser and it's not even remotely useful