diff --git a/webclient/src/App.js b/webclient/src/App.js index 3489093..56de518 100644 --- a/webclient/src/App.js +++ b/webclient/src/App.js @@ -5,7 +5,7 @@ import './Style-light.css'; import './Style-dark.css'; import './Style-red.css'; import './fonts/Fonts.css'; -import { ForwardDot } from './utils.js'; +import { BackwardDot, ForwardDot } from './utils.js'; import Feed from './Feed.js'; import Article from './Article.js'; import Comments from './Comments.js'; @@ -53,6 +53,23 @@ class App extends React.Component { } } + goFullScreen() { + if ('wakeLock' in navigator) { + navigator.wakeLock.request('screen'); + } + + document.body.requestFullscreen({ navigationUI: 'hide' }).then(() => { + window.addEventListener('resize', () => this.forceUpdate()); + this.forceUpdate(); + }); + }; + + exitFullScreen() { + document.exitFullscreen().then(() => { + this.forceUpdate(); + }); + }; + render() { const theme = this.state.theme; document.body.style.backgroundColor = theme ? '#000' : '#eeeeee'; @@ -70,6 +87,11 @@ class App extends React.Component {