The fullscreen API is a bit of mess across multiple browsers so it uses the fscreen library to handle the api call. This is the library recommended in the mozilla docs.
Since we want the button to show up when moving the mouse anywhere on the screen it listens to mouse move events on body. There doesn't seem to be a place for internal react components so while the button could be a component I think it makes more sense to just have the onClick listener.
Coverage remained the same at 88.732% when pulling 348e6bfcff0b00da890b52a39a9c9ef7a1063a84 on nicholasRutherford:fullscreen-button into 9db6e2ae71caa9270e3124f9c937fdee3c476b73 on kittoframework:master.
Add a button to enable full screen mode. (Closes #19 )
The tiny icon in the top right:
Test it out here!
The fullscreen API is a bit of mess across multiple browsers so it uses the fscreen library to handle the api call. This is the library recommended in the mozilla docs.
Since we want the button to show up when moving the mouse anywhere on the screen it listens to mouse move events on
body
. There doesn't seem to be a place for internal react components so while the button could be a component I think it makes more sense to just have the onClick listener.