Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I code this awesome glowing border effect with CSS and JavaScript?

Tags:

javascript

css

This form has an awesome effect when you focus on one of its fields:

http://labs.dragoninteractive.com/panel/demo/

Any clues on how I can recreate this? Here are a few of my observations:

  • I see they have a giant colorful image here: http://labs.dragoninteractive.com/panel/demo/lib/img/form/map/rmap.jpg
  • When you focus on the form the color seems to fade in (and fades away on blur)
  • I don't know how they are getting the soft edge (glow) using the source image they have
  • I don't know how they are panning the colorful image across the border infinitely
  • The markup seems pretty messy; ideally I'd want a simpler solution than what they have
  • This one is a clone made all with CSS3, but I don't like how the outer glow doesn't stay uniform
like image 921
Kirk Ouimet Avatar asked May 29 '11 01:05

Kirk Ouimet


People also ask

How do you make a border glow in HTML?

In this tutorial, you'll find some methods of creating a glowing border around an input field with CSS properties. In the example below, we add the :focus pseudo-class to the <input> element and then, specify the border-color and box-shadow properties. Also, we set the outline property to “none”.


1 Answers

The color changing action occurs as the position of rmap.jpg (the very large colorful image) is animated. There is an .png with alpha-transparencies which acts as matte over rmap.jpg, creating the nice soft color transition. The animation is handled using jQuery.

Peter Schmalfeldt created a demo which is also downloadable.

like image 109
KatieK Avatar answered Oct 20 '22 06:10

KatieK