Skip to content

A React component to switch some browser on and off

Notifications You must be signed in to change notification settings

antoninadert/browserSwitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browser Specific Code

While working with animations, I figured out that Safari does not support smooth scroll and FireFox has glitches rendering the snowfall. So I needed browser specific behavior and ended up creating a react component that renders code for specific browsers.

You can find the code for the component here — Browser Component. I’m thinking about writing thorough test cases and open-sourcing this component sometime soon.

It’s pretty neat to use the component like this.

<Browser except firefox chrome mobile>
  <span>All the magic tricks in this site work best in 
    <b>Chrome!</b>
  </span>
</Browser>
<Browser only firefox>
  <span>Magic background is disabled in FireFox. Try in 
    <b>Chrome!</b>
  </span>
</Browser>

source here

License

MIT © Dinesh Pandiyan

About

A React component to switch some browser on and off

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published