I'm not quite sure what the intention was with the first part of this line:
if(!src.match(/http/) || typeof window === 'undefined') opacity = 1
Basically that means you won't get fading images for:
- Relative URLs (
<LegitImage src="foo.jpg" />)
- Protocol-less URLs (
<LegitImage src="//domain.com/foo.jpg" />)