Zachary Johnson has put together another fun demo. He’s using some JavaScript and the new text-shadow property to build a spotlight effect. It’s embedded below. If you can’t view it, click through to his post.
@mozhacks on twitter
- Firefox 3.5.5 is out. 1 day ago
- @olivvv Can you give me a more specific example? in reply to olivvv 2 days ago
- Two important API changes: CSS gradients and the media 'load' element: http://bit.ly/xKM0S 2 days ago
- @juaneladio Reproducible crash downloading files on Fedora? in reply to juaneladio 4 days ago
- Jay Sullivan gives an overview of Firefox on Mobile beta. Same engine as Firefox 3.6 so it will rock: http://bit.ly/3H01CH 4 days ago
- More updates...
Links
Translations
Recent Posts
- two important api changes – CSS gradients and the media load event
- Firefox 3.6 Beta 1 now available – what’s new for web developers
- help build the mozilla developer network
- font_dragr: a drag and drop preview tool for fonts
- after Firefox 3.6 – new font control features for designers
- Web Open Font Format for Firefox 3.6
- making waves with HTML5
- a multi-touch drawing demo for Firefox 3.7
- new device API for Firefox 3.6: orientation
- mitigating attacks with content security policy
Categories
- 35 Days (45)
- @font-face (7)
- Audio (4)
- Canvas (11)
- CSS (28)
- Debugging (1)
- Demo (35)
- Device APIs (1)
- DOM (9)
- Drag and Drop (1)
- Feature (28)
- Firefox (7)
- Firefox 3.5 (44)
- Firefox 3.6 (5)
- Geolocation (3)
- Images (2)
- JavaScript (24)
- MDN (1)
- Multi-touch (2)
- Security (1)
- Standards (17)
- Survey (1)
- SVG (7)
- TraceMonkey (4)
- Uncategorized (3)
- Video (14)
- WebGL (3)
- XMLHttpRequest (3)


Hihi, I’m feeling like a little child again: That was one of the first Java applets that I had seen years and years ago and now we can do it so easily in the browser.
Thanks, Zach!
When will he be able to use a css gradient instead of a png for the spotlight effect?
Maybe we already are… I haven’t looked into this in a while:
Apply a CSS filter that references a graident filled SVG element as image. Since feImage should behave like “use” it should be possible to apply it that way.
thinsoldier, it would be awesome if we had -moz-mask and/or -moz-gradient CSS so that the spotlight could be pure CSS instead of a PNG.
On a side note, if you are using Firefox 3.0.11 you are seeing the spotlight but missing the shadow. Try out Firefox 3.5!
An idea for pure-CSS spotlight, sketched out with actual implementation left as an exercise for the reader: inset box-shadow and border-radius. I look forward to someone else doing the actual legwork.
Nice demo.
Christopher, you could change:
document.getElementById(’text-shadow-box’).onmousemove = onMouseMove;
to
window.addEventListener(”mousemove”, …);
so the effect works when mouse is out of frame.